lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a7453bdc-16f3-43e6-a06d-bd6144eeae72@wanadoo.fr>
Date: Mon, 22 Sep 2025 17:38:51 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Guangshuo Li <lgs201920130244@...il.com>,
 Madhavan Srinivasan <maddy@...ux.ibm.com>,
 Michael Ellerman <mpe@...erman.id.au>, Nicholas Piggin <npiggin@...il.com>,
 Christophe Leroy <christophe.leroy@...roup.eu>,
 Naveen N Rao <naveen@...nel.org>, Thomas Gleixner <tglx@...utronix.de>,
 Thomas Weißschuh <thomas.weissschuh@...utronix.de>,
 "Gautham R. Shenoy" <ego@...ux.vnet.ibm.com>, linuxppc-dev@...ts.ozlabs.org,
 linux-kernel@...r.kernel.org
Cc: stable@...r.kernel.org
Subject: Re: [PATCH v2] powerpc/smp: Add check for kcalloc() failure in
 parse_thread_groups()

Le 22/09/2025 à 17:10, Guangshuo Li a écrit :
> As kcalloc() may fail, check its return value to avoid a NULL pointer
> dereference when passing it to of_property_read_u32_array().
> 
> Fixes: 790a1662d3a26 ("powerpc/smp: Parse ibm,thread-groups with multiple properties")
> Cc: stable@...r.kernel.org

Signed-off-by that was part of v1, is missing in v2.

> ---
> changelog:
> v2:
> - Return -ENOMEM directly on allocation failure.

Except for a newline that is removed, v2 is the same as v1, or I miss 
something?

CJ

> 
> Signed-off-by: Guangshuo Li <lgs201920130244@...il.com>
> ---
>   arch/powerpc/kernel/smp.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
> index 5ac7084eebc0..cfccb9389760 100644
> --- a/arch/powerpc/kernel/smp.c
> +++ b/arch/powerpc/kernel/smp.c
> @@ -822,6 +822,8 @@ static int parse_thread_groups(struct device_node *dn,
>   
>   	count = of_property_count_u32_elems(dn, "ibm,thread-groups");
>   	thread_group_array = kcalloc(count, sizeof(u32), GFP_KERNEL);
> +	if (!thread_group_array)
> +		return -ENOMEM;
>   	ret = of_property_read_u32_array(dn, "ibm,thread-groups",
>   					 thread_group_array, count);
>   	if (ret)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ