driver: core: add security labels to misc class devnode
PATCH 3/3 driver: core: add security labels to misc class devnode
Add support for setting security labels on devtmpfs nodes created by misc class drivers using misc_register.
--- drivers/char/misc.c | 5 +++++ include/linux/miscdevice.h | 2 ++ 2 files changed, 7 insertions(+)
drivers/char/misc.c +5 -0
@@ -274,6 +274,11 @@ static char *misc_devnode(struct device *dev, umode_t *mode,if (mode && c->mode) *mode = c->mode; +if (xattr && xattr->value && c->xattr_value) { + xattr->name = c->xattr_name; +strcpy (xattr->value, c->xattr_value); + xattr->value_len =strlen (xattr->value); + }if (c->nodename)return kstrdup (c->nodename,GFP_KERNEL );return NULL ;
include/linux/miscdevice.h +2 -0
@@ -64,6 +64,8 @@ struct miscdevice {const struct attribute_group **groups;const char *nodename;umode_t mode; +const char *xattr_name; +const char *xattr_value; };extern int misc_register (struct miscdevice *misc);
Signature · 1 line
1.8.5.5
'Greg Kroah-Hartman'
maintainerQuoted 5 lines · Namjae Jeon
Add support for setting security labels on devtmpfs nodes created by misc class drivers using
misc_register.Signed-off-by Namjae Jeon <[email protected]>Signed-off-by Vivek Trivedi <[email protected]>
Again, which misc driver wants to do this?
thanks,
greg k-h
Quoted 8 lines · Namjae Jeon
Quoted 5 lines
Add support for setting security labels on devtmpfs nodes created by misc class drivers using
misc_register.Signed-off-by Namjae Jeon <[email protected]>Signed-off-by Vivek Trivedi <[email protected]>Again, which misc driver wants to do this?
yes, misc driver in our system(tizen) want to use this feature. I think this will be useful for other systems also which do not have udev like user space helpers
Quoted 4 lines
thanks,
greg k-h
'Greg Kroah-Hartman'
maintainerQuoted 11 lines · Namjae Jeon
Quoted 8 lines · Namjae Jeon
Quoted 5 lines
Add support for setting security labels on devtmpfs nodes created by misc class drivers using
misc_register.Signed-off-by Namjae Jeon <[email protected]>Signed-off-by Vivek Trivedi <[email protected]>Again, which misc driver wants to do this?
yes, misc driver in our system(tizen) want to use this feature. I think this will be useful for other systems also which do not have udev like user space helpers
I don't see that driver merged so I can't accept this, sorry.
greg k-h