From 3c2670e6515cf584810f417db9b00992c8b2d75a Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Sat, 6 Apr 2013 09:56:00 -0700 Subject: driver core: add uid and gid to devtmpfs Some drivers want to tell userspace what uid and gid should be used for their device nodes, so allow that information to percolate through the driver core to userspace in order to make this happen. This means that some systems (i.e. Android and friends) will not need to even run a udev-like daemon for their device node manager and can just rely in devtmpfs fully, reducing their footprint even more. Signed-off-by: Kay Sievers Signed-off-by: Greg Kroah-Hartman --- block/genhd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'block') diff --git a/block/genhd.c b/block/genhd.c index 3c001fba80c7..dfcec431ceea 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -1111,7 +1111,8 @@ struct class block_class = { .name = "block", }; -static char *block_devnode(struct device *dev, umode_t *mode) +static char *block_devnode(struct device *dev, umode_t *mode, + uid_t *uid, gid_t *gid) { struct gendisk *disk = dev_to_disk(dev); -- cgit v1.2.3 From 4e4098a3e08783cfd75f9fcdab276dc1d46931da Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 11 Apr 2013 11:43:29 -0700 Subject: driver core: handle user namespaces properly with the uid/gid devtmpfs change Now that devtmpfs is caring about uid/gid, we need to use the correct internal types so users who have USER_NS enabled will have things work properly for them. Thanks to Eric for pointing this out, and the patch review. Reported-by: Eric W. Biederman Cc: Kay Sievers Cc: Ming Lei Signed-off-by: Greg Kroah-Hartman --- block/genhd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'block') diff --git a/block/genhd.c b/block/genhd.c index dfcec431ceea..20625eed5511 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -1112,7 +1112,7 @@ struct class block_class = { }; static char *block_devnode(struct device *dev, umode_t *mode, - uid_t *uid, gid_t *gid) + kuid_t *uid, kgid_t *gid) { struct gendisk *disk = dev_to_disk(dev); -- cgit v1.2.3