|
|
Log in / Subscribe / Register

Introducing Hornet LSM

From:  Blaise Boscaccy <bboscaccy-AT-linux.microsoft.com>
To:  Jonathan Corbet <corbet-AT-lwn.net>, David Howells <dhowells-AT-redhat.com>, Herbert Xu <herbert-AT-gondor.apana.org.au>, "David S. Miller" <davem-AT-davemloft.net>, Paul Moore <paul-AT-paul-moore.com>, James Morris <jmorris-AT-namei.org>, "Serge E. Hallyn" <serge-AT-hallyn.com>, Masahiro Yamada <masahiroy-AT-kernel.org>, Nathan Chancellor <nathan-AT-kernel.org>, Nicolas Schier <nicolas-AT-fjasle.eu>, Shuah Khan <shuah-AT-kernel.org>, Mickaël Salaün <mic-AT-digikod.net>, Günther Noack <gnoack-AT-google.com>, Nick Desaulniers <nick.desaulniers+lkml-AT-gmail.com>, Bill Wendling <morbo-AT-google.com>, Justin Stitt <justinstitt-AT-google.com>, Blaise Boscaccy <bboscaccy-AT-linux.microsoft.com>, Jarkko Sakkinen <jarkko-AT-kernel.org>, Jan Stancek <jstancek-AT-redhat.com>, Neal Gompa <neal-AT-gompa.dev>, linux-doc-AT-vger.kernel.org, linux-kernel-AT-vger.kernel.org, keyrings-AT-vger.kernel.org, linux-crypto-AT-vger.kernel.org, linux-security-module-AT-vger.kernel.org, linux-kbuild-AT-vger.kernel.org, linux-kselftest-AT-vger.kernel.org, bpf-AT-vger.kernel.org, llvm-AT-lists.linux.dev, nkapron-AT-google.com, teknoraver-AT-meta.com, roberto.sassu-AT-huawei.com, xiyou.wangcong-AT-gmail.com
Subject:  [RFC PATCH security-next 0/4] Introducing Hornet LSM
Date:  Fri, 21 Mar 2025 09:45:02 -0700
Message-ID:  <20250321164537.16719-1-bboscaccy@linux.microsoft.com>
Archive-link:  Article

This patch series introduces the Hornet LSM.

Hornet takes a simple approach to light-skeleton-based eBPF signature
verification. Signature data can be easily generated for the binary
data that is generated via bpftool gen -L. This signature can be
appended to a skeleton executable via scripts/sign-ebpf. Hornet checks
the signature against a binary buffer containing the lskel
instructions that the loader maps use. Maps are frozen to prevent
TOCTOU bugs where a sufficiently privileged user could rewrite map
data between the calls to BPF_PROG_LOAD and
BPF_PROG_RUN. Additionally, both sparse-array-based and
fd_array_cnt-based map fd arrays are supported for signature
verification.


Blaise Boscaccy (4):
  security: Hornet LSM
  hornet: Introduce sign-ebpf
  hornet: Add an example lskel data extactor script
  selftests/hornet: Add a selftest for the hornet LSM

 Documentation/admin-guide/LSM/Hornet.rst     |  51 +++
 crypto/asymmetric_keys/pkcs7_verify.c        |  10 +
 include/linux/kernel_read_file.h             |   1 +
 include/linux/verification.h                 |   1 +
 include/uapi/linux/lsm.h                     |   1 +
 scripts/Makefile                             |   1 +
 scripts/hornet/Makefile                      |   5 +
 scripts/hornet/extract-skel.sh               |  29 ++
 scripts/hornet/sign-ebpf.c                   | 420 +++++++++++++++++++
 security/Kconfig                             |   3 +-
 security/Makefile                            |   1 +
 security/hornet/Kconfig                      |  11 +
 security/hornet/Makefile                     |   4 +
 security/hornet/hornet_lsm.c                 | 239 +++++++++++
 tools/testing/selftests/Makefile             |   1 +
 tools/testing/selftests/hornet/Makefile      |  51 +++
 tools/testing/selftests/hornet/loader.c      |  21 +
 tools/testing/selftests/hornet/trivial.bpf.c |  33 ++
 18 files changed, 882 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/admin-guide/LSM/Hornet.rst
 create mode 100644 scripts/hornet/Makefile
 create mode 100755 scripts/hornet/extract-skel.sh
 create mode 100644 scripts/hornet/sign-ebpf.c
 create mode 100644 security/hornet/Kconfig
 create mode 100644 security/hornet/Makefile
 create mode 100644 security/hornet/hornet_lsm.c
 create mode 100644 tools/testing/selftests/hornet/Makefile
 create mode 100644 tools/testing/selftests/hornet/loader.c
 create mode 100644 tools/testing/selftests/hornet/trivial.bpf.c

-- 
2.48.1




Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds