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] [day] [month] [year] [list]
Date: Thu, 18 Jan 2024 09:38:49 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: Dan Carpenter <dan.carpenter@...aro.org>,
 linux-hardening@...r.kernel.org, kernel-janitors@...r.kernel.org,
 "Guilherme G. Piccoli" <gpiccoli@...lia.com>,
 Joel Fernandes <joel@...lfernandes.org>, Kees Cook <keescook@...omium.org>,
 Tony Luck <tony.luck@...el.com>
Cc: LKML <linux-kernel@...r.kernel.org>, Günter Röck
 <groeck@...omium.org>, Sai Prakash Ranjan
 <saiprakash.ranjan@...eaurora.org>, Kunwu Chan <chentao@...inos.cn>
Subject: Re: [PATCH] pstore/ram: Return directly after a failed kasprintf()
 call in ramoops_init_prz()

>> The result from a call of the function “kasprintf” was passed to
>> a subsequent function call without checking for a null pointer before
>> (according to a memory allocation failure).
>> This issue was detected by using the Coccinelle software.
…
>> +++ b/fs/pstore/ram.c
>> @@ -595,6 +595,9 @@ static int ramoops_init_prz(const char *name,
>>  	}
>>
>>  	label = kasprintf(GFP_KERNEL, "ramoops:%s", name);
>> +	if (!label)
>> +		return -ENOMEM;
>> +
>>  	*prz = persistent_ram_new(*paddr, sz, sig, &cxt->ecc_info,
>>  				  cxt->memtype, PRZ_FLAG_ZAP_OLD, label);
>>  	kfree(label);
>
> This patch is fine as a clean up, but I think it's useful to say that
> if you pass a NULL label to persistent_ram_new() then it will return
> an error.
…

Will it become helpful to annotate the corresponding function input parameter
for null pointer tolerance anyhow?

Regards,
Markus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ