Tudor Ambarus
ed3248a403
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>
2025-05-09 09:44:08 +02:00
..
2024-12-14 19:59:55 +01:00
2025-01-17 13:36:10 +01:00
2023-02-14 14:23:06 -05:00
2021-10-27 16:53:47 -04:00
2023-03-30 15:57:51 -04:00
2023-03-30 15:57:51 -04:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:06 -05:00
2025-05-09 09:43:52 +02:00
2023-02-14 14:23:07 -05:00
2024-12-09 10:32:40 +01:00
2024-12-09 10:32:40 +01:00
2023-02-14 14:23:06 -05:00
2023-06-19 13:19:33 -07:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:06 -05:00
2023-07-25 11:55:50 -04:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:06 -05:00
2024-12-09 10:32:40 +01:00
2024-08-29 17:33:14 +02:00
2020-03-27 14:42:51 -04:00
2023-06-12 08:04:05 -06:00
2024-02-23 09:25:27 +01:00
2025-02-17 09:40:25 +01:00
2023-12-03 07:33:09 +01:00
2023-04-11 12:09:08 -04:00
2025-04-25 10:45:33 +02:00
2023-06-12 08:04:05 -06:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:06 -05:00
2025-03-22 12:50:47 -07:00
2023-02-14 14:23:07 -05:00
2023-02-14 14:23:07 -05:00
2024-09-12 11:11:35 +02:00
2025-05-09 09:43:52 +02:00
2023-02-14 14:23:07 -05:00
2023-02-14 14:23:06 -05:00
2024-03-26 18:20:13 -04:00
2024-08-29 17:33:13 +02:00
2024-03-26 18:20:13 -04:00
2023-04-11 12:01:01 -04:00
2023-02-14 14:23:07 -05:00
2023-02-14 14:23:07 -05:00
2023-02-14 14:23:06 -05:00
2023-04-11 12:09:08 -04:00
2024-03-26 18:20:13 -04:00
2023-04-11 12:01:01 -04:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:07 -05:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:06 -05:00
2024-03-26 18:20:13 -04:00
2024-04-03 15:28:26 +02:00
2023-02-14 14:23:06 -05:00
2024-10-04 16:29:40 +02:00
2023-02-14 14:23:06 -05:00
2024-03-26 18:20:13 -04:00
2023-02-14 14:23:07 -05:00
2024-04-03 15:28:37 +02:00
2023-03-16 13:37:06 -04:00
2023-03-16 13:37:06 -04:00
2023-04-11 12:01:01 -04:00
2023-04-11 12:09:08 -04:00
2023-02-14 14:23:08 -05:00
2025-05-09 09:44:08 +02:00
2023-04-11 12:01:01 -04:00
2023-06-30 12:16:00 -07:00
2023-02-14 14:23:06 -05:00
2025-01-17 13:36:17 +01:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:06 -05:00
2024-11-14 13:19:37 +01:00
2025-01-17 13:36:19 +01:00
2023-02-14 14:23:06 -05:00
2023-06-28 10:43:04 -07:00
2025-04-25 10:45:34 +02:00
2023-02-14 14:23:06 -05:00
2023-02-14 14:23:06 -05:00
2024-03-26 18:19:12 -04:00
2024-03-26 18:20:13 -04:00
2023-04-11 12:09:08 -04:00
2023-06-16 18:24:13 -04:00
2023-05-31 09:50:02 -06:00
2021-06-04 12:07:24 -04:00
2023-09-20 13:48:06 -04:00
2022-07-14 12:14:31 -06:00
2024-10-04 16:29:40 +02:00
2023-06-16 18:24:14 -04:00
2024-01-20 11:51:45 +01:00
2022-08-02 14:38:59 -07:00
2023-06-05 10:56:46 -06:00
2025-04-25 10:45:39 +02:00
2025-02-27 04:10:44 -08:00
2025-02-27 04:10:44 -08:00
2018-10-18 09:36:35 -07:00
2023-07-27 00:13:30 -07:00
2023-07-27 00:13:30 -07:00
2020-05-13 12:02:23 -07:00
2023-07-27 00:13:29 -07:00
2018-05-30 15:33:32 -06:00
2025-04-25 10:45:54 +02:00
2025-02-27 04:10:44 -08:00
2023-08-17 21:11:31 -07:00
2023-06-30 15:43:50 -07:00
2023-06-23 09:33:16 -07:00
2025-05-02 07:51:02 +02:00
2025-02-21 13:57:26 +01:00
2025-02-21 13:57:26 +01:00
2022-08-02 17:14:31 -06:00
2023-05-31 09:50:02 -06:00
2025-02-21 13:57:26 +01:00
2025-02-21 13:57:26 +01:00
2025-04-25 10:45:39 +02:00
2025-02-21 13:57:26 +01:00