Re: [PATCH 0/1] Mitigate klp-build data sympos bug

Josh Poimboeuf <[email protected]> Tue, 21 Jul 2026 22:46:13 -0700
Newsgroups org.kernel.vger.live-patching
Message-ID <ini7aoz6vvowmu5dvxoxpi6l4ednsov6omjcoffmuod3d2iaof@vflcrwqktqsl>
On Fri, Jul 10, 2026 at 11:30:41AM -0400, Joe Lawrence wrote:
> Hi Josh,
> 
> This is an upstream reproducer of a downstream bug report from Ben.  He
> encountered a sympos bug on rhel-10 with the same pwq_cache variable.
> Here I distilled it down to minimal (upstream) reproducer config and
> patch.
> 
> From what I can tell, function symbols already have a "HACK" disclaimer
> around their workaround -- the attached patch tries to extend the same
> idea to data symbols.  It may not have 100% coverage, and it's certainly
> brittle as it assumes ordering as per the linker script.  But the idea
> is to band-aid the problem until a more robust fix is ready.
> 
> The comment in find_sympos() suggests leveraging the checksum mechanism
> as a better fix, but perhaps we could also pass the vmlinux file through
> and read the ordering from the post-linked object?  I can work on that
> for a v2, but in the meantime do you think this bandaid would be
> sufficient for at least downstream use?

As far as downstream goes, if you're 100% sure that you've got all the
different sections covered and in the right order for the right arch for
the right kernel version, then yeah I suppose extending the HACK could
work.

Though I suspect the proper fix won't be too hard.  So rather than
propagate my original hack even further, we should probably just fix it
properly.

I'm not sure about my original idea to replace sympos with checksums, as
there can be duplicate checksums.  But as you alluded to, I do think we
could have some special section(s) created by the main objtool run for
vmlinux.o/vmlinux which could be used by klp-diff to disambiguate and
set the sympos accordingly.  Let me know if you'd like me to work up
some patches for that.

-- 
Josh