public inbox for linux-kernel-mentees@lists.linux-foundation.org
 help / color / mirror / Atom feed
From: Bhanu Seshu Kumar Valluri <bhanuseshukumar@gmail.com>
To: Niklas Cassel <cassel@kernel.org>
Cc: James Bottomley <James.Bottomley@hansenpartnership.com>,
	Don Brace <don.brace@microchip.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	storagedev@microchip.com, linux-scsi@vger.kernel.org,
	linux-kernel-mentees@lists.linuxfoundation.org,
	skhan@linuxfoundation.org, david.hunter.linux@gmail.com,
	bhanuseshukumar@gmail.com
Subject: Re: [PATCH] scsi: Use kmalloc_array to prevent overflow of dynamic size calculation
Date: Tue, 7 Oct 2025 11:48:29 +0530	[thread overview]
Message-ID: <3ab53f69-4e1f-4f76-8605-e95d7516a97d@gmail.com> (raw)
In-Reply-To: <aOOn8TFTseukaZlS@ryzen>

On 06/10/25 16:58, Niklas Cassel wrote:
> On Sat, Oct 04, 2025 at 09:55:22AM +0530, Bhanu Seshu Kumar Valluri wrote:
>> 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.
> 
> You misinterpreted James' reply ("and the maintainer concurs").
> 
> James is one of the two SCSI maintainers, so there is no need to
> delay sending a V2.

Hi Niklas,

Thanks for clarifying  that. I will send v2 patch.

Regards,
Bhanu Seshu Kumar Valluri


      reply	other threads:[~2025-10-07  6:18 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
2025-10-06 11:28     ` Niklas Cassel
2025-10-07  6:18       ` Bhanu Seshu Kumar Valluri [this message]

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=3ab53f69-4e1f-4f76-8605-e95d7516a97d@gmail.com \
    --to=bhanuseshukumar@gmail.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=cassel@kernel.org \
    --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