Tudor Ambarus
98336988c7
dm: fix copying after src array boundaries
commit f1aff4bc199cb92c055668caed65505e3b4d2656 upstream.
The blammed commit copied to argv the size of the reallocated argv,
instead of the size of the old_argv, thus reading and copying from
past the old_argv allocated memory.
Following BUG_ON was hit:
[ 3.038929][ T1] kernel BUG at lib/string_helpers.c:1040!
[ 3.039147][ T1] Internal error: Oops - BUG: 00000000f2000800 [#1] SMP
...
[ 3.056489][ T1] Call trace:
[ 3.056591][ T1] __fortify_panic+0x10/0x18 (P)
[ 3.056773][ T1] dm_split_args+0x20c/0x210
[ 3.056942][ T1] dm_table_add_target+0x13c/0x360
[ 3.057132][ T1] table_load+0x110/0x3ac
[ 3.057292][ T1] dm_ctl_ioctl+0x424/0x56c
[ 3.057457][ T1] __arm64_sys_ioctl+0xa8/0xec
[ 3.057634][ T1] invoke_syscall+0x58/0x10c
[ 3.057804][ T1] el0_svc_common+0xa8/0xdc
[ 3.057970][ T1] do_el0_svc+0x1c/0x28
[ 3.058123][ T1] el0_svc+0x50/0xac
[ 3.058266][ T1] el0t_64_sync_handler+0x60/0xc4
[ 3.058452][ T1] el0t_64_sync+0x1b0/0x1b4
[ 3.058620][ T1] Code: f800865e a9bf7bfd 910003fd 941f48aa (d4210000)
[ 3.058897][ T1] ---[ end trace 0000000000000000 ]---
[ 3.059083][ T1] Kernel panic - not syncing: Oops - BUG: Fatal exception
Fix it by copying the size of src, and not the size of dst, as it was.
Fixes: 5a2a6c428190 ("dm: always update the array size in realloc_argv on success")
Cc: stable@vger.kernel.org
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ulrich Hecht <uli@kernel.org>
2025-07-17 10:07:54 +02:00
..
2025-02-07 03:34:22 +01:00
2025-03-11 08:34:57 +01:00
2020-03-25 08:06:07 +01:00
2021-03-11 14:04:59 +01:00
2023-01-18 11:30:42 +01:00
2023-08-11 11:45:35 +02:00
2024-11-17 14:58:06 +01:00
2024-05-25 16:16:18 +02:00
2024-03-26 18:22:33 -04:00
2023-12-08 08:43:24 +01:00
2022-07-02 16:27:31 +02:00
2023-05-17 11:13:21 +02:00
2024-01-08 11:27:37 +01:00
2023-08-11 11:45:01 +02:00
2024-09-04 13:12:59 +02:00
2019-08-29 08:28:55 +02:00
2020-06-25 15:32:49 +02:00
2024-04-13 12:50:06 +02:00
2021-05-22 10:59:23 +02:00
2023-08-11 11:45:01 +02:00
2021-06-03 08:38:04 +02:00
2023-04-05 11:15:38 +02:00
2023-04-05 11:15:38 +02:00
2025-07-17 10:07:54 +02:00
2019-09-16 08:22:12 +02:00
2023-01-18 11:30:42 +01:00
2025-03-11 08:34:58 +01:00
2024-11-17 14:58:06 +01:00
2023-12-08 08:43:25 +01:00
2021-04-28 13:16:50 +02:00
2023-12-08 08:43:25 +01:00
2024-03-26 18:22:33 -04:00
2022-08-25 11:15:30 +02:00
2020-06-25 15:32:58 +02:00
2020-06-25 15:32:58 +02:00
2020-07-09 09:37:12 +02:00
2019-12-17 20:34:53 +01:00
2024-09-04 13:13:07 +02:00
2024-06-16 13:23:25 +02:00
2020-12-30 11:26:16 +01:00
2019-12-17 20:34:55 +01:00
2019-12-17 20:34:55 +01:00
2024-09-04 13:13:02 +02:00
2019-12-17 20:34:55 +01:00
2023-08-11 11:45:22 +02:00
2023-08-11 11:45:22 +02:00
2023-09-23 10:48:17 +02:00
2024-08-19 05:32:10 +02:00
2023-08-11 11:45:25 +02:00