]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r346319:
authorkp <kp@FreeBSD.org>
Wed, 24 Apr 2019 14:08:16 +0000 (14:08 +0000)
committerkp <kp@FreeBSD.org>
Wed, 24 Apr 2019 14:08:16 +0000 (14:08 +0000)
commit39f99c05c46f525ee99285198fd014df1afd08d7
treee9b9b166e45593ad6a44465eae60977854575327
parent6b4d40385ef4cff34079ed25e5294dcf0125945a
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