io_uring/net: allow filtering on IORING_OP_CONNECT
authorShouvik Kar <auxcorelabs@gmail.com>
Tue, 12 May 2026 11:02:42 +0000 (16:32 +0530)
committerJens Axboe <axboe@kernel.dk>
Thu, 14 May 2026 13:23:01 +0000 (07:23 -0600)
commit899bea8248cee35d54760a5e7d61a76af8e64411
tree58dee729a3cfbfa802084725e726cdd5b7703c39
parentc84701cfc90a90a6a9dfbdb138706a6d79f5b186
io_uring/net: allow filtering on IORING_OP_CONNECT

This adds custom filtering for IORING_OP_CONNECT, where the target
family is always exposed, and (for AF_INET / AF_INET6) port and
address are exposed. port and v4_addr are in network byte order so
filter authors can compare against on-wire constants.

Skip population unless addr_len covers the populated fields, to
avoid leaking stale io_async_msghdr data on short connects.

Signed-off-by: Shouvik Kar <auxcorelabs@gmail.com>
Link: https://patch.msgid.link/20260512110242.26219-1-auxcorelabs@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/uapi/linux/io_uring/bpf_filter.h
io_uring/net.c
io_uring/net.h
io_uring/opdef.c