lkml.org 
[lkml]   [2023]   [Sep]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] x86/vmlinux: Fix linker fill bytes for ld.lld
On Wed, Sep 6, 2023 at 12:58 PM Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Wed, Sep 06, 2023 at 10:52:15AM -0700, Song Liu wrote:
> > With ":text =0xcccc", ld.lld fills unused text area with 0xcccc0000.
> > Example objdump -D output:
> >
> > ffffffff82b04203: 00 00 add %al,(%rax)
> > ffffffff82b04205: cc int3
> > ffffffff82b04206: cc int3
> > ffffffff82b04207: 00 00 add %al,(%rax)
> > ffffffff82b04209: cc int3
> > ffffffff82b0420a: cc int3
> >
> > Replace it with ":text =0xcccccccc", so we get the following instead:
> >
> > ffffffff82b04203: cc int3
> > ffffffff82b04204: cc int3
> > ffffffff82b04205: cc int3
> > ffffffff82b04206: cc int3
> > ffffffff82b04207: cc int3
> > ffffffff82b04208: cc int3
> >
> > gcc/ld doesn't seem to have the same issue. The generated code stays the
> > same for gcc/ld.
> >
> > Cc: Kees Cook <keescook@chromium.org>
> > Cc: x86@kernel.org
> > Signed-off-by: Song Liu <song@kernel.org>
>
> Please provide a Fixes tag, I'm thinking this (otherwise trivial commit)
> wants to be backported for sanity.

I guess we need:

Fixes: 7705dc855797 ("x86/vmlinux: Use INT3 instead of NOP for linker
fill bytes")

Thanks,
Song

>
> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>

\
 
 \ /
  Last update: 2023-09-06 22:06    [W:0.052 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site