dicken.ding
b84a8aba80
genirq/irqdesc: Prevent use-after-free in irq_find_at_or_after()
...
irq_find_at_or_after() dereferences the interrupt descriptor which is
returned by mt_find() while neither holding sparse_irq_lock nor RCU read
lock, which means the descriptor can be freed between mt_find() and the
dereference:
CPU0 CPU1
desc = mt_find()
delayed_free_desc(desc)
irq_desc_get_irq(desc)
The use-after-free is reported by KASAN:
Call trace:
irq_get_next_irq+0x58/0x84
show_stat+0x638/0x824
seq_read_iter+0x158/0x4ec
proc_reg_read_iter+0x94/0x12c
vfs_read+0x1e0/0x2c8
Freed by task 4471:
slab_free_freelist_hook+0x174/0x1e0
__kmem_cache_free+0xa4/0x1dc
kfree+0x64/0x128
irq_kobj_release+0x28/0x3c
kobject_put+0xcc/0x1e0
delayed_free_desc+0x14/0x2c
rcu_do_batch+0x214/0x720
Guard the access with a RCU read lock section.
Fixes: 721255b982 ("genirq: Use a maple tree for interrupt descriptor management")
Signed-off-by: dicken.ding <dicken.ding@mediatek.com >
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20240524091739.31611-1-dicken.ding@mediatek.com
2024-05-24 12:49:35 +02:00
..
2024-05-19 09:21:03 -07:00
2024-05-19 11:38:15 -07:00
2024-05-13 14:14:05 -07:00
2024-04-26 17:13:31 +01:00
2024-05-20 10:23:39 -07:00
2024-03-12 13:23:32 +01:00
2024-05-19 09:21:03 -07:00
2024-05-06 17:39:09 +02:00
2023-10-18 14:43:22 -07:00
2024-05-24 12:49:35 +02:00
2024-05-07 11:39:50 -07:00
2024-05-09 15:48:01 +02:00
2024-05-22 10:49:54 -07:00
2024-05-22 12:13:40 -07:00
2024-05-21 08:34:51 -07:00
2024-05-22 11:53:02 -07:00
2024-05-01 13:04:02 +02:00
2024-05-21 15:29:01 -07:00
2024-05-17 17:31:24 -07:00
2024-05-19 14:02:03 -07:00
2024-04-24 09:43:53 +02:00
2024-02-09 11:13:59 -10:00
2024-04-04 16:24:16 +02:00
2024-04-04 16:24:16 +02:00
2024-01-25 10:12:22 -05:00
2023-07-21 12:17:25 -04:00
2024-01-25 09:59:27 -05:00
2023-10-13 18:34:46 +02:00
2024-02-05 13:22:34 -10:00
2024-04-29 08:29:29 -07:00
2023-08-08 16:48:47 -04:00
2023-03-14 19:32:38 -07:00
2024-03-22 11:18:18 +01:00
2024-05-15 17:06:08 -07:00
2024-05-19 14:02:03 -07:00
2024-05-08 08:41:26 -07:00
2024-02-23 17:33:31 -05:00
2024-04-24 09:43:54 +02:00
2024-02-23 17:48:22 -08:00
2024-04-24 09:43:53 +02:00
2023-09-21 12:03:50 -06:00
2023-02-08 13:36:22 +01:00
2024-04-25 20:56:20 -07:00
2023-12-23 15:52:13 +01:00
2023-05-28 16:20:21 +09:00
2023-09-29 11:28:39 -07:00
2024-04-24 09:43:53 +02:00
2023-08-21 13:37:28 -07:00
2023-03-24 11:01:29 +01:00
2024-03-22 11:18:16 +01:00
2024-05-02 19:48:26 +09:00
2024-04-25 20:55:57 -07:00
2024-05-02 19:48:26 +09:00
2023-10-19 11:02:48 +02:00
2024-02-23 17:48:22 -08:00
2024-04-25 21:07:04 -07:00
2024-04-24 09:43:53 +02:00
2024-04-23 14:59:01 +10:00
2024-02-23 17:48:22 -08:00
2024-04-23 14:59:01 +10:00
2023-03-24 20:10:59 -07:00
2024-05-17 19:17:55 -07:00
2023-06-08 12:27:20 -07:00
2024-05-02 19:48:26 +09:00
2024-05-06 14:22:02 -06:00
2024-04-24 09:43:53 +02:00
2024-02-23 17:48:22 -08:00
2023-04-08 13:45:38 -07:00
2024-03-01 12:23:37 +01:00
2023-12-20 19:26:30 -05:00
2024-04-12 15:07:51 +08:00
2024-04-24 09:43:53 +02:00
2023-12-01 09:51:44 -08:00
2024-04-24 09:43:53 +02:00
2024-04-24 09:43:53 +02:00
2024-03-13 12:53:53 -07:00
2024-04-27 11:17:48 -07:00
2024-02-22 15:38:52 -08:00
2024-04-24 09:43:53 +02:00
2024-04-25 21:07:03 -07:00
2023-12-29 12:22:27 -08:00
2024-01-09 11:46:20 -08:00
2023-07-14 15:02:57 -07:00
2024-05-17 17:31:24 -07:00
2024-04-24 09:43:53 +02:00
2023-10-30 17:56:53 -10:00
2023-10-04 10:41:57 -07:00
2024-04-29 05:03:51 +02:00
2024-05-17 17:31:24 -07:00
2023-12-29 12:22:29 -08:00
2024-01-09 12:57:46 -08:00
2024-05-22 09:56:00 -07:00
2024-04-24 09:43:53 +02:00
2023-09-19 13:21:32 -07:00
2023-10-04 10:41:57 -07:00
2023-09-24 17:24:01 +02:00
2023-02-18 14:34:36 -05:00
2024-05-17 17:31:24 -07:00
2024-04-24 09:43:53 +02:00
2023-09-13 14:59:24 +02:00
2024-02-22 15:38:52 -08:00
2024-05-06 17:39:09 +02:00
2024-04-24 09:43:53 +02:00
2023-06-08 15:43:09 -04:00
2024-04-25 20:56:00 -07:00
2023-12-21 13:17:54 +01:00
2023-06-19 16:25:28 -07:00
2024-05-08 08:41:29 -07:00
2024-05-19 14:02:03 -07:00
2023-08-07 15:57:22 -10:00
2024-05-15 11:40:33 -10:00