Page MenuHomeFreeBSD

bpf: calculate net.bpf.stats buffer size dynamically
ClosedPublic

Authored by glebius on Nov 21 2025, 10:56 PM.
Tags
None
Referenced Files
F153175936: D53868.diff
Sun, Apr 19, 3:08 PM
F153124625: D53868.id.diff
Sun, Apr 19, 8:13 AM
Unknown Object (File)
Mon, Apr 13, 8:36 PM
Unknown Object (File)
Sat, Apr 11, 1:38 PM
Unknown Object (File)
Sat, Apr 4, 9:28 AM
Unknown Object (File)
Wed, Apr 1, 4:55 AM
Unknown Object (File)
Sat, Mar 28, 8:48 AM
Unknown Object (File)
Thu, Mar 26, 7:24 PM

Details

Summary

This removed the global counter, that was updated in a racy manner.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 68836
Build 65719: arc lint + arc unit

Event Timeline

markj added inline comments.
sys/net/bpf.c
3091

Why not allocate bpfd_cnt * sizeof(*xbd) bytes instead? req->oldlen is not clamped, I believe, so userspace can request any allocation size they want.

markj added inline comments.
sys/net/bpf.c
3094

To be useful, this assertion should be inside the inner loops below.

This revision is now accepted and ready to land.Nov 25 2025, 2:00 PM