lkml.org 
[lkml]   [2019]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/6] objtool: Add UACCESS validation
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@infradead.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.

\
 
 \ /
  Last update: 2019-02-25 17:13    [W:1.670 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site