mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Lukas Hruska <lhruska@suse.cz>
Cc: mbenes@suse.cz, jpoimboe@kernel.org, joe.lawrence@redhat.com,
	live-patching@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kbuild@vger.kernel.org, mpdesouza@suse.com,
	Josh Poimboeuf <jpoimboe@redhat.com>
Subject: Re: [PATCH v3 3/6] kbuild/modpost: integrate klp-convert
Date: Wed, 8 Oct 2025 15:14:23 +0200	[thread overview]
Message-ID: <aOZjr7YTSrT-BznV@pathway.suse.cz> (raw)
In-Reply-To: <20240827123052.9002-4-lhruska@suse.cz>

On Tue 2024-08-27 14:30:48, Lukas Hruska wrote:
> From: Josh Poimboeuf <jpoimboe@redhat.com>
> 
> Call klp-convert for the livepatch modules after the final linking.
> 
> Also update the modpost tool so that it does not warn about unresolved
> symbols matching the expected format which will be then resolved by
> klp-convert.
> 
> --- a/scripts/mod/modpost.c
> +++ b/scripts/mod/modpost.c
> @@ -1676,10 +1680,18 @@ static void check_exports(struct module *mod)
>  		const char *basename;
>  		exp = find_symbol(s->name);
>  		if (!exp) {
> -			if (!s->weak && nr_unresolved++ < MAX_UNRESOLVED_REPORTS)
> +			if (!s->weak && nr_unresolved++ < MAX_UNRESOLVED_REPORTS) {
> +				/*
> +				 * In case of livepatch module we allow
> +				 * unresolved symbol with a specific format
> +				 */
> +				if (mod->is_livepatch &&
> +				    strncmp(s->name, KLP_SYM_RELA, strlen(KLP_SYM_RELA)) == 0)
> +					break;

Just for record. There must be "continue" instead of "break".
Otherwise, the function does not check the remaining symbols.
It won't copy CRCs of exported symbols. Finally, depmod would
complain about incompatible versions of symbols.


>  				modpost_log(warn_unresolved ? LOG_WARN : LOG_ERROR,
>  					    "\"%s\" [%s.ko] undefined!\n",
>  					    s->name, mod->name);
> +			}
>  			continue;
>  		}
>  		if (exp->module == mod) {

Best Regards,
Petr

PS: I am not sure if this patchset would ever reach upstream.
    But we found this bug when using the tool...

  reply	other threads:[~2025-10-08 13:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-27 12:30 [PATCH v3 0/6] livepatch: klp-convert tool - Minimal version Lukas Hruska
2024-08-27 12:30 ` [PATCH v3 1/6] livepatch: Create and include UAPI headers Lukas Hruska
2024-08-27 12:30 ` [PATCH v3 2/6] livepatch: Add klp-convert tool Lukas Hruska
2024-08-27 12:30 ` [PATCH v3 3/6] kbuild/modpost: integrate klp-convert Lukas Hruska
2025-10-08 13:14   ` Petr Mladek [this message]
2024-08-27 12:30 ` [PATCH v3 4/6] livepatch: Add sample livepatch module Lukas Hruska
2024-08-28 18:43   ` Jeff Johnson
2024-08-27 12:30 ` [PATCH v3 5/6] documentation: Update on livepatch elf format Lukas Hruska
2024-08-27 12:30 ` [PATCH v3 6/6] selftests: livepatch: Test livepatching function using an external symbol Lukas Hruska
2024-08-27 12:30 ` [PATCH v3 7/6 DONT_MERGE] selftests: livepatch: Test failing IBT checks crashing the module Lukas Hruska
2024-09-12 15:15 ` [PATCH v3 0/6] livepatch: klp-convert tool - Minimal version Joe Lawrence
2024-09-13 23:16   ` Josh Poimboeuf

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=aOZjr7YTSrT-BznV@pathway.suse.cz \
    --to=pmladek@suse.com \
    --cc=joe.lawrence@redhat.com \
    --cc=jpoimboe@kernel.org \
    --cc=jpoimboe@redhat.com \
    --cc=lhruska@suse.cz \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=mpdesouza@suse.com \
    /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

all inboxes | Powered by JetHome®