diff options
author | David Howells <dhowells@redhat.com> | 2020-01-14 17:06:14 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-01-14 18:40:06 +0100 |
commit | 8379bb84be757d5df2d818509faec5d66adb861d (patch) | |
tree | 4a5c150198cfdde4c07e4cfe55995c5cd51830df /fs/afs | |
parent | Linux 5.4 (diff) | |
download | linux-8379bb84be757d5df2d818509faec5d66adb861d.tar.xz linux-8379bb84be757d5df2d818509faec5d66adb861d.zip |
keys: Fix request_key() cache
When the key cached by request_key() and co. is cleaned up on exit(),
the code looks in the wrong task_struct, and so clears the wrong cache.
This leads to anomalies in key refcounting when doing, say, a kernel
build on an afs volume, that then trigger kasan to report a
use-after-free when the key is viewed in /proc/keys.
Fix this by making exit_creds() look in the passed-in task_struct rather
than in current (the task_struct cleanup code is deferred by RCU and
potentially run in another task).
Fixes: 7743c48e54ee ("keys: Cache result of request_key*() temporarily in task_struct")
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/afs')
0 files changed, 0 insertions, 0 deletions