Jisheng Zhang
a8616d2dc1
riscv: vdso: fix NULL deference in vdso_join_timens() when vfork
...
Testing tools/testing/selftests/timens/vfork_exec.c got below
kernel log:
[ 6.838454] Unable to handle kernel access to user memory without uaccess routines at virtual address 0000000000000020
[ 6.842255] Oops [#1 ]
[ 6.842871] Modules linked in:
[ 6.844249] CPU: 1 PID: 64 Comm: vfork_exec Not tainted 6.0.0-rc3-rt15+ #8
[ 6.845861] Hardware name: riscv-virtio,qemu (DT)
[ 6.848009] epc : vdso_join_timens+0xd2/0x110
[ 6.850097] ra : vdso_join_timens+0xd2/0x110
[ 6.851164] epc : ffffffff8000635c ra : ffffffff8000635c sp : ff6000000181fbf0
[ 6.852562] gp : ffffffff80cff648 tp : ff60000000fdb700 t0 : 3030303030303030
[ 6.853852] t1 : 0000000000000030 t2 : 3030303030303030 s0 : ff6000000181fc40
[ 6.854984] s1 : ff60000001e6c000 a0 : 0000000000000010 a1 : ffffffff8005654c
[ 6.856221] a2 : 00000000ffffefff a3 : 0000000000000000 a4 : 0000000000000000
[ 6.858114] a5 : 0000000000000000 a6 : 0000000000000008 a7 : 0000000000000038
[ 6.859484] s2 : ff60000001e6c068 s3 : ff6000000108abb0 s4 : 0000000000000000
[ 6.860751] s5 : 0000000000001000 s6 : ffffffff8089dc40 s7 : ffffffff8089dc38
[ 6.862029] s8 : ffffffff8089dc30 s9 : ff60000000fdbe38 s10: 000000000000005e
[ 6.863304] s11: ffffffff80cc3510 t3 : ffffffff80d1112f t4 : ffffffff80d1112f
[ 6.864565] t5 : ffffffff80d11130 t6 : ff6000000181fa00
[ 6.865561] status: 0000000000000120 badaddr: 0000000000000020 cause: 000000000000000d
[ 6.868046] [<ffffffff8008dc94>] timens_commit+0x38/0x11a
[ 6.869089] [<ffffffff8008dde8>] timens_on_fork+0x72/0xb4
[ 6.870055] [<ffffffff80190096>] begin_new_exec+0x3c6/0x9f0
[ 6.871231] [<ffffffff801d826c>] load_elf_binary+0x628/0x1214
[ 6.872304] [<ffffffff8018ee7a>] bprm_execve+0x1f2/0x4e4
[ 6.873243] [<ffffffff8018f90c>] do_execveat_common+0x16e/0x1ee
[ 6.874258] [<ffffffff8018f9c8>] sys_execve+0x3c/0x48
[ 6.875162] [<ffffffff80003556>] ret_from_syscall+0x0/0x2
[ 6.877484] ---[ end trace 0000000000000000 ]---
This is because the mm->context.vdso_info is NULL in vfork case. From
another side, mm->context.vdso_info either points to vdso info
for RV64 or vdso info for compat, there's no need to bloat riscv's
mm_context_t, we can handle the difference when setup the additional
page for vdso.
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Suggested-by: Palmer Dabbelt <palmer@rivosinc.com>
Fixes: 3092eb456375 ("riscv: compat: vdso: Add setup additional pages implementation")
Link: https://lore.kernel.org/r/20220924070737.3048-1-jszhang@kernel.org
Cc: stable@vger.kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2022-10-13 11:16:52 -07:00
..
2022-08-11 08:03:49 -07:00
2022-06-02 15:55:22 -07:00
2022-05-11 21:36:33 -07:00
2022-01-05 17:53:29 -08:00
2021-07-06 12:11:38 -07:00
2022-07-21 17:17:29 -07:00
2022-05-21 10:31:47 -07:00
2022-07-21 17:17:29 -07:00
2022-01-15 08:47:31 -08:00
2022-05-19 23:46:10 +02:00
2022-07-28 15:30:51 -07:00
2022-10-13 08:46:31 -07:00
2020-09-15 18:46:08 -07:00
2020-09-19 13:21:11 -07:00
2020-06-10 19:47:16 -07:00
2022-05-21 10:31:45 -07:00
2022-04-26 13:36:12 -07:00
2022-08-11 13:46:51 -07:00
2022-08-11 13:06:47 -07:00
2022-03-10 09:29:21 -08:00
2022-08-11 14:41:52 -07:00
2022-03-30 15:15:27 -07:00
2019-06-05 17:36:37 +02:00
2022-06-28 20:13:09 +02:00
2022-10-13 11:06:56 -07:00
2022-08-10 20:49:32 -07:00
2022-01-05 17:52:54 -08:00
2022-05-11 21:36:33 -07:00
2021-04-26 08:25:01 -07:00
2022-01-05 17:53:29 -08:00
2020-07-09 20:12:28 -07:00
2022-01-05 17:53:05 -08:00
2020-06-03 20:09:46 -07:00
2022-08-11 14:41:52 -07:00
2019-12-19 09:32:45 -07:00
2021-06-30 20:55:40 -07:00
2022-06-01 21:46:31 -07:00
2021-03-09 20:46:00 -08:00
2019-11-05 09:20:42 -08:00
2020-07-30 11:37:43 -07:00
2022-01-19 17:54:09 -08:00
2022-05-11 11:50:10 -07:00
2020-05-18 11:38:10 -07:00
2022-05-30 16:04:37 -07:00
2021-06-30 20:55:41 -07:00
2020-07-09 20:12:28 -07:00
2021-09-30 21:24:06 -04:00
2022-07-29 17:15:06 +05:30
2022-01-06 14:38:50 +05:30
2022-07-29 17:14:11 +05:30
2022-07-29 17:14:53 +05:30
2022-08-19 23:22:47 +05:30
2022-08-12 07:43:57 -07:00
2019-06-05 17:36:37 +02:00
2020-07-30 11:37:46 -07:00
2020-05-13 17:11:46 -07:00
2021-06-30 20:55:39 -07:00
2022-10-13 11:16:52 -07:00
2021-01-14 15:08:58 -08:00
2020-04-23 10:50:26 +09:00
2022-03-29 14:31:07 -07:00
2021-01-14 15:08:58 -08:00
2022-06-28 13:20:21 +02:00
2020-05-18 11:38:12 -07:00
2020-05-18 11:38:13 -07:00
2022-08-06 15:04:48 -07:00
2022-03-21 14:58:12 -07:00
2022-02-14 16:32:39 -08:00
2022-05-11 21:36:33 -07:00
2022-07-11 09:33:35 +05:30
2022-05-11 21:36:33 -07:00
2022-08-05 16:32:45 -07:00
2021-01-14 15:09:06 -08:00
2022-07-19 16:39:14 -07:00
2020-06-03 20:09:50 -07:00
2021-07-05 20:53:09 -07:00
2022-08-11 14:58:32 -07:00
2020-11-20 11:16:35 -08:00
2021-06-30 21:18:58 -07:00
2021-06-30 21:18:58 -07:00
2022-05-17 16:37:21 -07:00
2022-08-18 14:42:52 -07:00
2022-07-19 16:39:09 -07:00
2021-01-07 19:00:50 -08:00
2022-01-19 17:54:07 -08:00
2021-01-14 15:09:10 -08:00
2021-01-14 15:09:11 -08:00
2021-03-09 18:18:31 -08:00
2022-03-10 09:29:31 -08:00
2022-06-16 10:51:31 -07:00
2022-04-26 13:36:25 -07:00
2022-08-18 14:42:58 -07:00
2022-05-13 23:59:23 +02:00
2019-06-05 17:36:37 +02:00
2021-06-08 17:05:03 -07:00
2022-02-25 09:36:05 +01:00
2022-06-01 21:46:36 -07:00
2021-01-14 15:09:08 -08:00
2022-04-26 13:36:53 -07:00
2022-05-11 21:36:33 -07:00
2020-04-23 10:50:26 +09:00
2019-12-10 10:12:55 +01:00
2019-06-05 17:36:37 +02:00
2022-05-25 14:43:33 -07:00