From: Aili Yao <yaoaili@kingsoft.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: "Luck, Tony" <tony.luck@intel.com>,
Oleg Nesterov <oleg@redhat.com>,
Linux API <linux-api@vger.kernel.org>,
Andy Lutomirski <luto@kernel.org>,
HORIGUCHI NAOYA <naoya.horiguchi@nec.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
"H. Peter Anvin" <hpa@zytor.com>, X86 ML <x86@kernel.org>,
<yangfeng1@kingsoft.com>, Linux-MM <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>, <sunhao2@kingsoft.com>,
<yaoaili@kingsoft.com>, <suhua1@kingsoft.com>
Subject: Re: [PATCH v3] x86/fault: Send a SIGBUS to user process always for hwpoison page access.
Date: Thu, 11 Mar 2021 10:01:54 +0800 [thread overview]
Message-ID: <20210311100154.5a75c62e@alex-virtual-machine> (raw)
In-Reply-To: <CALCETrVqkK29n=6wtVhd7qgTWf83x3SUk6+bkD30asHyWSqppw@mail.gmail.com>
On Wed, 10 Mar 2021 17:28:12 -0800
Andy Lutomirski <luto@amacapital.net> wrote:
> On Wed, Mar 10, 2021 at 5:19 PM Aili Yao <yaoaili@kingsoft.com> wrote:
> >
> > On Mon, 8 Mar 2021 11:00:28 -0800
> > Andy Lutomirski <luto@amacapital.net> wrote:
> >
> > > > On Mar 8, 2021, at 10:31 AM, Luck, Tony <tony.luck@intel.com> wrote:
> > > >
> > > >
> > > >>
> > > >> Can you point me at that SIGBUS code in a current kernel?
> > > >
> > > > It is in kill_me_maybe(). mce_vaddr is setup when we disassemble whatever get_user()
> > > > or copy from user variant was in use in the kernel when the poison memory was consumed.
> > > >
> > > > if (p->mce_vaddr != (void __user *)-1l) {
> > > > force_sig_mceerr(BUS_MCEERR_AR, p->mce_vaddr, PAGE_SHIFT);
> > >
> > > Hmm. On the one hand, no one has complained yet. On the other hand, hardware that supports this isn’t exactly common.
> > >
> > > We may need some actual ABI design here. We also need to make sure that things like io_uring accesses or, more generally, anything using the use_mm / use_temporary_mm ends up either sending no signal or sending a signal to the right target.
> > >
> > > >
> > > > Would it be any better if we used the BUS_MCEERR_AO code that goes into siginfo?
> > >
> > > Dunno.
> >
> > I have one thought here but don't know if it's proper:
> >
> > Previous patch use force_sig_mceerr to the user process for such a scenario; with this method
> > The SIGBUS can't be ignored as force_sig_mceerr() was designed to.
> >
> > If the user process don't want this signal, will it set signal config to ignore?
> > Maybe we can use a send_sig_mceerr() instead of force_sig_mceerr(), if process want to
> > ignore the SIGBUS, then it will ignore that, or it can also process the SIGBUS?
>
> I don't think the signal blocking mechanism makes sense for this.
> Blocking a signal is for saying that, if another process sends the
> signal (or an async event like ctrl-C), then the process doesn't want
> it. Blocking doesn't block synchronous things like faults.
>
> I think we need to at least fix the existing bug before we add more
> signals. AFAICS the MCE_IN_KERNEL_COPYIN code is busted for kernel
> threads.
Got this, Thanks!
I read https://man7.org/linux/man-pages/man2/write.2.html, and it seems the write syscall is not expecting
an signal, maybe a specific error code for this scenario is enough.
--
Thanks!
Aili Yao
next prev parent reply other threads:[~2021-03-11 2:02 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-01 8:17 [PATCH v2] x86/fault: Send a SIGBUS to user process always for hwpoison page access Aili Yao
2021-02-01 16:58 ` Andy Lutomirski
2021-02-01 21:10 ` Luck, Tony
2021-02-01 22:09 ` Andy Lutomirski
2021-02-02 6:42 ` Aili Yao
2021-02-04 7:25 ` HORIGUCHI NAOYA(堀口 直也)
2021-02-05 5:06 ` Aili Yao
2021-02-05 9:01 ` [PATCH v3] " Aili Yao
2021-02-23 12:44 ` Aili Yao
2021-02-23 15:33 ` Andy Lutomirski
2021-02-23 16:42 ` Luck, Tony
2021-02-25 4:47 ` Aili Yao
2021-02-27 3:40 ` Andy Lutomirski
2021-03-01 7:57 ` Aili Yao
2021-03-01 18:12 ` Luck, Tony
2021-03-01 19:02 ` Luck, Tony
2021-03-01 19:09 ` Andy Lutomirski
2021-03-03 12:24 ` Aili Yao
2021-03-03 12:51 ` Aili Yao
2021-03-07 19:16 ` Andy Lutomirski
2021-03-08 9:49 ` Aili Yao
2021-03-08 18:14 ` Andy Lutomirski
2021-03-08 18:31 ` Luck, Tony
2021-03-08 19:00 ` Andy Lutomirski
2021-03-11 1:19 ` Aili Yao
2021-03-11 1:28 ` Andy Lutomirski
2021-03-11 2:01 ` Aili Yao [this message]
2021-03-11 16:52 ` Luck, Tony
2021-03-11 16:56 ` Peter Zijlstra
2021-03-09 2:14 ` Aili Yao
2021-03-09 2:25 ` Aili Yao
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=20210311100154.5a75c62e@alex-virtual-machine \
--to=yaoaili@kingsoft.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=luto@amacapital.net \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=naoya.horiguchi@nec.com \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=suhua1@kingsoft.com \
--cc=sunhao2@kingsoft.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
--cc=yangfeng1@kingsoft.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.