]> git.baikalelectronics.ru Git - kernel.git/commit
afs: Fix use-after-loss-of-ref
authorDavid Howells <dhowells@redhat.com>
Tue, 14 Jan 2020 16:16:25 +0000 (16:16 +0000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 14 Jan 2020 17:40:06 +0000 (09:40 -0800)
commit7573113eeeda2e67529efdb392474362487a6bcc
tree2a359efe3c25cac13f68e7847925888fc160bc21
parent2687ace1645679106d152c1536e8ae7f9e445ab0
afs: Fix use-after-loss-of-ref

afs_lookup() has a tracepoint to indicate the outcome of
d_splice_alias(), passing it the inode to retrieve the fid from.
However, the function gave up its ref on that inode when it called
d_splice_alias(), which may have failed and dropped the inode.

Fix this by caching the fid.

Fixes: 5833e6942c84 ("afs: Add more tracepoints")
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/afs/dir.c
include/trace/events/afs.h