Commit 1a0b34d
CKI Backport Bot
ibmvnic: Use kernel helpers for hex dumps
JIRA: https://issues.redhat.com/browse/RHEL-89020
CVE: CVE-2025-22104
commit d93a6ca
Author: Nick Child <nnac123@linux.ibm.com>
Date: Thu Mar 20 16:29:51 2025 -0500
ibmvnic: Use kernel helpers for hex dumps
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 <nnac123@linux.ibm.com>
Reviewed-by: Dave Marquardt <davemarq@linux.ibm.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250320212951.11142-1-nnac123@linux.ibm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com>1 parent 153ef7c commit 1a0b34d
1 file changed
+18
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4682 | 4682 | | |
4683 | 4683 | | |
4684 | 4684 | | |
| 4685 | + | |
| 4686 | + | |
| 4687 | + | |
| 4688 | + | |
| 4689 | + | |
| 4690 | + | |
| 4691 | + | |
| 4692 | + | |
| 4693 | + | |
| 4694 | + | |
| 4695 | + | |
| 4696 | + | |
4685 | 4697 | | |
4686 | 4698 | | |
4687 | 4699 | | |
| |||
4792 | 4804 | | |
4793 | 4805 | | |
4794 | 4806 | | |
4795 | | - | |
4796 | | - | |
4797 | | - | |
4798 | | - | |
| 4807 | + | |
| 4808 | + | |
4799 | 4809 | | |
4800 | 4810 | | |
4801 | 4811 | | |
| |||
5171 | 5181 | | |
5172 | 5182 | | |
5173 | 5183 | | |
5174 | | - | |
5175 | 5184 | | |
5176 | 5185 | | |
5177 | 5186 | | |
5178 | 5187 | | |
5179 | 5188 | | |
5180 | | - | |
5181 | | - | |
5182 | | - | |
| 5189 | + | |
| 5190 | + | |
5183 | 5191 | | |
5184 | 5192 | | |
5185 | 5193 | | |
| |||
5410 | 5418 | | |
5411 | 5419 | | |
5412 | 5420 | | |
5413 | | - | |
5414 | | - | |
5415 | | - | |
5416 | | - | |
| 5421 | + | |
| 5422 | + | |
5417 | 5423 | | |
5418 | 5424 | | |
5419 | 5425 | | |
| |||
0 commit comments