[PATCH 0/1][SRU][Disco] shiftfs: fix passing of attrs to underaly for setattr
Seth Forshee
seth.forshee at canonical.com
Sun Apr 14 15:44:21 UTC 2019
https://bugs.launchpad.net/bugs/1824717
SRU Justification
Impact: It is possible to hit a BUG statement in notify_change() with
shiftfs. This occurs when one of ATTR_KILL_SUID or ATTR_KILL_SGID is set
in the attrs and notify_change() sets ATTR_MODE before calling
shiftfs_setattr(). shiftfs_setattr() passes the attrs to
notify_change(), and the BUG statement is hit due to ATTR_MODE being set
with one of ATTR_KILL_SUID or ATTR_KILL_SGID set.
Fix: Copy the logic used by ecryptfs and overlayfs to clear ATTR_MODE if
one of these bits is set, allowing the lower fs to interpret the kill
bits in its own way. Also fix a bug where changes to the attrs from
setattr_prepare() are not propagated to the attrs used for the lower fs.
Regression Potential: Limited to shiftfs, matches the behavior of other
stacked filesystems, and has been tested (see below).
Test Case: Tested in the lxd CI environment where the bug was originally
discovered. No regressions were seen, and the BUG statement was not hit.
Thanks,
Seth
---
Seth Forshee (1):
shiftfs: fix passing of attrs to underaly for setattr
fs/shiftfs.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
More information about the kernel-team
mailing list