Re: [PATCH 0/8] unwind, arm64: add sframe unwinder for kernel

Song Liu <[email protected]>
Newsgroups org.kernel.vger.linux-toolchains,org.kernel.vger.linux-kernel,org.kernel.vger.live-patching
Message-ID <CAPhsuW6dxPtgqZaHrZEVhQXwm2+sETreZnGybZXVKYKfG9H6tg@mail.gmail.com>
On Fri, Feb 14, 2025 at 12:08 AM Josh Poimboeuf <[email protected]> wrote:
>
> On Thu, Feb 13, 2025 at 11:40:43AM -0800, Song Liu wrote:
> > Yeah, objdump does show the same disassembly. However, if
> > I open the file with gdb, and do "disassemble copy_process",
> > the one in livepatch-special-static.o looks very weird.
>
> The symbol table looks ok.  I'm not sure why gdb is getting confused,
> but that could possibly be a red herring.  Maybe it doesn't like the
> -ffunction-sections for some reason.
>
> It's really weird the function length reported by kallsyms is so wrong.
> Can you share the .ko?

Attached is the .ko file.

>
> The refcount warning might indicate it's passing some bogus memory to
> tty_kref_get().  Any chance you have struct randomization enabled?

No, struct randomization is disabled.

> Are you sure there's no code or .config mismatch between the built
> kernel and the running kernel?

The test is done in a vm, so the .config used to build the livepatch is
exactly the same as the testing kernel .

>
> Ignorant arm64 question: is the module's text further away from slab
> memory than vmlinux text, thus requiring a different instruction (or
> GOT/TOC) to access memory further away in the address space?

It appears to me the module text is very close to vmlinux text:

vmlinux: ffff8000800b4b68 T copy_process
module: ffff80007b0f06d0 t copy_process [livepatch_always_inline_special_static]

I run tests with CONFIG_PAGE_SIZE_64KB=y.

Thanks,
Song
livepatch-special-static.ko (application/octet-stream, 743.2 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.