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
F161578634: D53868.id167508.diff
Sun, Jul 5, 1:07 AM
F161555433: D53868.diff
Sat, Jul 4, 8:16 PM
Unknown Object (File)
Thu, Jul 2, 9:30 PM
Unknown Object (File)
Thu, Jul 2, 9:30 PM
Unknown Object (File)
Thu, Jun 25, 10:08 AM
Unknown Object (File)
Sat, Jun 20, 12:11 PM
Unknown Object (File)
Sat, Jun 20, 8:35 AM
Unknown Object (File)
Wed, Jun 17, 2:43 AM

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