pf: don't panic on missing mtag Somewhat similar to the previous fix, but specifically tailored for ALTQ and not generally hogging system resources... for more details ping Franco Fichtner @OPNsense
https://github.com/opnsense/src/commit/6cec1085278c191c5fca3c5c77048e963e6854e7 https://github.com/HardenedBSD/hardenedBSD-playground/commit/6c36a040d282d333c3c40434a462a07f4c118f64
The patches referenced don't look like patches to FreeBSD head or stable/10. There is no pd.act.qid in FreeBSD pf. Can you please better explain the problem?
Please ignore the first commit, it is based on 10.1-RELENG. The second patch is for 10-STABLE. The problem still stands: if pf_get_mtag() fails, in those instances NULL is dereferenced.
I've found the context and the problem. Thanks.
A commit references this bug: Author: glebius Date: Mon May 18 15:05:13 UTC 2015 New revision: 283061 URL: https://svnweb.freebsd.org/changeset/base/283061 Log: Don't dereference NULL is pf_get_mtag() fails. PR: 200222 Submitted by: Franco Fichtner <franco opnsense.org> Changes: head/sys/netpfil/pf/pf.c
Thanks. Is this also going to get backported to 10-STABLE?
Should be, if I don't forget :)
Seems like you missed one part of the patch at there: https://github.com/HardenedBSD/hardenedBSD-playground/commit/6c36a040d282d333c3c40434a462a07f4c118f64#diff-4f594011be0477d0b5f594cd00a64245R5919 . See there: https://github.com/freebsd/freebsd/blob/af369a5484f0ba2dd39bbe4b1e3566e14f23bb4e/sys/netpfil/pf/pf.c#L5953
Thanks, Oliver!
A commit references this bug: Author: glebius Date: Mon May 18 15:51:28 UTC 2015 New revision: 283063 URL: https://svnweb.freebsd.org/changeset/base/283063 Log: A miss from r283061: don't dereference NULL is pf_get_mtag() fails. PR: 200222 Submitted by: Franco Fichtner <franco opnsense.org> Changes: head/sys/netpfil/pf/pf.c
Gleb, could you please MFC this change to 10-STABLE before the 10.2-RELEASE is out?
Yes, let's get this into stable/10. :)
A MFC in time for 10.2 would be awesome. :)
No need to CC me, I read RE email.
A commit references this bug: Author: glebius Date: Tue Jul 28 09:16:55 UTC 2015 New revision: 285941 URL: https://svnweb.freebsd.org/changeset/base/285941 Log: Merge r283061, r283063: don't dereference NULL is pf_get_mtag() fails. PR: 200222 Changes: _U stable/10/ stable/10/sys/netpfil/pf/pf.c
A commit references this bug: Author: glebius Date: Wed Jul 29 14:16:27 UTC 2015 New revision: 286014 URL: https://svnweb.freebsd.org/changeset/base/286014 Log: Merge r285939-285941,285943,286004 from stable/10: - Protect against ioctl() vs ioctl() races. - Always lock hash row of a source node when updating its 'states' counter. [1] - Don't dereference NULL is pf_get_mtag() fails. [2] - During module unload drop locks before destroying UMA zone. PR: 182401 [1] PR: 200222 [2] Approved by: re (gjb) Changes: _U releng/10.2/ releng/10.2/sys/net/pfvar.h releng/10.2/sys/netpfil/pf/pf.c releng/10.2/sys/netpfil/pf/pf_ioctl.c