Re: Different behaviour of euqually secured devices

From: Kasper Dupont (remove.invalid_at_nospam.lir.dk.invalid)
Date: 08/14/04

  • Next message: sean larsson: "Re: A universal device driver library?"
    Date: Sat, 14 Aug 2004 18:54:29 +0200
    
    

    "P.T. Breuer" wrote:
    >
    > I am surprised that the file system layer let you get through the
    > permissions barrier in order to let the kernel driver involved
    > decide what to say to you, but apparently my knowledge is deficient as
    > to what fs drivers do when an unprivileged user accesses a
    > permission-protected special device file. Apparently at least some of
    > them hand the decision over to the kernel layer below, which returned
    > -EACCESS (or -EPERM, which? You tell me) to the open attempt when
    > it examined your processes credentials.

    AFAIK all permission checks go through the permission
    function in fs/namei.c:

    http://lxr.linux.no/source/fs/namei.c#L199

    Looks like the filesystem can override the default
    vfs_permission. But it doesn't look like the char
    driver itself can override the permission checks.

    So I guess the same permission function should
    apply to all inodes in /dev.

    My suggestion is to check what filesystem is being
    used for /dev, and which inodes show this weird
    behavioure. Does it apply to only /dev/tty0 or also
    /dev/tty[1-9]? And does it depend on the name or
    the device number?

    I'd also take a look through the source for this
    particular kernel version to see if there are any
    differences to the permission and vfs_permission
    functions.

    -- 
    Kasper Dupont -- der bruger for meget tid paa usenet.
    Design #413859655
    It's a computer monitor! It is great for hammering in nails!
    

  • Next message: sean larsson: "Re: A universal device driver library?"

    Relevant Pages