summaryrefslogtreecommitdiff
path: root/scripts/basic
diff options
context:
space:
mode:
authorHongling Zeng <zenghongling@kylinos.cn>2026-10-13 09:56:52 +0800
committerNamjae Jeon <linkinjeon@kernel.org>2026-10-20 17:28:06 +0900
commit1205ab57465810341fb1436bab310cebdfd0ecdc (patch)
treeb7599b74b366f69f83c594562849fde2f0e9569a /scripts/basic
parent279b1a14cdbecdb134069748230a73ae25d4fd72 (diff)
downloadlinux-next-1205ab57465810341fb1436bab310cebdfd0ecdc.tar.gz
linux-next-1205ab57465810341fb1436bab310cebdfd0ecdc.zip
ntfs: roll back the ACL xattr commit when the WSL mode update fails
ntfs_set_acl_ex() commits the ACL xattr before it rewrites the WSL mode EA, and removes it again when the rewrite fails. That only undoes a set that created the xattr: when the update replaced or removed an existing one, the old ACL is discarded along with the failed update. No error is recorded when the undo fails, so the new, typically more permissive, ACL is left on disk while i_mode, the mode EA and the cached ACL keep the old values. After a remount, a chmod 0640 -> 0777 that reported failure leaves the file accessible to the relaxed ACL while stat() still reports 0640. Save the previous xattr before committing the update, and restore it when the mode EA rewrite fails. A removed xattr is created again, since XATTR_REPLACE fails with -ENODATA once the removal dropped the entry. Remove the new xattr only when there was no previous one, and skip the undo when the commit changed nothing. A failed rollback is recorded: NVolSetErrors(), which the next persistence point persists as VOLUME_IS_DIRTY, and a log message the errors= policy acts on. The flag cannot be written to disk here directly: the target inode's mrec_lock is held and the $Volume mrec_lock cannot be nested under it. Fixes: fc053f05ca28 ("ntfs: add reparse and ea operations") Cc: stable@vger.kernel.org Suggested-by: Hyunchul Lee <hyc.lee@gmail.com> Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn> Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Diffstat (limited to 'scripts/basic')
0 files changed, 0 insertions, 0 deletions