Commit 9f2ab81
committed
ibmvnic: Use kernel helpers for hex dumps
jira VULN-65342
cve CVE-2025-22104
commit-author Nick Child <[email protected]>
commit d93a6ca
Previously, when the driver was printing hex dumps, the buffer was cast
to an 8 byte long and printed using string formatters. If the buffer
size was not a multiple of 8 then a read buffer overflow was possible.
Therefore, create a new ibmvnic function that loops over a buffer and
calls hex_dump_to_buffer instead.
This patch address KASAN reports like the one below:
ibmvnic 30000003 env3: Login Buffer:
ibmvnic 30000003 env3: 01000000af000000
<...>
ibmvnic 30000003 env3: 2e6d62692e736261
ibmvnic 30000003 env3: 65050003006d6f63
==================================================================
BUG: KASAN: slab-out-of-bounds in ibmvnic_login+0xacc/0xffc [ibmvnic]
Read of size 8 at addr c0000001331a9aa8 by task ip/17681
<...>
Allocated by task 17681:
<...>
ibmvnic_login+0x2f0/0xffc [ibmvnic]
ibmvnic_open+0x148/0x308 [ibmvnic]
__dev_open+0x1ac/0x304
<...>
The buggy address is located 168 bytes inside of
allocated 175-byte region [c0000001331a9a00, c0000001331a9aaf)
<...>
=================================================================
ibmvnic 30000003 env3: 000000000033766e
Fixes: 032c5e8 ("Driver for IBM System i/p VNIC protocol")
Signed-off-by: Nick Child <[email protected]>
Reviewed-by: Dave Marquardt <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
(cherry picked from commit d93a6ca)
Signed-off-by: Shreeya Patel <[email protected]>1 parent df46bfb commit 9f2ab81
1 file changed
+18
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4345 | 4345 | | |
4346 | 4346 | | |
4347 | 4347 | | |
| 4348 | + | |
| 4349 | + | |
| 4350 | + | |
| 4351 | + | |
| 4352 | + | |
| 4353 | + | |
| 4354 | + | |
| 4355 | + | |
| 4356 | + | |
| 4357 | + | |
| 4358 | + | |
| 4359 | + | |
4348 | 4360 | | |
4349 | 4361 | | |
4350 | 4362 | | |
| |||
4455 | 4467 | | |
4456 | 4468 | | |
4457 | 4469 | | |
4458 | | - | |
4459 | | - | |
4460 | | - | |
4461 | | - | |
| 4470 | + | |
| 4471 | + | |
4462 | 4472 | | |
4463 | 4473 | | |
4464 | 4474 | | |
| |||
4831 | 4841 | | |
4832 | 4842 | | |
4833 | 4843 | | |
4834 | | - | |
4835 | 4844 | | |
4836 | 4845 | | |
4837 | 4846 | | |
4838 | 4847 | | |
4839 | 4848 | | |
4840 | | - | |
4841 | | - | |
4842 | | - | |
| 4849 | + | |
| 4850 | + | |
4843 | 4851 | | |
4844 | 4852 | | |
4845 | 4853 | | |
| |||
5074 | 5082 | | |
5075 | 5083 | | |
5076 | 5084 | | |
5077 | | - | |
5078 | | - | |
5079 | | - | |
5080 | | - | |
| 5085 | + | |
| 5086 | + | |
5081 | 5087 | | |
5082 | 5088 | | |
5083 | 5089 | | |
| |||
0 commit comments