]> git.baikalelectronics.ru Git - kernel.git/commit
vfs: allow unprivileged whiteout creation
authorMiklos Szeredi <mszeredi@redhat.com>
Thu, 14 May 2020 14:44:23 +0000 (16:44 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Thu, 14 May 2020 14:44:23 +0000 (16:44 +0200)
commitc9bd17aefa05081e871eca973ecd9855f737e04d
treec06d4a05f89fea5d5ea3f4729ab6748140bbb77a
parent8ecc5738678b2f445f0371be7f844ee9bb84f61d
vfs: allow unprivileged whiteout creation

Whiteouts, unlike real device node should not require privileges to create.

The general concern with device nodes is that opening them can have side
effects.  The kernel already avoids zero major (see
Documentation/admin-guide/devices.txt).  To be on the safe side the patch
explicitly forbids registering a char device with 0/0 number (see
cdev_add()).

This guarantees that a non-O_PATH open on a whiteout will fail with ENODEV;
i.e. it won't have any side effect.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/char_dev.c
fs/namei.c
include/linux/device_cgroup.h
include/linux/fs.h