summaryrefslogtreecommitdiff
path: root/net/unix/af_unix.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2025-07-06 16:38:13 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2025-09-27 20:13:56 -0400
commitcdc59a62bccadf104159547690a06d2b9aa88085 (patch)
treebc44ec067adf81770d8925b4f2624de105620065 /net/unix/af_unix.c
parentb320789d6883cc00ac78ce83bccbfe7ed58afcf0 (diff)
kernel/acct.c: saner struct file treatment
Instead of switching ->f_path.mnt of an opened file to internal clone, get a struct path with ->mnt set to internal clone of that ->f_path.mnt, then dentry_open() that to get the file with right ->f_path.mnt from the very beginning. The only subtle part here is that on failure exits we need to close the file with __fput_sync() and make sure we do that *before* dropping the original mount. With that done, only fs/{file_table,open,namei}.c ever store anything to file->f_path and only prior to file->f_mode & FMODE_OPENED becoming true. Analysis of mount write count handling also becomes less brittle and convoluted... [AV: folded a fix for a bug spotted by Jan Kara - we do need a full-blown open of the original file, not just user_path_at() or we end up skipping permission checks] Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions