]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
UBUNTU: SAUCE: shiftfs: fix passing of attrs to underaly for setattr
authorSeth Forshee <seth.forshee@canonical.com>
Sat, 13 Apr 2019 19:41:01 +0000 (14:41 -0500)
committerAndrea Righi <andrea.righi@canonical.com>
Thu, 9 Mar 2023 14:57:17 +0000 (15:57 +0100)
commitc1d5858389a51a1a6fa4ed1dae597a142b078a08
tree2d5ab356083b0dd59f28fdaadeefe1ae8d63b28f
parent60bf4e044977ef7b09a806f8b7dbd79c7a961ba1
UBUNTU: SAUCE: shiftfs: fix passing of attrs to underaly for setattr

BugLink: https://bugs.launchpad.net/bugs/1824717
shiftfs_setattr() makes a copy of the attrs it was passed to pass
to the lower fs. It then calls setattr_prepare() with the original
attrs, and this may make changes which are not reflected in the
attrs passed to the lower fs. To fix this, copy the attrs to the
new struct for the lower fs after calling setattr_prepare().

Additionally, notify_change() may have set ATTR_MODE when one of
ATTR_KILL_S[UG]ID is set, and passing this combination to
notify_change() will trigger a BUG(). Do as overlayfs and
ecryptfs both do, and clear ATTR_MODE if either of those bits
is set.

Reviewed-by: Christian Brauner <christian.brauner@ubuntu.com>
Acked-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
fs/shiftfs.c