Page MenuHomeFreeBSD

pf: Fix a lock leak in pf_ioctl_addrule()
ClosedPublic

Authored by markj on Sun, Jul 27, 1:26 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Aug 21, 2:54 AM
Unknown Object (File)
Thu, Aug 21, 2:51 AM
Unknown Object (File)
Wed, Aug 13, 1:45 AM
Unknown Object (File)
Mon, Jul 28, 7:10 PM
Unknown Object (File)
Mon, Jul 28, 3:43 PM
Unknown Object (File)
Mon, Jul 28, 2:35 PM
Unknown Object (File)
Mon, Jul 28, 6:58 AM
Unknown Object (File)
Mon, Jul 28, 4:14 AM

Details

Summary

The ERROUT macro assumes that the rules lock is held, but some error
paths arise before that lock is acquired. Introduce ERROUT_UNLOCKED for
that case.

Reported by: syzkaller
Fixes: cc68decda316 ("pf: Reject rules with invalid port ranges")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 65769
Build 62652: arc lint + arc unit

Event Timeline

markj requested review of this revision.Sun, Jul 27, 1:26 PM
kp added inline comments.
sys/netpfil/pf/pf_ioctl.c
2296

We should probably #undef ERROUT_UNLOCKED here.
It doesn't matter now, but if we ever use it in another function we'll have to. We may as well do it now.

This revision is now accepted and ready to land.Mon, Jul 28, 3:36 PM
This revision was automatically updated to reflect the committed changes.