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: <70e7df49-ebba-4121-ae8d-83e04fbe25ba@I-love.SAKURA.ne.jp>
Date: Tue, 8 Jul 2025 18:48:59 +0900
From: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
To: Vlastimil Babka <vbabka@...e.cz>, Dave Chinner <david@...morbit.com>
Cc: Zi Yan <ziy@...dia.com>, Barry Song <baohua@...nel.org>,
        Carlos Maiolino <cem@...nel.org>, linux-xfs@...r.kernel.org,
        syzbot <syzbot+359a67b608de1ef72f65@...kaller.appspotmail.com>,
        akpm@...ux-foundation.org, apopple@...dia.com, byungchul@...com,
        david@...hat.com, gourry@...rry.net, joshua.hahnjy@...il.com,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        matthew.brost@...el.com, rakie.kim@...com,
        syzkaller-bugs@...glegroups.com, ying.huang@...ux.alibaba.com,
        Harry Yoo <harry.yoo@...cle.com>, Michal Hocko <mhocko@...e.com>,
        Matthew Wilcox <willy@...radead.org>
Subject: Re: [syzbot] [mm?] WARNING in xfs_init_fs_context

On 2025/07/08 17:50, Vlastimil Babka wrote:
> On 7/8/25 00:10, Dave Chinner wrote:
>> On Wed, Jul 02, 2025 at 09:30:30AM +0200, Vlastimil Babka wrote:
>>> On 7/2/25 3:41 AM, Tetsuo Handa wrote:
>>>> By the way, why is xfs_init_fs_context() using __GFP_NOFAIL ?
>>>>
>>>> 	mp = kzalloc(sizeof(struct xfs_mount), GFP_KERNEL | __GFP_NOFAIL);
>>>> 	if (!mp)
>>>> 		return -ENOMEM;
>>>>
>>>> This looks an allocation attempt which can fail safely.
>>
>> It's irrelevant - it shouldn't fail regardless of __GFP_NOFAIL being
>> specified.
> 
> If you mean the "too small to fail" behavior then it's generally true,
> except in some corner cases like being an oom victim, in which case the
> allocation can fail - the userspace process is doomed anyway. But a (small)
> kernel allocation not handling NULL would still need __GFP_NOFAIL to prevent
> that corner case.

init_fs_context() is allowed to fail.

https://elixir.bootlin.com/linux/v6.16-rc4/source/fs/fs_context.c#L318
https://elixir.bootlin.com/linux/v6.16-rc4/source/fs/ext4/super.c#L1990

Therefore, I wonder why xfs does not want xfs_init_fs_context() to fail
with -ENOMEM.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ