From: Simon Horman <horms@kernel.org>
To: Nick Child <nnac123@linux.ibm.com>
Cc: netdev@vger.kernel.org, davemarq@linux.ibm.com,
haren@linux.ibm.com, ricklind@us.ibm.com
Subject: Re: [PATCH net] ibmvnic: Use kernel helpers for hex dumps
Date: Sun, 23 Mar 2025 17:45:37 +0000 [thread overview]
Message-ID: <20250323174537.GY892515@horms.kernel.org> (raw)
In-Reply-To: <20250320212951.11142-1-nnac123@linux.ibm.com>
On Thu, Mar 20, 2025 at 04:29:51PM -0500, Nick Child wrote:
> 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: 032c5e82847a ("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>
> ---
> This patch obsoletes my work to define a for_each macro in printk.h [1].
> It was determined the pitfalls outweighed the benefits of the code
> cleanup.
>
> Side question, is net the correct mailing list even if the bug being
> addressed was introduced long before the current release? Or is net-next
> more appropriate? Does bug severity play any part in this or does
> anything with a Fixes tag go to net? netdev-FAQ implies all fixes go into
> net but previous mailing list entries seem to vary. Thanks
My view is that net is the correct target for bug fixes
for Networking code provided the bug is present in net
(which would be the case here).
next prev parent reply other threads:[~2025-03-23 17:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-20 21:29 [PATCH net] ibmvnic: Use kernel helpers for hex dumps Nick Child
2025-03-23 17:45 ` Simon Horman [this message]
2025-03-25 15:30 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250323174537.GY892515@horms.kernel.org \
--to=horms@kernel.org \
--cc=davemarq@linux.ibm.com \
--cc=haren@linux.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=nnac123@linux.ibm.com \
--cc=ricklind@us.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).