public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Blaise Boscaccy <bboscaccy@linux.microsoft.com>
To: KP Singh <kpsingh@kernel.org>, Paul Moore <paul@paul-moore.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	ast@kernel.org, james.bottomley@hansenpartnership.com,
	bpf@vger.kernel.org, linux-security-module@vger.kernel.org,
	kys@microsoft.com, daniel@iogearbox.net, andrii@kernel.org,
	wufan@linux.microsoft.com, qmo@kernel.org
Subject: Re: [PATCH bpf-next v2 0/3] BPF signature hash chains
Date: Thu, 02 Oct 2025 13:01:30 -0700	[thread overview]
Message-ID: <871pnlysx1.fsf@microsoft.com> (raw)
In-Reply-To: <CACYkzJ4yG1d8ujZ8PVzsRr_PWpyr6goD9DezQTu8ydaf-skn6g@mail.gmail.com>

KP Singh <kpsingh@kernel.org> writes:

> On Wed, Oct 1, 2025 at 11:37 PM Paul Moore <paul@paul-moore.com> wrote:
>>
>
> [...]
>

[...]

I am confident that Paul will address your remaining points. However, I
would like to clarify a few factual inaccuracies outlined below.

>
> Blaise's implementation fails on any modern BPF programs since
> programs use more than one map, BTF information and kernel functions.
>

If you read the patch series you'd see that it supports verification of
any number of maps. If you've identified an issue with map verification,
please share the details and I’ll address it.


[...]

>> conventions around the placement of LSM hooks, this "halfway" approach
>> makes it difficult for LSMs to log anything about the signature status
>> of a BPF program being loaded, or use the signature status in any type
>> of access decision.  This is important for a number of user groups
>> that use LSM based security policies as a way to help reason about the
>> security properties of a system, as KP's scheme would require the
>> users to analyze the signature verification code in every BPF light
>> skeleton they authorize as well as the LSM policy in order to reason
>> about the security mechanisms involved in BPF program loading.
>>
>> Blaise's signature scheme also has the nice property that BPF ELF
>> objects created using his scheme are backwards compatible with
>> existing released kernels that do not support any BPF signature
>> verification schemes, of course without any signature verification.
>> Loading a BPF ELF object using KP's signature scheme will likely fail
>> when loaded on existing released kernels.
>
> This does not make any sense. The ELF format and the way loaders like
> libbpf interpret it, has nothing to do with the kernel or UAPI.
>

We signed a program with your upstream tools and it failed to load on a
vanilla kernel 6.16. The loader in your patchset is intepreting the
first few fields of struct bpf_map as a byte array containing a sha256
digest on older kernels.

-blaise


> I had given detailed feedback to Blaise in
> https://lore.kernel.org/bpf/CACYkzJ6yNjFOTzC04uOuCmFn=+51_ie2tB9_x-u2xbcO=yobTw@mail.gmail.com/
> mentions also why we don't want any additional UAPI.
>
> You keep mentioning having visibility  in the LSM code and I again
> ask, to implement what specific security policy and there is no clear
> answer? On a system where you would like to only allow signed BPF
> programs, you can purely deny any programs where the signature is not
> provided and this can be implemented today.
>
> Stable programs work as it is, programs that require runtime
> relocation work with loader programs. We don't want to add more UAPI
> as, in the future, it's quite possible that we can make the
> instruction buffer stable.
>
> - KP
>
>>
>> [1] https://lore.kernel.org/linux-security-module/CAADnVQ+C2KNR1ryRtBGOZTNk961pF+30FnU9n3dt3QjaQu_N6Q@mail.gmail.com/
>> [2] https://lore.kernel.org/linux-security-module/CAHC9VhRjKV4AbSgqb4J_-xhkWAp_VAcKDfLJ4GwhBNPOr+cvpg@mail.gmail.com/
>> [3] https://lore.kernel.org/linux-security-module/87sei58vy3.fsf@microsoft.com/
>> [4] https://lore.kernel.org/linux-security-module/20250909162345.569889-2-bboscaccy@linux.microsoft.com/
>> [5] https://lore.kernel.org/linux-security-module/20250926203111.1305999-1-bboscaccy@linux.microsoft.com/
>> [6] https://lore.kernel.org/linux-security-module/20250929213520.1821223-1-bboscaccy@linux.microsoft.com/
>>
>> --
>> paul-moore.com

  reply	other threads:[~2025-10-02 20:01 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=871pnlysx1.fsf@microsoft.com \
    --to=bboscaccy@linux.microsoft.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=kpsingh@kernel.org \
    --cc=kys@microsoft.com \
    --cc=linux-security-module@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=qmo@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=wufan@linux.microsoft.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox