All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Seke Kazuru" <kazuruuni@gmail.com>, joe.lawrence@redhat.com
Cc: live-patching@vger.kernel.org, jpoimboe@kernel.org,
	mbenes@suse.cz, pmladek@suse.com, song@kernel.org,
	peterz@infradead.org, bpf@vger.kernel.org
Subject: Re: [PATCH] objtool/klp: Add test for computed-goto jump tables
Date: Tue, 01 Dec 2026 15:22:51 +0000	[thread overview]
Message-ID: <sashiko-outbox-243568@kernel.org> (raw)
In-Reply-To: <20261201151430.1712-1-kazuruuni@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] objtool/klp: test-computed-goto-table.sh fails due to
  correlated jump tables
--

commit 97b09a5c42cefb33596dc72561fccb7f73672b2a
Author: Seke Kazuru <kazuruuni@gmail.com>

objtool/klp: Add test for computed-goto jump tables

This commit adds a livepatch diff test and fixture covering static local
computed-goto jump tables when label offsets move or remain unchanged.

Link: https://lore.kernel.org/live-patching/CAJATrkz6CgsaAFjeGT_1TuUTxrpVYEo=9rGuobnhpU-LPxv_dA@mail.gmail.com/

> diff --git a/tools/objtool/tests/generic/test-computed-goto-table.sh b/tools/objtool/tests/generic/test-computed-goto-table.sh
> new file mode 100755
> index 0000000000000..46789654c9910
> --- /dev/null
> +++ b/tools/objtool/tests/generic/test-computed-goto-table.sh
> @@ -0,0 +1,137 @@

[ ... ]

> +	run_diff
> +
> +	assert_patched interp
> +	assert_not_patched other
> +
> +	# The table is the patch's own copy, pointing into the new interp
> +	# (klp diff names it by the function symbol, interp + <offset>).
> +	assert_no_klp_sym "$table"
> +	assert_symbol "$table"

[ ... ]

> +# Labels move: rejected as "changed data" today.  Unconditional, so the test
> +# can never skip as a whole.
> +check
> +check -DANNOTATE
> +
> +# Labels stay: the silent case.  Built last, since a compiler which moves a
> +# label anyway can only skip it.
> +check -DSAME_SIZE
> +check -DANNOTATE -DSAME_SIZE
> +
> +# The same in a module: the state it shares is the module's.
> +MODULE=klp_test_mod check -DANNOTATE -DSAME_SIZE
> +
> +pass "computed-goto table carried with its function, whether or not its labels move"

[Severity: Medium]
Should test-computed-goto-table.sh use xfail or be paired with the
corresponding tools/objtool/klp-diff.c fix so it does not break the
objtool test suite?

Without a change in dont_correlate() / is_uncorrelated_static_local() to
leave static local computed-goto jump tables uncorrelated, correlate_symbols()
pairs orig.o's and patched.o's jumptable symbols.  In the segments where
labels move, mark_changed_functions() rejects the table with "changed
data", causing run_diff to fail; in the -DSAME_SIZE segments, klp diff
emits a .klp.sym reference to the original kernel's table, causing
assert_no_klp_sym "$table" to fail.  As a result, running
"make -C tools/objtool tests" fails unconditionally on every run.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261201151430.1712-1-kazuruuni@gmail.com?part=1

      reply	other threads:[~2026-12-01 15:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-28  6:51 objtool/klp: ___bpf_prog_run jumptable is correlated to the original, fix never runs Seke Kazuru
2026-11-30 20:51 ` Joe Lawrence
2026-12-01 15:11   ` Seke Kazuru
2026-12-01 15:14   ` [PATCH] objtool/klp: Add test for computed-goto jump tables Seke Kazuru
2026-12-01 15:22     ` sashiko-bot [this message]

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=sashiko-outbox-243568@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=joe.lawrence@redhat.com \
    --cc=jpoimboe@kernel.org \
    --cc=kazuruuni@gmail.com \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.