devfs
[Top] [All Lists]

data returned from /dev/.devfsd

To: devfs@xxxxxxxxxxx
Subject: data returned from /dev/.devfsd
From: Russell Coker <russell@xxxxxxxxxxxx>
Date: Sun, 4 Aug 2002 19:42:26 +0200
Reply-to: Russell Coker <russell@xxxxxxxxxxxx>
Sender: owner-devfs@xxxxxxxxxxx
The .devfsd interface doesn't allow any extensions to the interface.  If the 
devfsd_notify_struct was changed to the following:

struct devfsd_extension
{
    unsigned int ext_type;   /* type of the extension */
    unsigned int len;    /* length of this extension packet including this
                                    field and the ext_type field */
    /* other data goes here */
};

struct devfsd_notify_struct
{   /*  Use native C types to ensure same types in kernel and user space   */
    unsigned int type;          /*  DEVFSD_NOTIFY_* value                   */
    unsigned int mode;          /*  Mode of the inode or device entry       */
    unsigned int major;         /*  Major number of device entry            */
    unsigned int minor;         /*  Minor number of device entry            */
    unsigned int uid;           /*  Uid of process, inode or device entry   */
    unsigned int gid;           /*  Gid of process, inode or device entry   */
    unsigned int overrun_count;  /*  Number of lost events                 */
    unsigned int namelen;       /*  Number of characters not including '\0' */
    /*  The device name MUST come last                                      */
    char devname[DEVFS_PATHLEN]; /*  This will be '\0' terminated           */
    unsigned int extlen;       /*  Number of characters in extension fields */
    /* devfsd_extension data */
};

With this the main devfsd doesn't need to be modified and can just ignore the 
extra data.  Any modules that need extra data can look through the extension 
list for anything that they know about, the rest can ignore it.

The CPU time required for this shouldn't be too great, and it won't hurt the 
common case where there are no extensions.

What I want to do is have my SE Linux devfsd module know the security context 
(expressed as an unsigned int) of the process that is accessing a device 
node.  Alternate solutions to this problem are welcome.

-- 
I do not get viruses because I do not use MS software.
If you use Outlook then please do not put my email address in your
address-book so that WHEN you get a virus it won't use my address in the
>From field.

<Prev in Thread] Current Thread [Next in Thread>