diff options
| author | shao.mingyin@zte.com.cn <shao.mingyin@zte.com.cn> | 2026-11-03 18:53:40 +0800 |
|---|---|---|
| committer | Mikulas Patocka <mpatocka@redhat.com> | 2026-11-04 19:27:46 +0100 |
| commit | 8f611fe94a781c6fb658488cc7eab4e4923e6df6 (patch) | |
| tree | a63b5f332d237d609ad3cb32d0ab10080b5f9da1 /rust/kernel/alloc | |
| parent | bcb78d49620f666b4a9d62997691e8d031fd4ebc (diff) | |
dm mpath: fix buffer overflow in parse_hw_handler()
parse_hw_handler() builds the hw_handler parameter string in a buffer
sized with
len = 4;
plus one byte per argument. Those four bytes were meant for the decimal
form of the parameter count, three digits plus the terminating NUL.
dm_read_arg_group() accepts up to 1024 arguments and the count written is
'hw_argc - 1', so a count of 1000 or more needs four digits plus the NUL
and sprintf() writes one byte past the allocation.
Size the buffer from the actual string length instead.
Fixes: 2bfd2e1337f0 ("[SCSI] scsi_dh: Use scsi_dh_set_params() in multipath.")
Cc: stable@vger.kernel.org
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Diffstat (limited to 'rust/kernel/alloc')
0 files changed, 0 insertions, 0 deletions
