lkml.org 
[lkml]   [2022]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 00/39] x86: Kernel IBT
On Fri, Feb 25, 2022 at 04:43:20PM +0100, Peter Zijlstra wrote:
> On Fri, Feb 25, 2022 at 04:28:32PM +0100, Peter Zijlstra wrote:
> > +void *skip_endbr(void *addr)
> > +{
> > + unsigned long size, offset;
> > +
> > + if (is_endbr(*(unsigned int *)addr) &&
> > + kallsyms_lookup_size_offset((unsigned long)addr, &size, &offset) &&
> > + !offset)
> > + addr += 4;
> > +
> > + return addr;
> > +}
>
> Damn, I just realized this makes KERNEL_IBT hard depend on KALLSYMS :-(

Why should the jump label patching code even care whether there's an
ENDBR at the jump target? It should never jump to the beginning of a
function anyway, right? And objtool presumably doesn't patch out ENDBRs
in the middle of a function.

--
Josh

\
 
 \ /
  Last update: 2022-02-25 18:29    [W:0.140 / U:1.904 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site