Skip to content

Commit

Permalink
dm table: Avoid null pointer dereference
Browse files Browse the repository at this point in the history
Test: vts_libdm_test

Unable to handle kernel access to user memory outside uaccess routines
at virtual address 0000000000000018
[   83.108561] Mem abort info:
[   83.108896]   ESR = 0x96000005
[   83.109191]   Exception class = DABT (current EL), IL = 32 bits
[   83.110203]   SET = 0, FnV = 0
[   83.110505]   EA = 0, S1PTW = 0
[   83.110894] Data abort info:
[   83.111182]   ISV = 0, ISS = 0x00000005
[   83.111537]   CM = 0, WnR = 0
[   83.111929] user pgtable: 4k pages, 39-bit VAs, pgdp = 00000000cff2854e
[   83.112534] [0000000000000018] pgd=0000000033f28003, pud=0000000033f28003, pmd=0000000000000000
[   83.113403] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[   83.113912] Modules linked in: 8723cs
[   83.114257] Process vts_libdm_test (pid: 1985, stack limit = 0x000000007ea1bacc)
[   83.114923] CPU: 3 PID: 1985 Comm: vts_libdm_test Not tainted 4.19.154 rockchip-linux#41
[   83.115534] Hardware name: Rockchip rk3326 863 rkisp1 board (DT)
[   83.116082] pstate: 40400005 (nZcv daif +PAN -UAO)
[   83.116534] pc : __pi_strncmp+0x24/0x208
[   83.116908] lr : dm_table_add_target+0x184/0x3bc
[   83.117326] sp : ffffff8012bcbb70

Fixes: 531fc5e ("dm: add check target device probe completely")
Signed-off-by: Bian Jin chen <[email protected]>
Change-Id: Icb943c4d1dfe116b3b39f4cd77b2eda232de65fe
  • Loading branch information
Ken-u authored and rkhuangtao committed Nov 17, 2020
1 parent 64e1eac commit 0c17853
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/md/dm-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ int dm_table_add_target(struct dm_table *t, const char *type,
}

#ifdef CONFIG_ARCH_ROCKCHIP
while (argv &&
while (argv && (argc > 1) &&
strncmp(argv[1], "PARTUUID=", 9) == 0 &&
name_to_dev_t(argv[1]) == 0) {
DMINFO("%s: %s: Waiting for device %s ...",
Expand Down

0 comments on commit 0c17853

Please sign in to comment.