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]
Message-ID: <2C5E9AD1-A548-4B29-98C2-DB4A78D51B4D@nvidia.com>
Date: Wed, 18 Jun 2025 13:53:23 -0400
From: Zi Yan <ziy@...dia.com>
To: Matthew Wilcox <willy@...radead.org>,
 Dan Carpenter <dan.carpenter@...aro.org>
Cc: oe-kbuild@...ts.linux.dev, lkp@...el.com, oe-kbuild-all@...ts.linux.dev,
 linux-kernel@...r.kernel.org, Andrew Morton <akpm@...ux-foundation.org>,
 Linux Memory Management List <linux-mm@...ck.org>,
 Baolin Wang <baolin.wang@...ux.alibaba.com>
Subject: Re: mm/shmem.c:2223 shmem_split_large_entry() error: uninitialized
 symbol 'entry_order'.

On 18 Jun 2025, at 13:47, Matthew Wilcox wrote:

> On Wed, Jun 18, 2025 at 08:42:17PM +0300, Dan Carpenter wrote:
>> smatch warnings:
>> mm/shmem.c:2223 shmem_split_large_entry() error: uninitialized symbol 'entry_order'.
>
> ...
>
>> 12885cbe88ddf6 Baolin Wang 2024-08-12  2169  		if (!xa_is_value(old) || swp_to_radix_entry(swap) != old) {
>> 12885cbe88ddf6 Baolin Wang 2024-08-12  2170  			xas_set_err(&xas, -EEXIST);
>> 12885cbe88ddf6 Baolin Wang 2024-08-12  2171  			goto unlock;
>>
>> Imagine we hit this goto on the first iteration
>
> That can happen (but if it does, we set -EEXIST in the xa_state).
>
>> 12885cbe88ddf6 Baolin Wang 2024-08-12  2213  unlock:
>> 12885cbe88ddf6 Baolin Wang 2024-08-12  2214  		xas_unlock_irq(&xas);
>> 12885cbe88ddf6 Baolin Wang 2024-08-12  2215
>> 12885cbe88ddf6 Baolin Wang 2024-08-12  2216  		if (!xas_nomem(&xas, gfp))
>> 12885cbe88ddf6 Baolin Wang 2024-08-12  2217  			break;
>>
>> And we hit this break.
>
> That's guaranteed.  If there's an errno in the xa_state that isn't
> -ENOMEM, xas_nomem() will fail.
>
>> 12885cbe88ddf6 Baolin Wang 2024-08-12  2218  	}
>> 12885cbe88ddf6 Baolin Wang 2024-08-12  2219
>> 12885cbe88ddf6 Baolin Wang 2024-08-12  2220  	if (xas_error(&xas))
>> 12885cbe88ddf6 Baolin Wang 2024-08-12  2221  		return xas_error(&xas);
>> 12885cbe88ddf6 Baolin Wang 2024-08-12  2222
>> d53c78fffe7ad3 Zi Yan      2025-03-14 @2223  	return entry_order;
>
> but if this does happen, then xas_error() will be true and we'll return
> -EEXIST here instead of returning entry_order.
Hi Matthew,

Thank you for the explanation.

Hi Dan,

I got a similar report 3 months ago and explained it already.
See https://lore.kernel.org/linux-mm/B024C29C-96D4-4F92-B2EF-F01CB06B27DF@nvidia.com/

Best Regards,
Yan, Zi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ