linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next v2 0/3] BPF signature hash chains
@ 2025-09-29 21:34 Blaise Boscaccy
  2025-09-29 21:34 ` [PATCH bpf-next v2 1/3] bpf: Add hash chain signature support for arbitrary maps Blaise Boscaccy
                   ` (3 more replies)
  0 siblings, 4 replies; 34+ messages in thread
From: Blaise Boscaccy @ 2025-09-29 21:34 UTC (permalink / raw)
  To: bpf, linux-security-module, kpsingh, bboscaccy, paul, kys, ast,
	daniel, andrii, James.Bottomley, wufan, qmo

This patchset extends the currently proposed signature verification
patchset
https://lore.kernel.org/linux-security-module/20250813205526.2992911-1-kpsingh@kernel.org/
with hash-chain functionality to verify the contents of arbitrary
maps.

The currently proposed loader + map signature verification
scheme—requested by Alexei and KP—is simple to implement and
acceptable if users/admins are satisfied with it. However, verifying
both the loader and the maps offers additional benefits beyond just
verifying the loader:

1. Simplified Loader Logic: The lskel loader becomes simpler since it
   doesn’t need to verify program maps—this is already handled by
   bpf_check_signature().

2. Security and Audit Integrity: A key advantage is that the LSM
  (Linux Security Module) hook for authorizing BPF program loads can
  operate after signature verification. This ensures:

  * Access control decisions can be based on verified signature
  * status.  Accurate system state measurement and logging.  Log
  * events claiming a verified signature are fully truthful, avoiding
  * misleading entries that only the loader was verified while the
  * actual BPF program verification happens later without logging.

This approach addresses concerns from users who require strict audit
trails and verification guarantees, especially in security-sensitive
environments.

A working tree with this patchset is being maintained at
https://github.com/blaiseboscaccy/linux/tree/bpf-hash-chains

bpf CI tests passed as well
https://github.com/kernel-patches/bpf/actions/runs/18110352925

v2 -> v1:
   - Fix regression found by syzkaller
   - Add bash auto-complete support for new command line switch

Blaise Boscaccy (3):
  bpf: Add hash chain signature support for arbitrary maps
  selftests/bpf: Enable map verification for some lskel tests
  bpftool: Add support for signing program and map hash chains

 include/uapi/linux/bpf.h                      |  6 ++
 kernel/bpf/syscall.c                          | 73 ++++++++++++++++++-
 .../bpf/bpftool/Documentation/bpftool-gen.rst |  7 +-
 tools/bpf/bpftool/bash-completion/bpftool     |  2 +-
 tools/bpf/bpftool/gen.c                       | 27 ++++++-
 tools/bpf/bpftool/main.c                      |  9 ++-
 tools/bpf/bpftool/main.h                      |  1 +
 tools/bpf/bpftool/sign.c                      | 16 +++-
 tools/include/uapi/linux/bpf.h                |  6 ++
 tools/lib/bpf/libbpf.h                        |  3 +-
 tools/lib/bpf/skel_internal.h                 |  6 +-
 tools/testing/selftests/bpf/Makefile          | 18 ++++-
 12 files changed, 159 insertions(+), 15 deletions(-)

-- 
2.48.1


^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2025-10-23 17:53 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-29 21:34 [PATCH bpf-next v2 0/3] BPF signature hash chains Blaise Boscaccy
2025-09-29 21:34 ` [PATCH bpf-next v2 1/3] bpf: Add hash chain signature support for arbitrary maps Blaise Boscaccy
2025-09-29 21:34 ` [PATCH bpf-next v2 2/3] selftests/bpf: Enable map verification for some lskel tests Blaise Boscaccy
2025-09-29 21:34 ` [PATCH bpf-next v2 3/3] bpftool: Add support for signing program and map hash chains Blaise Boscaccy
2025-10-01 21:37 ` [PATCH bpf-next v2 0/3] BPF signature " Paul Moore
2025-10-02 13:48   ` KP Singh
2025-10-02 20:01     ` Blaise Boscaccy
2025-10-03 16:59       ` KP Singh
2025-10-03 18:14         ` Blaise Boscaccy
2025-10-03 19:02           ` KP Singh
2025-10-03  2:35     ` Paul Moore
2025-10-03 16:24       ` KP Singh
2025-10-06  3:08         ` Paul Moore
2025-10-07 13:53           ` KP Singh
2025-10-07 19:59             ` James Bottomley
2025-10-09 20:47             ` Paul Moore
2025-10-10  1:00               ` Alexei Starovoitov
2025-10-10 15:53                 ` James Bottomley
2025-10-10 19:39                   ` Paul Moore
2025-10-10 23:06                   ` Alexei Starovoitov
2025-10-11 14:52                     ` James Bottomley
2025-10-11 16:31                       ` Alexei Starovoitov
2025-10-11 17:09                         ` James Bottomley
2025-10-13  2:12                           ` Paul Moore
2025-10-16 20:51                             ` Paul Moore
2025-10-16 22:00                               ` Alexei Starovoitov
2025-10-17  1:36                                 ` Paul Moore
2025-10-17 18:03                                   ` Alexei Starovoitov
2025-10-17 18:39                                     ` Paul Moore
2025-10-20 23:13                                     ` James Bottomley
2025-10-21  1:25                                       ` Alexei Starovoitov
2025-10-22 21:10                                         ` James Bottomley
2025-10-23 15:39                                           ` KP Singh
2025-10-23 17:53                                             ` Paul Moore

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).