From: Bhanu Seshu Kumar Valluri <bhanuseshukumar@gmail.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>,
Don Brace <don.brace@microchip.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
storagedev@microchip.com
Cc: linux-scsi@vger.kernel.org,
linux-kernel-mentees@lists.linuxfoundation.org,
skhan@linuxfoundation.org, david.hunter.linux@gmail.com
Subject: Re: [PATCH] scsi: Use kmalloc_array to prevent overflow of dynamic size calculation
Date: Sat, 4 Oct 2025 09:55:22 +0530 [thread overview]
Message-ID: <1c6cceec-da16-4867-88e0-c629accbb35c@gmail.com> (raw)
In-Reply-To: <7761904f64c554821e71e30b205e092fc2f8478e.camel@HansenPartnership.com>
On 03/10/25 20:23, James Bottomley wrote:
> On Wed, 2025-10-01 at 17:09 +0530, Bhanu Seshu Kumar Valluri wrote:
>> Use kmalloc_array to avoid potential overflow during dynamic size
>> calculation inside kmalloc.
>
> This description isn't correct.
>
> Given this check
>
>>
>> - host_memory_descriptor->host_chunk_virt_address =
>> kmalloc(sg_count * sizeof(void *), GFP_KERNEL);
>
> How is it possible that this allocation could ever overflow?
>
> If you want to change the description to say using kmalloc_array is
> better practice or something (and the maintainer concurs) that's fine,
> but we can't have a false justification in the kernel git log.
>
> Regards,
>
> James
>
Hi,
Thank you for your helpful comment.
I will await till maintainer confirms if it is ok to push this change as v2 with
subject line similar what you have suggested.
Regards,
Bhanu Seshu Kumar Valluri
next prev parent reply other threads:[~2025-10-04 4:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-01 11:39 [PATCH] scsi: Use kmalloc_array to prevent overflow of dynamic size calculation Bhanu Seshu Kumar Valluri
2025-10-03 14:12 ` Don.Brace
2025-10-03 14:53 ` James Bottomley
2025-10-04 4:25 ` Bhanu Seshu Kumar Valluri [this message]
2025-10-06 11:28 ` Niklas Cassel
2025-10-07 6:18 ` Bhanu Seshu Kumar Valluri
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=1c6cceec-da16-4867-88e0-c629accbb35c@gmail.com \
--to=bhanuseshukumar@gmail.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=david.hunter.linux@gmail.com \
--cc=don.brace@microchip.com \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=skhan@linuxfoundation.org \
--cc=storagedev@microchip.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