From: Jonathan Corbet <corbet@lwn.net>
To: Jens Axboe <axboe@kernel.dk>, io-uring@vger.kernel.org
Subject: Re: [PATCH 2/3] io_uring: add support for BPF filtering for opcode restrictions
Date: Thu, 15 Jan 2026 14:05:29 -0700 [thread overview]
Message-ID: <87h5smr3hi.fsf@trenco.lwn.net> (raw)
In-Reply-To: <9c57ec11-bd72-4caf-8c4b-b46c84f67ef3@kernel.dk>
Jens Axboe <axboe@kernel.dk> writes:
> On 1/15/26 1:11 PM, Jonathan Corbet wrote:
>> Jens Axboe <axboe@kernel.dk> writes:
>>
>>> This adds support for loading BPF programs with io_uring, which can
>>> restrict the opcodes performed. Unlike IORING_REGISTER_RESTRICTIONS,
>>> using BPF programs allow fine grained control over both the opcode
>>> in question, as well as other data associated with the request.
>>> Initially only IORING_OP_SOCKET is supported.
>>
>> A minor nit...
>>
>> [...]
>>
>>> +/*
>>> + * Run registered filters for a given opcode. Return of 0 means that the
>>> + * request should be allowed.
>>> + */
>>> +int __io_uring_run_bpf_filters(struct io_restriction *res, struct io_kiocb *req)
>>> +{
>>
>> That comment seems to contradict the actual logic in this function, as
>> well as the example BPF program in the cover letter. So
>> s/allowed/blocked/?
>
> Are you talking about __io_uring_run_bpf_filters() or the filters
> themselves? For the former, 0 does indeed mean "yep let it rip", for the
> filters it's 0/1 where 0 is deny and 1 is allow. I should probably make
> the comment more explicit on that front...
Ah, yes, I got confused between the two, sorry for the noise.
jon
next prev parent reply other threads:[~2026-01-15 21:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-15 16:36 [PATCHSET RFC v3] Inherited restrictions and BPF filtering Jens Axboe
2026-01-15 16:36 ` [PATCH 1/3] io_uring: move ctx->restrictions to be dynamically allocated Jens Axboe
2026-01-15 16:36 ` [PATCH 2/3] io_uring: add support for BPF filtering for opcode restrictions Jens Axboe
2026-01-15 20:11 ` Jonathan Corbet
2026-01-15 21:02 ` Jens Axboe
2026-01-15 21:05 ` Jonathan Corbet [this message]
2026-01-15 21:08 ` Jens Axboe
2026-01-15 16:36 ` [PATCH 3/3] io_uring: allow registration of per-task restrictions Jens Axboe
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=87h5smr3hi.fsf@trenco.lwn.net \
--to=corbet@lwn.net \
--cc=axboe@kernel.dk \
--cc=io-uring@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