linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Zizhi Wo <wozizhi@huaweicloud.com>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	Zizhi Wo <wozizhi@huaweicloud.com>
Cc: "Russell King (Oracle)" <linux@armlinux.org.uk>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	jack@suse.com, brauner@kernel.org, hch@lst.de,
	akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	linux-arm-kernel@lists.infradead.org, yangerkun@huawei.com,
	wangkefeng.wang@huawei.com, pangliyuan1@huawei.com,
	xieyuanbin1@huawei.com, Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [Bug report] hash_name() may cross page boundary and trigger sleep in RCU context
Date: Mon, 1 Dec 2025 10:08:00 +0800	[thread overview]
Message-ID: <32d0a330-5f14-4c1f-8706-1301a1b66864@huaweicloud.com> (raw)
In-Reply-To: <CAHk-=wjA20ear0hDOvUS7g5-A=YAUifphcf-iFJ1pach0=3ubw@mail.gmail.com>



在 2025/11/29 9:35, Linus Torvalds 写道:
> On Fri, 28 Nov 2025 at 17:01, Zizhi Wo <wozizhi@huaweicloud.com> wrote:
>>
>> Thank you for your answer. In fact, this solution is similar to the one
>> provided by Al.
> 
> Hmm. I'm not seeing the replies from Al for some reason. Maybe he didn't cc me.
> 
>> It has an additional check to determine reg:
>>
>> if (unlikely(addr > TASK_SIZE) && !user_mode(regs))
>>          goto no_context;
>>
>> I'd like to ask if this "regs" examination also needs to be brought
>> along?
> 
> That seems unnecessary.
> 
> Yes, in this case the original problem you reported with sleeping in
> an RCU region was triggered by a kernel access, and a user-space
> access would never have caused any such issues.
> 
> So checking for !user_mode(regs) isn't exactly *wrong*.
> 
> But while it isn't wrong, I think it's also kind of pointless.
> 
> Because regardless of whether it's a kernel or user space access, an
> access outside TASK_SIZE shouldn't be associated with a valid user
> space context, so the code might as well just go to the "no_context"
> label directly.
> 
> That said, somebody should  definitely double-check me - because I
> think arm also did the vdso trick at high addresses that i386 used to
> do, so there is the fake VDSO thing up there.
> 
> But if you get a page fault on that, it's not going to be fixed up, so
> even if user space can access it, there's no point in looking that
> fake vm area up for page faults.
> 
> I think.
> 
>> I'm even thinking if we directly have the corresponding processing
>> replaced by do_translation_fault(), is that also correct?
>>
>> ```
>> -       { do_page_fault,        SIGSEGV, SEGV_MAPERR,   "page
>> translation fault"           },
>> +       { do_translation_fault, SIGSEGV, SEGV_MAPERR,   "page
>> translation fault"           },
> 
> I think that might break kprobes.
> 
> Looking around, I think my patch might also be a bit broken: I think
> it might be better to move it further down to below the check for
> FSR_LNX_PF.
> 
> But somebody who knows the exact arm page fault handling better than
> me should verify both that and my VDSO gate page thinking.
> 
>             Linus
> 

Thank you for your reply! Regarding the existing discussions in the
community, I will re-examine the logic in this regard and digest it.

Thanks,
Zizhi Wo



  parent reply	other threads:[~2025-12-01  2:08 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-26  9:05 Zizhi Wo
2025-11-26 10:19 ` [RFC PATCH] vfs: Fix might sleep in load_unaligned_zeropad() with rcu read lock held Xie Yuanbin
2025-11-26 18:10   ` Al Viro
2025-11-26 18:48     ` Al Viro
2025-11-26 19:05       ` Russell King (Oracle)
2025-11-26 19:26         ` Al Viro
2025-11-26 19:51           ` Russell King (Oracle)
2025-11-26 20:02             ` Al Viro
2025-11-26 22:25               ` david laight
2025-11-26 23:51                 ` Al Viro
2025-11-26 23:31               ` Russell King (Oracle)
2025-11-27  3:03                 ` Xie Yuanbin
2025-11-27  7:20                   ` Sebastian Andrzej Siewior
2025-11-27 11:20                     ` Xie Yuanbin
2025-11-28  1:39           ` Xie Yuanbin
2025-11-26 20:42   ` Al Viro
2025-11-26 10:27 ` [Bug report] hash_name() may cross page boundary and trigger sleep in RCU context Zizhi Wo
2025-11-26 21:12   ` Linus Torvalds
2025-11-27 10:27     ` Will Deacon
2025-11-27 10:57     ` Russell King (Oracle)
2025-11-28 17:06       ` Linus Torvalds
2025-11-29  1:01         ` Zizhi Wo
2025-11-29  1:35           ` Linus Torvalds
2025-11-29  4:08             ` [Bug report] hash_name() may cross page boundary and trigger Xie Yuanbin
2025-11-29  9:08               ` Al Viro
2025-11-29  9:25                 ` Xie Yuanbin
2025-11-29  9:44                   ` Al Viro
2025-11-29 10:05                     ` Xie Yuanbin
2025-11-29 10:45                 ` david laight
2025-11-29  8:54             ` [Bug report] hash_name() may cross page boundary and trigger sleep in RCU context Al Viro
2025-12-01  2:08             ` Zizhi Wo [this message]
2025-11-29  2:18         ` [Bug report] hash_name() may cross page boundary and trigger Xie Yuanbin
2025-12-01 13:28         ` [Bug report] hash_name() may cross page boundary and trigger sleep in RCU context Will Deacon
2025-12-02 12:43         ` Russell King (Oracle)
2025-12-02 13:02           ` Xie Yuanbin
2025-12-02 22:07           ` Linus Torvalds
2025-12-03  1:48             ` Xie Yuanbin
2025-12-05 12:08               ` Russell King (Oracle)
2025-11-26 18:55 ` Al Viro
2025-11-27  2:24   ` Zizhi Wo
2025-11-29  3:37     ` Al Viro
2025-11-30  3:01       ` [RFC][alpha] saner vmalloc handling (was Re: [Bug report] hash_name() may cross page boundary and trigger sleep in RCU context) Al Viro
2025-11-30 11:32         ` david laight
2025-11-30 16:43           ` Al Viro
2025-11-30 18:14             ` Magnus Lindholm
2025-11-30 19:03             ` david laight
2025-11-30 20:31               ` Al Viro
2025-11-30 20:32                 ` Al Viro
2025-11-30 22:16         ` Linus Torvalds
2025-11-30 23:37           ` Al Viro
2025-12-01  2:03       ` [Bug report] hash_name() may cross page boundary and trigger sleep in RCU context Zizhi Wo
2025-11-27 12:59 ` Will Deacon
2025-11-28  1:17   ` Zizhi Wo
2025-11-28  1:18     ` Zizhi Wo
2025-11-28  1:39       ` Zizhi Wo
2025-11-28 12:25         ` Will Deacon
2025-11-29  1:02           ` Zizhi Wo
2025-11-29  3:55             ` Al Viro
2025-12-01  2:38               ` Zizhi Wo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=32d0a330-5f14-4c1f-8706-1301a1b66864@huaweicloud.com \
    --to=wozizhi@huaweicloud.com \
    --cc=akpm@linux-foundation.org \
    --cc=brauner@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=hch@lst.de \
    --cc=jack@suse.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@armlinux.org.uk \
    --cc=pangliyuan1@huawei.com \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=wangkefeng.wang@huawei.com \
    --cc=will@kernel.org \
    --cc=xieyuanbin1@huawei.com \
    --cc=yangerkun@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox