]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
ng_l2tp: Fix callout synchronization in the rexmit timeout handler
authormarkj <markj@FreeBSD.org>
Fri, 25 Sep 2020 18:55:50 +0000 (18:55 +0000)
committermarkj <markj@FreeBSD.org>
Fri, 25 Sep 2020 18:55:50 +0000 (18:55 +0000)
commit5651b6d546d118511ec3f8701a526774b6d2634c
treefb769d05b545379263cc838d21dd72abcd5c651a
parenta77406aac7c36aca246b44d7c1efc3f3d39e498a
ng_l2tp: Fix callout synchronization in the rexmit timeout handler

A received control packet may cause the transmit queue to be flushed, in
which case ng_l2tp_seq_recv_nr() cancels the transmit timeout handler.
The handler checks to see if it was cancelled before doing anything, but
did so before acquiring the node lock, so a small race window could
cause ng_l2tp_seq_rack_timeout() to attempt to flush an empty queue,
ultimately causing a null pointer dereference.

PR: 241133
Reviewed by: bz, glebius, Lutz Donnerhacke
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC (Netgate)
Differential Revision: https://reviews.freebsd.org/D26548
sys/netgraph/ng_l2tp.c