From: David Windsor <dwindsor@gmail.com>
To: alex.roberts109@outlook.com, Kees Cook <kees@kernel.org>,
Paul Moore <paul@paul-moore.com>,
James Morris <jmorris@namei.org>,
"Serge E . Hallyn" <serge@hallyn.com>
Cc: linux-kernel@vger.kernel.org,
linux-security-module@vger.kernel.org, bpf@vger.kernel.org,
Alexei Starovoitov <ast@kernel.org>,
KP Singh <kpsingh@kernel.org>, David Windsor <dwindsor@gmail.com>
Subject: Re: [PATCH] Add LoadPin support for eBPF program loading
Date: Thu, 11 Jun 2026 20:08:25 -0400 [thread overview]
Message-ID: <20260612000825.105100-1-dwindsor@gmail.com> (raw)
In-Reply-To: <20260611-b4-rfc-loadpin-ebpf-v1-1-11a6c8e6170d@outlook.com>
On Thu, Jun 11, 2026 at 01:59:10PM -0500, Alex Roberts wrote:
> +static int loadpin_bpf_prog_load(struct bpf_prog *prog, union bpf_attr *attr,
> + struct bpf_token *token, bool is_kernel)
> +{
> + int res = 0;
> + struct file *exe_file = NULL;
> + struct mm_struct *mm = current->mm;
> +
> + if (is_kernel || !mm)
> + return 0;
> +
> + exe_file = get_mm_exe_file(mm);
> + if (!exe_file)
> + return 0;
> +
> + res = loadpin_check(exe_file, READING_EBPF);
Why are we checking current here? IIUC this will be whoever calls
bpf(2), which would be the loader, which would then be able to load bpf
programs from an untrusted source.
In the kmod case loadpin_check() sees the .ko itself.
next prev parent reply other threads:[~2026-06-12 0:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-11 18:59 [PATCH] Add LoadPin support for eBPF program loading Alex Roberts via B4 Relay
2026-06-12 0:08 ` David Windsor [this message]
2026-06-12 6:17 ` kernel test robot
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=20260612000825.105100-1-dwindsor@gmail.com \
--to=dwindsor@gmail.com \
--cc=alex.roberts109@outlook.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=jmorris@namei.org \
--cc=kees@kernel.org \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=paul@paul-moore.com \
--cc=serge@hallyn.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