[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190225171531.GD32534@hirez.programming.kicks-ass.net>
Date: Mon, 25 Feb 2019 18:15:31 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Andy Lutomirski <luto@...capital.net>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>,
Julien Thierry <julien.thierry@....com>,
Will Deacon <will.deacon@....com>,
Ingo Molnar <mingo@...nel.org>,
Catalin Marinas <catalin.marinas@....com>,
James Morse <james.morse@....com>, valentin.schneider@....com,
Brian Gerst <brgerst@...il.com>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Andrew Lutomirski <luto@...nel.org>,
Borislav Petkov <bp@...en8.de>,
Denys Vlasenko <dvlasenk@...hat.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 5/6] objtool: Add UACCESS validation
On Mon, Feb 25, 2019 at 05:12:34PM +0100, Peter Zijlstra wrote:
> On Mon, Feb 25, 2019 at 07:53:01AM -0800, Andy Lutomirski wrote:
> > On Mon, Feb 25, 2019 at 4:53 AM Peter Zijlstra <peterz@...radead.org> wrote:
>
> > > +#define UACCESS_SAFE(func) \
> > > + asm (".pushsection .discard.uaccess_safe_strtab, \"S\", @3\n\t" \
> > > + "999: .ascii \"" #func "\"\n\t" \
> > > + " .byte 0\n\t" \
> > > + ".popsection\n\t" \
> > > + ".pushsection .discard.uaccess_safe\n\t" \
> > > + ".long 999b - .\n\t" \
> > > + ".popsection")
> >
> > Minor nit: using big numbers like 999: like this always bugs me. It
> > relies on there not being a macro nested inside or outside this that
> > uses the same number. My general preference is to do something like
> > .Ldescription_\@ instead.
> >
> > Otherwise this looks conceptually good :)
>
> I seem to remember here being an issue with the \@ thing. Notably we're
> not using it in nospsec-branch.h.
>
> I'll see if I can dig up why we decided not to use it there.
Ah, so the thing we need for inline-asm is %=, but Linus didn't like it:
https://lkml.kernel.org/r/20180111175626.GJ6176@hirez.programming.kicks-ass.net
Also, I think at the time we didn't use it because backporting efforts.
I can't really find what happened between:
https://lkml.kernel.org/r/1515508997-6154-2-git-send-email-dwmw@amazon.co.uk
and
https://lkml.kernel.org/r/1515707194-20531-4-git-send-email-dwmw@amazon.co.uk
But the %= thing went away.
Powered by blists - more mailing lists