Public bug reported:
SRU Justification
Impact: shiftfs_setattr() creates an iattr struct with shifted ids for
the lower fs, but then mistakenly passes the original iattr struct when
changing the lower filesystem attributes. As a result, chown on a
shiftfs filesystem sets ownership using the untranslated user and group
ids.
Fix: Pass the struct containing shifted uids to notify_change().
Regression Potential: This is a simple and obvious fix, and it has been
tested to confirm it fixes the issue. Therefore the risk of regressions
is low.
Test Case: Within a lxd container using shiftfs, run:
# mkdir dir
# touch file
# ls -lh dir file
drwxr-xr-x 2 root root 4.0K Apr 11 13:05 dir
-rw-r--r-- 1 root root 0 Apr 11 13:05 file
# chown 500:500 dir file
# ls -lh dir file
Expected result:
drwxr-xr-x 2 500 500 4.0K Apr 11 13:05 dir
-rw-r--r-- 1 500 500 0 Apr 11 13:05 file
Result in 5.0.0-10.11:
drwxr-xr-x 2 1000500 1000500 4.0K Apr 11 12:42 dir
-rw-r--r-- 1 1000500 1000500 0 Apr 11 12:42 file
** Affects: linux (Ubuntu)
Importance: High
Assignee: Seth Forshee (sforshee)
Status: In Progress
** Summary changed:
- chown sets wrong owner in shiftfs
+ shiftfs: chown sets untranslated ids in lower fs
--
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1824350
Title:
shiftfs: chown sets untranslated ids in lower fs
Status in linux package in Ubuntu:
In Progress
Bug description:
SRU Justification
Impact: shiftfs_setattr() creates an iattr struct with shifted ids for
the lower fs, but then mistakenly passes the original iattr struct
when changing the lower filesystem attributes. As a result, chown on a
shiftfs filesystem sets ownership using the untranslated user and
group ids.
Fix: Pass the struct containing shifted uids to notify_change().
Regression Potential: This is a simple and obvious fix, and it has
been tested to confirm it fixes the issue. Therefore the risk of
regressions is low.
Test Case: Within a lxd container using shiftfs, run:
# mkdir dir
# touch file
# ls -lh dir file
drwxr-xr-x 2 root root 4.0K Apr 11 13:05 dir
-rw-r--r-- 1 root root 0 Apr 11 13:05 file
# chown 500:500 dir file
# ls -lh dir file
Expected result:
drwxr-xr-x 2 500 500 4.0K Apr 11 13:05 dir
-rw-r--r-- 1 500 500 0 Apr 11 13:05 file
Result in 5.0.0-10.11:
drwxr-xr-x 2 1000500 1000500 4.0K Apr 11 12:42 dir
-rw-r--r-- 1 1000500 1000500 0 Apr 11 12:42 file
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1824350/+subscriptions
--
Mailing list: https://launchpad.net/~kernel-packages
Post to : [email protected]
Unsubscribe : https://launchpad.net/~kernel-packages
More help : https://help.launchpad.net/ListHelp