Skip to content

Commit 2957fa4

Browse files
amir73ilbrauner
authored andcommitted
fs/backing_file: fix wrong argument in callback
Commit 48b5062 ("backing-file: clean up the API") unintentionally changed the argument in the ->accessed() callback from the user file to the backing file. Fixes: 48b5062 ("backing-file: clean up the API") Reported-by: syzbot+8d1206605b05ca9a0e6a@syzkaller.appspotmail.com Closes: https://lore.kernel.org/linux-unionfs/67447b3c.050a0220.1cc393.0085.GAE@google.com/ Tested-by: syzbot+8d1206605b05ca9a0e6a@syzkaller.appspotmail.com Signed-off-by: Amir Goldstein <amir73il@gmail.com> Link: https://lore.kernel.org/r/20241126145342.364869-1-amir73il@gmail.com Acked-by: Miklos Szeredi <mszeredi@redhat.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent e767523 commit 2957fa4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/backing-file.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ int backing_file_mmap(struct file *file, struct vm_area_struct *vma,
327327
struct backing_file_ctx *ctx)
328328
{
329329
const struct cred *old_cred;
330+
struct file *user_file = vma->vm_file;
330331
int ret;
331332

332333
if (WARN_ON_ONCE(!(file->f_mode & FMODE_BACKING)))
@@ -342,7 +343,7 @@ int backing_file_mmap(struct file *file, struct vm_area_struct *vma,
342343
revert_creds_light(old_cred);
343344

344345
if (ctx->accessed)
345-
ctx->accessed(vma->vm_file);
346+
ctx->accessed(user_file);
346347

347348
return ret;
348349
}

0 commit comments

Comments
 (0)