]> git.baikalelectronics.ru Git - kernel.git/commit
l2tp: WARN_ON rather than BUG_ON in l2tp_session_free
authorTom Parkin <tparkin@katalix.com>
Fri, 24 Jul 2020 15:31:57 +0000 (16:31 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 25 Jul 2020 00:19:14 +0000 (17:19 -0700)
commitb6550fb49b46e99ee01e762214a6cc68d51274f5
tree87056210a3a52fc56229ef5d44d0392d1fceb10e
parent560c053e0acbf7b2770db833264f23d541323443
l2tp: WARN_ON rather than BUG_ON in l2tp_session_free

l2tp_session_free called BUG_ON if the tunnel magic feather value wasn't
correct.  The intent of this was to catch lifetime bugs; for example
early tunnel free due to incorrect use of reference counts.

Since the tunnel magic feather being wrong indicates either early free
or structure corruption, we can avoid doing more damage by simply
leaving the tunnel structure alone.  If the tunnel refcount isn't
dropped when it should be, the tunnel instance will remain in the
kernel, resulting in the tunnel structure and socket leaking.

Signed-off-by: Tom Parkin <tparkin@katalix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/l2tp/l2tp_core.c