public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCHSET 0/2] cBPF filter API adjustment
Date: Tue, 17 Feb 2026 14:38:11 +0100	[thread overview]
Message-ID: <20260217-botschaft-fugen-1c76dd0ff974@brauner> (raw)
In-Reply-To: <20260211150626.136826-1-axboe@kernel.dk>

On Wed, Feb 11, 2026 at 08:01:16AM -0700, Jens Axboe wrote:
> Hi,
> 
> Christian brought up a good point on the API - what if the task and
> kernel differ on what the payload size is for an opcode? Currently
> there are two defined payloads, inside struct io_uring_bpf_ctx:
> 
> 	struct {
> 		__u32	family;
> 		__u32	type;
> 		__u32	protocol;
> 	} socket;
> 
> 	struct {
> 		__u64	flags;
> 		__u64	mode;
> 		__u64	resolve;
> 	} open;
> 
> and it could be a requirement that a filter exactly matches the payload
> that the kernel uses, if extensions have been made on the kernel side.
> Hence this small series updates the API slightly:
> 
> struct io_uring_bpf_filter adds a pdu_size field, which userspace can
> set to the size if expects. For an OPENAT/OPENAT2 filter, that would
> be sizeof(struct open) above. The kernel can validate that they match,
> where the mismatch policy is controlled by userspace. See patch 2 for
> details. In case of a mismatch that causes an error, the kernel side
> pdu_size is copied back to userspace.
> 
> Patch 1 exposes the pdu_size by shoving the filtering and pdu_size
> into the issue side definitions, and patch 2 implements the above
> size checking.
> 
> The liburing master branch has been updated as well for this, as
> copying back the pdu_size necessitates changing the API on that side.
> Test cases and man pages are updated as well.

Seems fine by me,
Reviewed-by: Christian Brauner <brauner@kernel.org>

      parent reply	other threads:[~2026-02-17 13:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-11 15:01 [PATCHSET 0/2] cBPF filter API adjustment Jens Axboe
2026-02-11 15:01 ` [PATCH 1/2] io_uring/bpf_filter: move filter size and populate helper into struct Jens Axboe
2026-02-11 15:01 ` [PATCH 2/2] io_uring/bpf_filter: pass in expected filter payload size Jens Axboe
2026-02-17 13:37   ` Christian Brauner
2026-02-17 13:38 ` Christian Brauner [this message]

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=20260217-botschaft-fugen-1c76dd0ff974@brauner \
    --to=brauner@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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