All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: yahia <yahia.a.abdrabou@gmail.com>
Cc: platform-driver-x86@vger.kernel.org, sashiko-bot@kernel.org
Subject: Re: [PATCH 3/3] hp-wmi: move from kmalloc to kzalloc
Date: Mon, 13 Jul 2026 14:30:26 +0300 (EEST)	[thread overview]
Message-ID: <a1313a0e-d9f4-9173-ae01-3488134156b0@linux.intel.com> (raw)
In-Reply-To: <20260712191130.41183-4-yahia.a.abdrabou@gmail.com>

On Sun, 12 Jul 2026, yahia wrote:

kzalloc()

> From: yahia ahmed <yahia.a.abdrabou@gmail.com>
> 
> hp_wmi_query_perform() currently uses kmalloc to allocate memory for the

kmalloc()

> bios's response, though this creates a security hole pointed out by

BIOS

When you (or you as an extension of sashiko) claim "security hole", you 
must explain that one out how it materializes. Otherwise, I'll reject the 
patch on the ground of unsubstanciated claim in the changelog.

That being said, it is generally useful to avoid kmalloc() but that's 
different reasoning.

> sashiko that when using kmalloc, it won't zero out the memory space, thus

kmalloc()

> leaving information like passwords and other important data.

I thought we had special functions for handling sensitive data such 
as passwords. Yeah, right, there's kfree_sensitive().

I think it would be better to drop the entire thus ... part.

-- 
 i.

> 
> Reported-by: sashiko-bot@kernel.org
> Link: https://sashiko.dev/#/message/20260706143855.35002-1-yahia.a.abdrabou%40gmail.com
> Fixes: 4b4967cbd268 ("platform/x86: hp-wmi: Changing bios_args.data to be dynamically allocated")
> Signed-off-by: yahia ahmed <yahia.a.abdrabou@gmail.com>
> ---
>  drivers/platform/x86/hp/hp-wmi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
> index 3235ade2fa98..f120900f536d 100644
> --- a/drivers/platform/x86/hp/hp-wmi.c
> +++ b/drivers/platform/x86/hp/hp-wmi.c
> @@ -593,7 +593,7 @@ static int hp_wmi_perform_query(int query, enum hp_wmi_command command,
>  
>  	actual_insize = max(insize, 128);
>  	bios_args_size = struct_size(args, data, actual_insize);
> -	args = kmalloc(bios_args_size, GFP_KERNEL);
> +	args = kzalloc(bios_args_size, GFP_KERNEL);
>  	if (!args)
>  		return -ENOMEM;
>  
> 

      reply	other threads:[~2026-07-13 11:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-12 19:11 [PATCH 0/3]: hp-wmi: fix various issues with yahia
2026-07-12 19:11 ` [PATCH 1/3] hp-wmi: refactor to use __free yahia
2026-07-13 11:21   ` Ilpo Järvinen
2026-07-12 19:11 ` [PATCH 2/3] hp-wmi: fix potential integer underflow yahia
2026-07-13 11:23   ` Ilpo Järvinen
2026-07-13 12:24     ` yahia
2026-07-12 19:11 ` [PATCH 3/3] hp-wmi: move from kmalloc to kzalloc yahia
2026-07-13 11:30   ` Ilpo Järvinen [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=a1313a0e-d9f4-9173-ae01-3488134156b0@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=sashiko-bot@kernel.org \
    --cc=yahia.a.abdrabou@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.