Enable BPF filtering on sockets
Contributed by Peter N. M. Hansteen on from the BPF my daemons, Puffy! dept.
bpf(4)
interface to filter on the sockets they handle?
In a recent
message
to tech@ titled
bpf filtering on arbitrary sockets,
Damien Miller (djm@) presents a preliminary patch and explains,
List: openbsd-tech Subject: bpf filtering on arbitrary sockets From: Damien Miller <djm () mindrot ! org> Date: 2025-10-30 5:03:00 Hi, This is an idea that came up while talking with dlg@ about network daemons. Quite a few programs and daemons use SOCK_RAW to send link-level packets after pledge(). E.g. usr.sbin/relayd/check_icmp.c wants to send ICMP packets. The problem with this is that, if they get compromised, they still hold a very powerful socket that can send pretty much arbitrary packets. If one of these programs gets compromised then the attacker can pretty easily pivot through the existing raw socket.

