Skip to content
Commit 0ecee669 authored by Eric Biggers's avatar Eric Biggers Committed by Al Viro
Browse files

fs/namespace.c: fix use-after-free of mount in mnt_warn_timestamp_expiry()



After do_add_mount() returns success, the caller doesn't hold a
reference to the 'struct mount' anymore.  So it's invalid to access it
in mnt_warn_timestamp_expiry().

Fix it by calling mnt_warn_timestamp_expiry() before do_add_mount()
rather than after, and adjusting the warning message accordingly.

Reported-by: default avatar <syzbot+da4f525235510683d855@syzkaller.appspotmail.com>
Fixes: f8b92ba6 ("mount: Add mount warning for impending timestamp expiry")
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 4f5cafb5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment