[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aOZjr7YTSrT-BznV@pathway.suse.cz>
Date: Wed, 8 Oct 2025 15:14:23 +0200
From: Petr Mladek <pmladek@...e.com>
To: Lukas Hruska <lhruska@...e.cz>
Cc: mbenes@...e.cz, jpoimboe@...nel.org, joe.lawrence@...hat.com,
live-patching@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-kbuild@...r.kernel.org, mpdesouza@...e.com,
Josh Poimboeuf <jpoimboe@...hat.com>
Subject: Re: [PATCH v3 3/6] kbuild/modpost: integrate klp-convert
On Tue 2024-08-27 14:30:48, Lukas Hruska wrote:
> From: Josh Poimboeuf <jpoimboe@...hat.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...
Powered by blists - more mailing lists