HomeFreeBSD

pf: Improve input validation

Description

pf: Improve input validation

If we pass an anchor name which doesn't exist pfr_table_count() returns
-1, which leads to an overflow in mallocarray() and thus a panic.

Explicitly check that pfr_table_count() does not return an error.

Reported-by: syzbot+bd09d55d897d63d5f4f4@syzkaller.appspotmail.com
Reviewed by: melifaro
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24539

Details

Provenance
kpAuthored on Apr 26 2020, 4:16 PM
Parents
rGdb20acc02990: mac_bsdextended: ATFify the tests
Branches
Unknown
Tags
Unknown

Event Timeline