linux-stable/fs/overlayfs
Miklos Szeredi 7c8c9e1e53 ovl: make ioctl() safe
commit 89bdfaf93d upstream.

ovl_ioctl_set_flags() does a capability check using flags, but then the
real ioctl double-fetches flags and uses potentially different value.

The "Check the capability before cred override" comment misleading: user
can skip this check by presenting benign flags first and then overwriting
them to non-benign flags.

Just remove the cred override for now, hoping this doesn't cause a
regression.

The proper solution is to create a new setxflags i_op (patches are in the
works).

Xfstests don't show a regression.

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Fixes: dab5ca8fd9 ("ovl: add lsattr/chattr support")
Cc: <stable@vger.kernel.org> # v4.19
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-30 11:54:16 +01:00
..
copy_up.c ovl: pass ovl_fs down to functions accessing private xattrs 2020-09-02 10:58:49 +02:00
dir.c ovl: pass ovl_fs down to functions accessing private xattrs 2020-09-02 10:58:49 +02:00
export.c ovl: pass ovl_fs down to functions accessing private xattrs 2020-09-02 10:58:49 +02:00
file.c ovl: make ioctl() safe 2020-12-30 11:54:16 +01:00
inode.c ovl: rearrange ovl_can_list() 2020-09-02 10:58:49 +02:00
Kconfig docs: fix broken references to text files 2020-04-20 15:35:59 -06:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
namei.c ovl: enumerate private xattrs 2020-09-02 10:58:49 +02:00
overlayfs.h ovl: support [S|G]ETFLAGS and FS[S|G]ETXATTR ioctls for directories 2020-10-06 15:38:14 +02:00
ovl_entry.h ovl: provide a mount option "volatile" 2020-09-02 10:58:48 +02:00
readdir.c ovl: support [S|G]ETFLAGS and FS[S|G]ETXATTR ioctls for directories 2020-10-06 15:38:14 +02:00
super.c ovl: pass ovl_fs down to functions accessing private xattrs 2020-09-02 10:58:49 +02:00
util.c ovl: enumerate private xattrs 2020-09-02 10:58:49 +02:00