[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210119105632.GF27433@zn.tnic>
Date: Tue, 19 Jan 2021 11:56:32 +0100
From: Borislav Petkov <bp@...en8.de>
To: "Luck, Tony" <tony.luck@...el.com>
Cc: x86@...nel.org, Andrew Morton <akpm@...ux-foundation.org>,
Peter Zijlstra <peterz@...radead.org>,
Darren Hart <dvhart@...radead.org>,
Andy Lutomirski <luto@...nel.org>,
linux-kernel@...r.kernel.org, linux-edac@...r.kernel.org,
linux-mm@...ck.org
Subject: Re: [PATCH v4] x86/mce: Avoid infinite loop for copy from user
recovery
On Fri, Jan 15, 2021 at 03:23:46PM -0800, Luck, Tony wrote:
> On Fri, Jan 15, 2021 at 12:51:03PM -0800, Luck, Tony wrote:
> > static void kill_me_now(struct callback_head *ch)
> > {
> > + p->mce_count = 0;
> > force_sig(SIGBUS);
> > }
>
> Brown paper bag time ... I just pasted that line from kill_me_maybe()
> and I thought I did a re-compile ... but obviously not since it gives
>
> error: āpā undeclared (first use in this function)
>
> Option a) (just like kill_me_maybe)
>
> struct task_struct *p = container_of(cb, struct task_struct, mce_kill_me);
>
> Option b) (simpler ... not sure why PeterZ did the container_of thing
>
> current->mce_count = 0;
Right, he says it is the canonical way to get it out of callback_head.
I don't think current will change while the #MC handler runs but we can
adhere to the design pattern here and do container_of() ...
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists