CVSROOT:        /cvs
Module name:    src
Changes by:     d...@cvs.openbsd.org    2014/10/16 18:47:48

Modified files:
        sys/net        : if_pfsync.c 

Log message:
reset all the pfsync packet state before calling ip_output in
pfsync_sendout. more specifically, move the reset of sc->sc_len to
PFSYNC_MINPKT above ip_output.

this prevents a situation where ipsec via ip_output calls
pfsync_update_tdb for syncing the ipsec flow to a peer, which
accounts for the tdb in the next pfsync packet, before unwinding
back to pfsync_output which resets the accounting we just did.

the next pfsync packet to be sent out will be allocated with a short
length because sc_len is wrong, and the long lists of things (eg,
the tdb) can overwrite memory after the mbuf. this manifests as
incorrect poisoning or xsimpleq entry corruption in mbufs still in
a pool, or random corruption of m->m_next on other mbufs in the
system.

bug found, fix tested, and ok stsp@

Reply via email to