diff options
author | Marc Dionne <marc.dionne@auristor.com> | 2019-08-22 13:28:43 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-09-10 10:35:24 +0100 |
commit | 3f66858358891311582a179d3443cfcdde476e86 (patch) | |
tree | bf1099363605655f31629482f6e3ba08364b6ece /fs/btrfs/delayed-inode.c | |
parent | c231241d83b960ec7b57f172921d223c28dce014 (diff) | |
download | linux-stable-3f66858358891311582a179d3443cfcdde476e86.tar.gz linux-stable-3f66858358891311582a179d3443cfcdde476e86.tar.bz2 linux-stable-3f66858358891311582a179d3443cfcdde476e86.zip |
afs: Fix possible oops in afs_lookup trace event
[ Upstream commit c4c613ff08d92e72bf64a65ec35a2c3aa1cfcd06 ]
The afs_lookup trace event can cause the following:
[ 216.576777] BUG: kernel NULL pointer dereference, address: 000000000000023b
[ 216.576803] #PF: supervisor read access in kernel mode
[ 216.576813] #PF: error_code(0x0000) - not-present page
...
[ 216.576913] RIP: 0010:trace_event_raw_event_afs_lookup+0x9e/0x1c0 [kafs]
If the inode from afs_do_lookup() is an error other than ENOENT, or if it
is ENOENT and afs_try_auto_mntpt() returns an error, the trace event will
try to dereference the error pointer as a valid pointer.
Use IS_ERR_OR_NULL to only pass a valid pointer for the trace, or NULL.
Ideally the trace would include the error value, but for now just avoid
the oops.
Fixes: 80548b03991f ("afs: Add more tracepoints")
Signed-off-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/btrfs/delayed-inode.c')
0 files changed, 0 insertions, 0 deletions