linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Joe Lawrence <joe.lawrence@redhat.com>
To: Christophe Leroy <christophe.leroy@csgroup.eu>,
	Russell Currey <ruscur@russell.cc>,
	"live-patching@vger.kernel.org" <live-patching@vger.kernel.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Jordan Niethe <jniethe5@gmail.com>, Jessica Yu <jeyu@kernel.org>,
	Josh Poimboeuf <jpoimboe@redhat.com>
Subject: Re: ppc64le STRICT_MODULE_RWX and livepatch apply_relocate_add() crashes
Date: Mon, 13 Dec 2021 09:47:40 -0500	[thread overview]
Message-ID: <919a79b8-feff-b0a4-b96a-73f376b7f6dc@redhat.com> (raw)
In-Reply-To: <bed88ff4-e5d3-4b78-4f28-29fc635c2f97@csgroup.eu>

On 12/13/21 2:42 AM, Christophe Leroy wrote:
> 
> Hello Joe,
> 
> I'm implementing LIVEPATCH on PPC32 and I wanted to test with 
> STRICT_MODULE_RWX enabled so I took your branch as suggested, but I'm 
> getting the following errors on build. What shall I do ?
> 
>    CALL    scripts/checksyscalls.sh
>    CALL    scripts/atomic/check-atomics.sh
>    CHK     include/generated/compile.h
>    KLP     lib/livepatch/test_klp_convert1.ko
> klp-convert: section .rela.klp.module_relocs.test_klp_convert_mod length 
> beyond nr_entries
> 
> klp-convert: Unable to load user-provided sympos
> make[2]: *** [scripts/Makefile.modfinal:79: 
> lib/livepatch/test_klp_convert1.ko] Error 255
>    KLP     lib/livepatch/test_klp_convert2.ko
> klp-convert: section .rela.klp.module_relocs.test_klp_convert_mod length 
> beyond nr_entries
> 
> klp-convert: Unable to load user-provided sympos
> make[2]: *** [scripts/Makefile.modfinal:79: 
> lib/livepatch/test_klp_convert2.ko] Error 255
>    KLP     lib/livepatch/test_klp_convert_sections.ko
> klp-convert: section .rela.klp.module_relocs.test_klp_convert_mod length 
> beyond nr_entries
> 
> klp-convert: Unable to load user-provided sympos
> make[2]: *** [scripts/Makefile.modfinal:79: 
> lib/livepatch/test_klp_convert_sections.ko] Error 255
> make[2]: Target '__modfinal' not remade because of errors.
> make[1]: *** [scripts/Makefile.modpost:145: __modpost] Error 2
> make: *** [Makefile:1770: modules] Error 2
> 

Hi Christophe,

Interesting failure mode.  That's klp-convert complaining that it found
more relocations in a .klp.module_relocs.<objname> section than
expected, i.e. nr_entries = sec->size / sizeof(struct klp_module_reloc).

A few possibilities: the ELF sec->size was incorrectly set/read by
build/libelf (I doubt that).  Or maybe the layout/size of struct
klp_module_reloc is not consistent between kernel and userspace (I'm
more suspicious of this).

Can you post a copy of the build's symbols.klp and
lib/livepatch/test_klp_convert1.tmp.ko somewhere?  I should be able to
start debug with those files.

Thanks,
-- 
Joe


  reply	other threads:[~2021-12-13 14:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-01  2:43 ppc64le STRICT_MODULE_RWX and livepatch apply_relocate_add() crashes Joe Lawrence
2021-11-01  9:20 ` Russell Currey
2021-11-01 13:48   ` Joe Lawrence
2021-12-13  7:42     ` Christophe Leroy
2021-12-13 14:47       ` Joe Lawrence [this message]
2021-12-13 16:36         ` Christophe Leroy
2021-12-13 17:26           ` Joe Lawrence
2021-12-14 12:44             ` Christophe Leroy
2021-12-14 13:00               ` Joe Lawrence
2021-12-14 13:35                 ` Christophe Leroy
2021-11-03 21:33   ` Suraj Jitindar Singh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=919a79b8-feff-b0a4-b96a-73f376b7f6dc@redhat.com \
    --to=joe.lawrence@redhat.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=jeyu@kernel.org \
    --cc=jniethe5@gmail.com \
    --cc=jpoimboe@redhat.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=live-patching@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=ruscur@russell.cc \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).