]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r346319:
authorKristof Provost <kp@FreeBSD.org>
Wed, 24 Apr 2019 14:08:14 +0000 (14:08 +0000)
committerKristof Provost <kp@FreeBSD.org>
Wed, 24 Apr 2019 14:08:14 +0000 (14:08 +0000)
commit0893d1c2b79bc1609841ecea85a0ed2dd9a72cfa
treecbd6a497a76089c939ea2780750e1464784c8d94
parentea204bf0af358bde647b3f882238ce4a17b42826
MFC r346319:

pf: Fix panic on invalid DIOCRSETTFLAGS

If during DIOCRSETTFLAGS pfrio_buffer is NULL copyin() will fault, which we're
not allowed to do with a lock held.
We must count the number of entries in the table and release the lock during
copyin(). Only then can we re-acquire the lock. Note that this is safe, because
pfr_set_tflags() will check if the table and entries exist.

This was discovered by a local syzcaller instance.
sys/netpfil/pf/pf_ioctl.c