David Howells
75845c6c1a
keys: Fix UAF in key_put()
...
Once a key's reference count has been reduced to 0, the garbage collector
thread may destroy it at any time and so key_put() is not allowed to touch
the key after that point. The most key_put() is normally allowed to do is
to touch key_gc_work as that's a static global variable.
However, in an effort to speed up the reclamation of quota, this is now
done in key_put() once the key's usage is reduced to 0 - but now the code
is looking at the key after the deadline, which is forbidden.
Fix this by using a flag to indicate that a key can be gc'd now rather than
looking at the key's refcount in the garbage collector.
Fixes: 9578e327b2b4 ("keys: update key quotas in key_put()")
Reported-by: syzbot+6105ffc1ded71d194d6d@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/673b6aec.050a0220.87769.004a.GAE@google.com/
Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: syzbot+6105ffc1ded71d194d6d@syzkaller.appspotmail.com
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
2025-03-22 15:36:49 +02:00
..
2025-01-09 22:57:34 +01:00
2025-01-27 16:07:42 +01:00
2025-02-13 16:58:51 +01:00
2025-01-24 14:56:59 -08:00
2025-01-10 15:25:01 +01:00
2025-01-12 23:49:23 +01:00
2025-01-23 11:32:28 -07:00
2025-01-18 16:18:48 -06:00
2025-01-22 09:16:02 -08:00
2025-01-14 11:13:35 -08:00
2025-01-15 19:24:03 +01:00
2025-01-27 16:29:16 -08:00
2025-01-14 13:56:33 +01:00
2025-01-22 09:03:41 -08:00
2025-02-02 06:54:51 -10:00
2025-01-29 14:38:19 -08:00
2025-01-10 15:20:04 +00:00
2025-02-19 16:45:24 -05:00
2025-01-17 12:40:20 +01:00
2025-01-16 12:04:38 -06:00
2025-01-25 20:22:35 -08:00
2025-01-09 13:38:04 +02:00
2025-01-22 20:34:42 -08:00
2025-01-12 20:20:59 -08:00
2025-01-12 23:55:50 +01:00
2025-03-12 08:26:36 -06:00
2025-02-25 19:45:21 -07:00
2025-01-23 08:04:07 -08:00
2025-01-25 20:22:23 -08:00
2025-01-27 08:50:19 -08:00
2025-03-01 02:54:18 -05:00
2025-02-02 06:54:51 -10:00
2025-03-10 20:02:14 +01:00
2025-03-05 21:36:15 -08:00
2025-02-28 16:45:36 -08:00
2025-01-18 12:33:39 -08:00
2025-01-08 18:15:03 +01:00
2025-01-19 13:45:35 -05:00
2025-01-27 09:39:19 -05:00
2025-03-02 12:57:37 +01:00
2025-03-16 17:40:23 -07:00
2025-02-01 15:07:56 -08:00
2025-01-15 13:14:37 +01:00
2025-01-12 20:21:16 -08:00
2025-01-17 22:23:47 +01:00
2025-01-10 15:49:06 +01:00
2025-02-04 14:08:22 +01:00
2025-01-20 11:44:57 -08:00
2025-01-11 01:25:26 +09:00
2025-02-21 14:09:47 +01:00
2025-01-27 19:25:23 -05:00
2025-03-12 17:57:32 +01:00
2025-01-21 21:55:49 -05:00
2025-01-13 17:47:29 -06:00
2025-01-25 20:22:31 -08:00
2025-01-09 10:14:16 +01:00
2025-01-09 10:14:16 +01:00
2025-01-09 10:06:14 +01:00
2025-01-14 11:31:13 +08:00
2025-01-23 20:06:35 +01:00
2025-01-16 13:06:14 +01:00
2025-01-13 22:40:49 -08:00
2025-03-08 14:34:06 -10:00
2025-01-10 00:54:21 +00:00
2025-02-05 14:22:12 +01:00
2025-01-15 16:26:39 +02:00
2025-01-13 15:34:09 +01:00
2025-01-14 12:17:27 +01:00
2025-01-09 10:09:11 +01:00
2025-01-23 11:32:28 -07:00
2025-01-15 21:38:53 +01:00
2025-01-31 09:30:49 +01:00
2025-01-10 09:00:13 +09:00
2025-01-26 13:04:37 +01:00
2025-01-26 18:36:23 -08:00
2025-01-27 09:39:07 -05:00
2025-01-25 08:22:26 +00:00
2025-03-22 15:36:49 +02:00
2025-01-17 12:52:27 +01:00
2025-01-14 19:45:35 +01:00
2025-01-25 20:22:40 -08:00
2025-01-08 18:15:03 +01:00
2025-02-04 11:27:45 -05:00
2025-03-19 07:31:43 -07:00
2025-01-13 22:40:38 -08:00
2025-02-07 10:27:25 +01:00
2025-03-05 21:36:16 -08:00
2025-01-21 20:09:14 -08:00
2025-01-24 22:47:28 -08:00
2025-01-25 20:22:38 -08:00
2025-01-13 22:40:58 -08:00
2025-01-13 22:40:51 -08:00
2025-01-25 20:22:21 -08:00
2025-01-13 22:40:30 -08:00
2025-01-26 17:50:53 -08:00
2025-01-24 22:47:27 -08:00
2025-01-25 20:22:39 -08:00
2025-02-18 08:50:36 +01:00
2025-03-17 22:27:27 -07:00
2025-01-13 22:40:50 -08:00
2025-01-25 20:22:23 -08:00
2025-01-08 18:14:23 +01:00
2025-01-25 20:22:39 -08:00
2025-02-06 01:08:58 +09:00
2025-01-20 09:40:49 -08:00
2025-01-15 15:07:23 -08:00
2025-01-14 17:29:04 -08:00
2025-02-20 10:53:25 +01:00
2025-02-13 16:00:38 +01:00
2025-02-25 15:07:24 -05:00
2025-01-21 11:34:43 -05:00
2025-01-14 17:05:10 -05:00
2025-01-14 17:04:05 -05:00
2025-01-30 09:13:35 -08:00
2025-01-14 17:05:10 -05:00
2025-01-25 20:22:29 -08:00
2025-02-18 07:13:26 -08:00
2025-02-18 07:39:42 -08:00
2025-01-18 15:04:23 -06:00
2025-01-17 08:52:57 -06:00
2025-01-25 20:22:42 -08:00
2025-01-13 22:40:44 -08:00
2025-01-25 20:22:44 -08:00
2025-02-10 09:22:32 +01:00
2025-01-15 14:52:12 -06:00
2025-01-25 16:03:40 -08:00
2025-01-13 22:40:35 -08:00
2025-01-18 17:40:10 -08:00
2025-01-14 11:44:19 +01:00
2025-01-16 17:22:59 -08:00
2025-01-20 10:29:11 -08:00
2025-03-06 18:25:35 -10:00
2025-03-04 20:45:34 +01:00
2025-01-16 13:04:41 -08:00
2025-01-20 09:05:51 +05:30
2025-01-17 20:27:46 +01:00
2025-01-30 15:10:34 -08:00
2025-01-10 11:59:00 +01:00
2025-01-15 22:39:18 +01:00
2025-01-14 18:24:33 +01:00
2025-03-16 17:40:22 -07:00
2025-01-13 17:47:29 -06:00
2025-02-14 18:39:19 -05:00
2025-01-27 15:45:29 -08:00
2025-01-13 14:53:18 +01:00
2025-01-09 16:58:52 +01:00
2025-01-11 20:39:43 +01:00
2025-01-29 15:21:31 +01:00
2025-03-05 21:36:15 -08:00
2025-01-08 14:50:11 -08:00
2025-01-26 18:36:23 -08:00
2025-01-22 10:35:56 +01:00
2025-01-29 13:32:23 -08:00
2025-01-11 20:39:43 +01:00
2025-02-25 18:15:43 -08:00
2025-01-29 09:04:28 -08:00
2025-02-08 14:12:17 -08:00
2025-03-16 17:40:24 -07:00
2025-01-25 20:22:37 -08:00
2025-02-01 03:53:23 -08:00
2025-01-09 10:43:58 +01:00
2025-01-13 22:40:36 -08:00
2025-01-21 15:30:01 -05:00
2025-01-15 19:49:14 +01:00
2025-01-23 17:51:16 -08:00
2025-01-12 20:20:59 -08:00
2025-01-12 19:03:37 -08:00
2025-01-19 12:44:28 +08:00
2025-01-27 09:39:26 -05:00
2025-01-10 16:12:45 +01:00