Page MenuHomeFreeBSD

pf: Improve ioctl validation for DIOCRADDTABLES and DIOCRDELTABLES
AbandonedPublic

Authored by kp on Mar 26 2018, 9:50 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Sep 13, 9:30 PM
Unknown Object (File)
Sun, Sep 13, 5:09 PM
Unknown Object (File)
Sat, Aug 22, 11:27 AM
Unknown Object (File)
Aug 21 2026, 11:59 AM
Unknown Object (File)
Aug 20 2026, 8:49 PM
Unknown Object (File)
Aug 10 2026, 9:16 AM
Unknown Object (File)
Aug 10 2026, 6:32 AM
Unknown Object (File)
Jul 10 2026, 4:10 PM

Details

Reviewers
None
Group Reviewers
network
Summary

The DIOCRADDTABLES and DIOCRDELTABLES ioctls can process a number of
tables at a time, and as such try to allocate <number of tables> *
sizeof(struct pfr_table). This multiplication can overflow. Thanks to
mallocarray() this is not exploitable, but an overflow does panic the
system.

Arbitrarily limit this to 65535 tables. pfctl only ever processes one
table at a time, so it presents no issues there.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 15815