Linux Security Modules development
 help / color / mirror / Atom feed
From: KP Singh <kpsingh@kernel.org>
To: bpf@vger.kernel.org, linux-security-module@vger.kernel.org
Cc: ast@kernel.org, daniel@iogearbox.net, memxor@gmail.com
Subject: [PATCH v2 0/2] gen_loader fixes
Date: Thu, 21 May 2026 17:22:15 +0200	[thread overview]
Message-ID: <20260521152217.2345235-1-kpsingh@kernel.org> (raw)

  Fix off-by-one in the signed loader's cleanup jump and reject
  non-exclusive metadata maps.

  Patch 1 fixes a pre-existing bug: the cleanup-label offset in
  emit_signature_match() does not account for the MOV insn emitted
  before the JMP.

  Patch 2 adds an exclusivity check so the loader bails if the
  metadata map lacks excl_prog_hash, preventing stale-hash attacks
  from concurrent map writers.

KP Singh (2):
  libbpf: fix off-by-one in emit_signature_match jump offset
  bpf, libbpf: reject non-exclusive metadata maps in the signed loader

 include/linux/bpf.h                           |  2 +-
 tools/lib/bpf/gen_loader.c                    | 19 +++++++++++++++++--
 .../selftests/bpf/progs/verifier_map_ptr.c    | 10 ++++++----
 3 files changed, 24 insertions(+), 7 deletions(-)

-- 
2.53.0


             reply	other threads:[~2026-05-21 15:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-21 15:22 KP Singh [this message]
2026-05-21 15:22 ` [PATCH v2 1/2] libbpf: fix off-by-one in emit_signature_match jump offset KP Singh
2026-05-21 16:03   ` bot+bpf-ci
2026-05-21 15:22 ` [PATCH v2 2/2] bpf, libbpf: reject non-exclusive metadata maps in the signed loader KP Singh
2026-05-21 16:03   ` bot+bpf-ci

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=20260521152217.2345235-1-kpsingh@kernel.org \
    --to=kpsingh@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=linux-security-module@vger.kernel.org \
    --cc=memxor@gmail.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