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)
Feb 19 2024, 4:05 PM
Unknown Object (File)
Dec 23 2023, 3:14 AM
Unknown Object (File)
Aug 14 2023, 12:23 AM
Unknown Object (File)
Jun 28 2023, 7:49 AM
Unknown Object (File)
Jun 26 2023, 10:58 PM
Unknown Object (File)
Jun 15 2023, 6:55 PM
Unknown Object (File)
Dec 26 2022, 4:17 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