diff options
author | David Howells <dhowells@redhat.com> | 2022-12-15 17:20:04 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-12-19 10:51:31 +0100 |
commit | eaa02390adb03b82f04babebf0cdd233793aecf5 (patch) | |
tree | 626516667ad4910db3a3f3cde28342bd2126ece8 /net/rxrpc | |
parent | rxrpc: Fix security setting propagation (diff) | |
download | linux-eaa02390adb03b82f04babebf0cdd233793aecf5.tar.xz linux-eaa02390adb03b82f04babebf0cdd233793aecf5.zip |
rxrpc: Fix NULL deref in rxrpc_unuse_local()
Fix rxrpc_unuse_local() to get the debug_id *after* checking to see if
local is NULL.
Fixes: a2cf3264f331 ("rxrpc: Fold __rxrpc_unuse_local() into rxrpc_unuse_local()")
Reported-by: syzbot+3538a6a72efa8b059c38@syzkaller.appspotmail.com
Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: syzbot+3538a6a72efa8b059c38@syzkaller.appspotmail.com
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rxrpc')
-rw-r--r-- | net/rxrpc/local_object.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/rxrpc/local_object.c b/net/rxrpc/local_object.c index 44222923c0d1..24ee585d9aaf 100644 --- a/net/rxrpc/local_object.c +++ b/net/rxrpc/local_object.c @@ -357,10 +357,11 @@ struct rxrpc_local *rxrpc_use_local(struct rxrpc_local *local, */ void rxrpc_unuse_local(struct rxrpc_local *local, enum rxrpc_local_trace why) { - unsigned int debug_id = local->debug_id; + unsigned int debug_id; int r, u; if (local) { + debug_id = local->debug_id; r = refcount_read(&local->ref); u = atomic_dec_return(&local->active_users); trace_rxrpc_local(debug_id, why, r, u); |