[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201103182018.GE4111@zn.tnic>
Date: Tue, 3 Nov 2020 19:20:18 +0100
From: Borislav Petkov <bp@...en8.de>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Mark Mossberg <mark.mossberg@...il.com>, tglx@...utronix.de,
mingo@...hat.com, x86@...nel.org, linux-kernel@...r.kernel.org,
hpa@...or.com, jannh@...gle.com, kyin@...hat.com
Subject: Re: [PATCH v2] x86/dumpstack: Fix misleading instruction pointer
error message
On Tue, Nov 03, 2020 at 07:11:15PM +0100, Oleg Nesterov wrote:
> > I'm thinking copy_code() should not use copy_from_user_nmi() if former
> > can be called in non-atomic context too.
>
> I understand, but why do you think this makes sense?
Because the copy_from_user_nmi()'s name tells me that it is at least
supposed to be called in atomic context. At least this is how I
understand it. And in atomic context regs is supposed to belong to
current, right?
So I kinda agree with what you're proposing but if copy_from_user_nmi()
can be "tricked" into reading off from the weeds, then there should be
a big fat warning above it at least so that users are warned to do the
appropriate checks.
Or there should be another wrapper around it which does the
regs-belongs-to-current checks, etc and copy_code() should use that
wrapper...
AFAICT at least.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists