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: <20241102131318.GMZyYlbjX0c4q1YEx4@fat_crate.local>
Date: Sat, 2 Nov 2024 14:13:18 +0100
From: Borislav Petkov <bp@...en8.de>
To: Qiuxu Zhuo <qiuxu.zhuo@...el.com>
Cc: tony.luck@...el.com, tglx@...utronix.de, dave.hansen@...ux.intel.com,
	mingo@...hat.com, hpa@...or.com, x86@...nel.org,
	linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 05/10] x86/mce/genpool: Make mce_gen_pool_create()
 return explicit error codes

On Fri, Oct 25, 2024 at 10:45:57AM +0800, Qiuxu Zhuo wrote:
>  	mce_numrecords = max(MCE_MIN_ENTRIES, num_possible_cpus() * MCE_PER_CPU);
>  	mce_poolsz = mce_numrecords * (1 << order);
>  	mce_pool = kmalloc(mce_poolsz, GFP_KERNEL);
>  	if (!mce_pool) {
>  		gen_pool_destroy(gpool);
> -		return ret;
> +		return -ENOMEM;

This patch is just silly: the function is not that huge not to be able to see
at a quick glance that it is -ENOMEM that is being returned in all error cases
...

>  	}
>  	ret = gen_pool_add(gpool, (unsigned long)mce_pool, mce_poolsz, -1);
>  	if (ret) {

... except in this case where, oh well, actually, it is -ENOMEM again but you
have to go down the bowells of genalloc to see it.

All in all, this is causing more churn than actually improving something...

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ