summaryrefslogtreecommitdiff
path: root/io_uring/openclose.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2026-01-19 15:59:54 -0700
committerJens Axboe <axboe@kernel.dk>2026-01-27 11:10:46 -0700
commit8768770cf5d76d177fa2200e6957a372e61e06b5 (patch)
treef903ed9cbf90e98fea990a8deff079cd1f3d0e03 /io_uring/openclose.c
parentcff1c26b4223820431129696b45525e5928e6409 (diff)
io_uring/bpf_filter: allow filtering on contents of struct open_how
This adds custom filtering for IORING_OP_OPENAT and IORING_OP_OPENAT2, where the open_how flags, mode, and resolve can be checked by filters. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/openclose.c')
-rw-r--r--io_uring/openclose.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/io_uring/openclose.c b/io_uring/openclose.c
index 15dde9bd6ff6..31c687adf873 100644
--- a/io_uring/openclose.c
+++ b/io_uring/openclose.c
@@ -85,6 +85,15 @@ static int __io_openat_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe
return 0;
}
+void io_openat_bpf_populate(struct io_uring_bpf_ctx *bctx, struct io_kiocb *req)
+{
+ struct io_open *open = io_kiocb_to_cmd(req, struct io_open);
+
+ bctx->open.flags = open->how.flags;
+ bctx->open.mode = open->how.mode;
+ bctx->open.resolve = open->how.resolve;
+}
+
int io_openat_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
{
struct io_open *open = io_kiocb_to_cmd(req, struct io_open);