Live Patching
 help / color / mirror / Atom feed
From: Joe Lawrence <joe.lawrence@redhat.com>
To: Song Liu <song@kernel.org>, Petr Mladek <pmladek@suse.com>
Cc: live-patching@vger.kernel.org,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	Jiri Kosina <jikos@kernel.org>, Miroslav Benes <mbenes@suse.cz>
Subject: Re: [PATCH RFC] livepatch: add sysfs entry "patched" for each klp_object
Date: Wed, 3 Aug 2022 08:36:32 -0400	[thread overview]
Message-ID: <5eb0aebd-21ea-1a88-67de-4257e77b62ef@redhat.com> (raw)
In-Reply-To: <CAPhsuW7Fm7q3CFrSK7H3hpd-mSyC8NLoD5M7HQDuFerdSRfQ1w@mail.gmail.com>

On 8/3/22 1:53 AM, Song Liu wrote:
> On Thu, Jul 28, 2022 at 6:44 AM Petr Mladek <pmladek@suse.com> wrote:
>>
>> On Mon 2022-07-25 15:02:31, Song Liu wrote:
>>> I was debugging an issue that a livepatch appears to be attached, but
>>> actually not. It turns out that there is a mismatch in module name
>>> (abc-xyz vs. abc_xyz), klp_find_object_module failed to find the module.
>>
>> This might be a quite common mistake. IMHO, the module name stored in
>> the module metadata always uses underscore '_' instead of dash '-'.
>>
>> If I get it correctly, it is done by the following command in
>> scripts/Makefile.lib:
>>
>> --- cut ---
>> # These flags are needed for modversions and compiling, so we define them here
>> # $(modname_flags) defines KBUILD_MODNAME as the name of the module it will
>> # end up in (or would, if it gets compiled in)
>> name-fix-token = $(subst $(comma),_,$(subst -,_,$1))
>> --- cut ---
> 
> Yeah, I can confirm the "name-fix" makes the change.
> 
> Hi Josh and Joe,
> 
> I hit this issue while building live patch for OOT module with kpatch-build.
> Do you have some suggestions on how to fix it? My current workaround is
> to manually edit the .ko file...
> 

Hi Song,

Was the original issue that the module's filename included '-' dash
character(s) while the module name ends up replaced those with '_'
underscores?

If that is the case, would you prefer that kpatch-build warn or refuse
to create .ko filenames that include '-' characters?

If you have ideas, feel free to post a new issue over on the project's
github.  No one should have to resort to manually (hex) editing .ko files :)

-- 
Joe


  reply	other threads:[~2022-08-03 12:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-25 22:02 [PATCH RFC] livepatch: add sysfs entry "patched" for each klp_object Song Liu
2022-07-28 13:44 ` Petr Mladek
2022-08-03  5:53   ` Song Liu
2022-08-03 12:36     ` Joe Lawrence [this message]
2022-08-03 15:46       ` Song Liu

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=5eb0aebd-21ea-1a88-67de-4257e77b62ef@redhat.com \
    --to=joe.lawrence@redhat.com \
    --cc=jikos@kernel.org \
    --cc=jpoimboe@kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=pmladek@suse.com \
    --cc=song@kernel.org \
    /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