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
Reviewer
melifaro
Differential Revision
D24539: pf: Improve input validation
Parents
rS360343: MFC r360098:
Branches
Unknown
Tags
Unknown