diff options
| author | Qiliang Yuan <odys.yuan@gmail.com> | 2026-10-08 22:03:25 +0800 |
|---|---|---|
| committer | Daniel Borkmann <daniel@iogearbox.net> | 2026-10-15 10:05:59 +0200 |
| commit | 66fd5eb9da12ef4ed089ed1974160d07ff034a19 (patch) | |
| tree | 74b39f13b84c7f22b192e248a8d8f80c713e9210 /tools | |
| parent | 76c1913f311f32971dc2c3e106e285bd63c1804d (diff) | |
selftests/bpf: Report a failure to register the session key in test_progs
test_progs adds the key that verifies signed programs to the session
keyring before it runs any test, and exits when that fails.
It exits with 255 without printing anything. pam_keyinit revokes the
session keyring on logout, so a test_progs started in the background
from an ssh session that has been closed since leaves nothing but an
empty log behind, with no hint of what went wrong.
Print the error before exiting.
Fixes: b720903e2b14 ("selftests/bpf: Enable signature verification for some lskel tests")
Signed-off-by: Qiliang Yuan <odys.yuan@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20261008-selftests-bpf-test-progs-session-key-v1-1-ec48e793639b@gmail.com
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/testing/selftests/bpf/test_progs.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/test_progs.c index 46eb201b96a3..168d84cf4eb7 100644 --- a/tools/testing/selftests/bpf/test_progs.c +++ b/tools/testing/selftests/bpf/test_progs.c @@ -2065,8 +2065,11 @@ int main(int argc, char **argv) libbpf_set_print(libbpf_print_fn); err = register_session_key((const char *)test_progs_verification_cert, test_progs_verification_cert_len); - if (err < 0) + if (err < 0) { + fprintf(stderr, "Failed to add libbpf_session_key to the session keyring: %s\n", + strerror(errno)); return err; + } traffic_monitor_set_print(traffic_monitor_print_fn); |
