gaoxiang17
006568ab4c
pid: Add a judgment for ns null in pid_nr_ns
__task_pid_nr_ns
ns = task_active_pid_ns(current);
pid_nr_ns(rcu_dereference(*task_pid_ptr(task, type)), ns);
if (pid && ns->level <= pid->level) {
Sometimes null is returned for task_active_pid_ns. Then it will trigger kernel panic in pid_nr_ns.
For example:
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000058
Mem abort info:
ESR = 0x0000000096000007
EC = 0x25: DABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
FSC = 0x07: level 3 translation fault
Data abort info:
ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
CM = 0, WnR = 0, TnD = 0, TagAccess = 0
GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
user pgtable: 4k pages, 39-bit VAs, pgdp=00000002175aa000
[0000000000000058] pgd=08000002175ab003, p4d=08000002175ab003, pud=08000002175ab003, pmd=08000002175be003, pte=0000000000000000
pstate: 834000c5 (Nzcv daIF +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
pc : __task_pid_nr_ns+0x74/0xd0
lr : __task_pid_nr_ns+0x24/0xd0
sp : ffffffc08001bd10
x29: ffffffc08001bd10 x28: ffffffd4422b2000 x27: 0000000000000001
x26: ffffffd442821168 x25: ffffffd442821000 x24: 00000f89492eab31
x23: 00000000000000c0 x22: ffffff806f5693c0 x21: ffffff806f5693c0
x20: 0000000000000001 x19: 0000000000000000 x18: 0000000000000000
x17: 00000000529c6ef0 x16: 00000000529c6ef0 x15: 00000000023a1adc
x14: 0000000000000003 x13: 00000000007ef6d8 x12: 001167c391c78800
x11: 00ffffffffffffff x10: 0000000000000000 x9 : 0000000000000001
x8 : ffffff80816fa3c0 x7 : 0000000000000000 x6 : 49534d702d535449
x5 : ffffffc080c4c2c0 x4 : ffffffd43ee128c8 x3 : ffffffd43ee124dc
x2 : 0000000000000000 x1 : 0000000000000001 x0 : ffffff806f5693c0
Call trace:
__task_pid_nr_ns+0x74/0xd0
...
__handle_irq_event_percpu+0xd4/0x284
handle_irq_event+0x48/0xb0
handle_fasteoi_irq+0x160/0x2d8
generic_handle_domain_irq+0x44/0x60
gic_handle_irq+0x4c/0x114
call_on_irq_stack+0x3c/0x74
do_interrupt_handler+0x4c/0x84
el1_interrupt+0x34/0x58
el1h_64_irq_handler+0x18/0x24
el1h_64_irq+0x68/0x6c
account_kernel_stack+0x60/0x144
exit_task_stack_account+0x1c/0x80
do_exit+0x7e4/0xaf8
...
get_signal+0x7bc/0x8d8
do_notify_resume+0x128/0x828
el0_svc+0x6c/0x70
el0t_64_sync_handler+0x68/0xbc
el0t_64_sync+0x1a8/0x1ac
Code: 35fffe54 911a02a8 f9400108 b4000128 (b9405a69)
---[ end trace 0000000000000000 ]---
Kernel panic - not syncing: Oops: Fatal exception in interrupt
Signed-off-by: gaoxiang17 <gaoxiang17@xiaomi.com>
Link: https://lore.kernel.org/20250802022123.3536934-1-gxxa03070307@gmail.com
Reviewed-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
2025-08-19 13:38:20 +02:00
..
2025-08-02 09:04:57 -07:00
2025-07-31 16:04:19 -07:00
2025-07-21 21:41:57 -07:00
2025-04-02 18:17:33 -07:00
2025-06-12 08:38:40 +02:00
2025-07-30 17:14:01 -07:00
2025-08-05 21:55:29 +02:00
2025-07-11 16:02:01 +02:00
2025-04-30 21:53:35 +02:00
2025-08-06 10:29:48 +02:00
2025-07-23 08:51:32 +02:00
2025-05-14 13:16:24 +02:00
2025-08-03 16:23:09 -07:00
2025-08-05 16:02:07 +03:00
2025-07-30 19:26:49 -07:00
2025-08-04 10:54:36 -07:00
2025-07-31 16:29:46 -07:00
2025-08-04 10:51:22 -07:00
2025-07-31 16:52:32 -07:00
2025-08-03 16:23:09 -07:00
2025-07-31 10:20:11 -04:00
2025-06-24 20:30:37 +09:00
2025-02-12 12:24:16 +01:00
2025-06-23 14:01:49 -04:00
2025-04-15 11:32:34 +02:00
2025-04-11 14:14:41 -04:00
2025-06-16 17:00:06 -04:00
2024-12-05 19:22:38 -05:00
2025-06-16 17:00:06 -04:00
2024-06-24 22:24:55 -07:00
2024-04-29 08:29:29 -07:00
2025-03-07 22:03:09 -06:00
2025-07-31 18:23:53 -07:00
2025-03-04 18:44:29 -08:00
2025-08-06 22:48:12 +02:00
2025-07-19 19:08:23 -07:00
2025-05-21 10:48:21 -07:00
2025-07-19 19:08:23 -07:00
2024-12-02 11:25:09 +01:00
2025-05-27 19:40:33 -07:00
2024-02-23 17:48:22 -08:00
2025-08-03 16:23:09 -07:00
2025-08-10 08:11:39 +03:00
2025-07-17 07:56:50 -10:00
2025-08-06 10:23:36 +09:00
2025-07-19 19:08:26 -07:00
2025-02-21 15:05:38 +01:00
2025-01-13 22:40:36 -08:00
2025-03-10 11:54:46 +01:00
2024-07-20 16:33:21 +09:00
2025-01-02 22:12:12 +01:00
2025-07-16 18:34:42 -07:00
2025-02-21 10:25:33 +01:00
2025-02-21 09:20:30 +01:00
2025-06-25 15:55:04 -07:00
2024-11-07 15:25:05 +01:00
2025-07-09 22:57:52 -07:00
2025-08-03 16:23:09 -07:00
2025-03-16 22:30:47 -07:00
2025-08-03 16:23:09 -07:00
2025-07-31 14:57:54 -07:00
2025-08-02 12:01:38 -07:00
2025-08-02 12:01:38 -07:00
2024-12-24 09:46:49 +01:00
2025-07-15 18:45:34 +09:00
2025-07-21 21:40:39 -07:00
2025-01-07 16:59:15 +01:00
2025-07-09 22:57:55 -07:00
2025-01-28 13:48:37 +01:00
2025-08-06 07:32:52 +03:00
2024-11-05 17:12:31 -08:00
2025-05-09 13:13:54 +02:00
2025-06-13 17:26:17 +08:00
2025-08-03 16:23:09 -07:00
2025-05-07 20:24:59 +02:00
2025-03-06 10:18:36 +01:00
2025-01-28 13:48:37 +01:00
2025-08-19 13:38:20 +02:00
2024-08-04 13:36:28 -07:00
2025-05-11 17:48:15 -07:00
2025-04-01 10:06:52 -07:00
2024-04-25 21:07:03 -07:00
2025-07-09 22:57:52 -07:00
2024-10-09 12:47:19 -07:00
2025-07-24 17:57:59 -07:00
2025-03-06 22:26:49 +01:00
2024-11-14 16:09:51 -08:00
2025-02-24 11:17:10 -08:00
2025-06-16 17:01:22 +02:00
2025-08-02 14:24:50 +02:00
2025-06-13 08:47:20 +02:00
2025-03-25 10:46:44 +01:00
2025-03-30 15:44:36 -07:00
2025-07-01 15:02:03 +02:00
2024-07-18 12:19:20 -07:00
2025-07-31 14:57:54 -07:00
2025-04-14 14:13:41 +02:00
2025-07-23 11:56:02 +02:00
2025-01-13 22:40:36 -08:00
2024-11-03 01:28:06 -05:00
2025-02-05 07:14:24 -08:00
2025-03-21 15:30:10 -04:00
2024-07-12 16:39:53 -07:00
2025-08-02 12:01:38 -07:00
2025-01-28 13:48:37 +01:00
2025-02-12 12:12:27 +01:00
2024-09-12 12:16:09 +02:00
2025-01-28 13:48:37 +01:00
2025-08-01 09:11:08 -04:00
2025-05-11 17:54:04 -07:00
2025-03-24 09:52:37 -07:00
2025-07-31 11:28:03 -04:00
2025-07-04 13:17:30 +01:00
2025-05-21 10:48:22 -07:00
2025-07-31 15:40:22 -07:00