Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1455633

Re: [kernel-hardening] Re: Linker segfault on powerpc when CONFIG_LKDTM=y (was Re: [kernel-hardening] [PATCH 3/5] lkdtm: add function for testing .rodata section)

From Michael Ellerman <mpe@ellerman.id.au>
Newsgroups linux.kernel
Subject Re: [kernel-hardening] Re: Linker segfault on powerpc when CONFIG_LKDTM=y (was Re: [kernel-hardening] [PATCH 3/5] lkdtm: add function for testing .rodata section)
Date 2016-08-03 07:00 +0200
Message-ID <s1WrD-644-5@gated-at.bofh.it> (permalink)
References (1 earlier) <rHxcu-85W-29@gated-at.bofh.it> <s1rxv-2ia-25@gated-at.bofh.it> <s1rxv-2ia-23@gated-at.bofh.it> <s1ypj-786-7@gated-at.bofh.it> <s1Nom-m7-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Kees Cook <keescook@chromium.org> writes:
> On Mon, Aug 1, 2016 at 8:12 PM, Michael Ellerman <mpe@ellerman.id.au> wrote:
>> Kees Cook <keescook@chromium.org> writes:
>>> On Mon, Aug 1, 2016 at 5:37 AM, Michael Ellerman <mpe@ellerman.id.au> wrote:
>>>>
>>>>   scripts/link-vmlinux.sh: line 52: 36260 Segmentation fault      (core dumped) ${LD} ${LDFLAGS} ${LDFLAGS_vmlinux} -o ${2} -T ${lds} ${KBUILD_VMLINUX_INIT} --start-group ${KBUILD_VMLINUX_MAIN} --end-group ${1}
>>>>
>>>> Haven't had a chance to debug it further.
...
>> Interestingly I *can't* reproduce with the Ubuntu x86->ppc cross
>> (5.4.0-6ubuntu1~16.04.1).
>
> Oh, weird. Well, that does explains my lack of hitting the problem,
> though: that's the cross compiler I was using. :P

Actually that was a false negative.

The trick is you have to have LKDTM=y *and* FUNCTION_TRACER=y.

It is a linker bug:

  https://sourceware.org/bugzilla/show_bug.cgi?id=20428

Which Alan has already fixed.

But we need to workaround existing linkers that are out there.

We can do that by marking lkdtm_rodata_do_nothing() notrace, which I
think makes sense for all arches actually.

So I'll send you a patch to do that.

cheers

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: Linker segfault on powerpc when CONFIG_LKDTM=y (was Re:  [kernel-hardening] [PATCH 3/5] lkdtm: add function for testing .rodata section) Kees Cook <keescook@chromium.org> - 2016-08-01 22:00 +0200
  Re: [kernel-hardening] Re: Linker segfault on powerpc when CONFIG_LKDTM=y (was Re: [kernel-hardening] [PATCH 3/5] lkdtm: add function for testing .rodata section) Michael Ellerman <mpe@ellerman.id.au> - 2016-08-02 05:20 +0200
    Re: [kernel-hardening] Re: Linker segfault on powerpc when  CONFIG_LKDTM=y (was Re: [kernel-hardening] [PATCH 3/5] lkdtm: add function  for testing .rodata section) Kees Cook <keescook@chromium.org> - 2016-08-02 21:20 +0200
      Re: [kernel-hardening] Re: Linker segfault on powerpc when CONFIG_LKDTM=y (was Re: [kernel-hardening] [PATCH 3/5] lkdtm: add function for testing .rodata section) Michael Ellerman <mpe@ellerman.id.au> - 2016-08-03 07:00 +0200

csiph-web