]> asedeno.scripts.mit.edu Git - linux.git/commit
Merge branch 'l2tp-register-sessions-atomically'
authorDavid S. Miller <davem@davemloft.net>
Sun, 29 Oct 2017 02:16:22 +0000 (11:16 +0900)
committerDavid S. Miller <davem@davemloft.net>
Sun, 29 Oct 2017 02:16:22 +0000 (11:16 +0900)
commit05ce8bd43f3bd62996a4a70a6f3494a66ace11ca
tree15c9f5a889bd1f822b83fcff9152df5b43334a3c
parent949cf8b1dd39f6d306a681503b6031299fd7ced8
parentf98be6c6359e7e4a61aaefb9964c1db31cb9ec0c
Merge branch 'l2tp-register-sessions-atomically'

Guillaume Nault says:

====================
l2tp: register sessions atomically

Currently l2tp_session_create() allocates a session, partially
initialises it and finally registers it. It therefore exposes sessions
that aren't fully initialised to the rest of the system, because
pseudo-wire specific initialisation can only happen after
l2tp_session_create() returns.
This leads to several crashes when these sessions are used or deleted.

This series starts by splitting session registration out of
l2tp_session_create() (patch #1). Thus allowing pseudo-wires code to
terminate the initialisation phase before registration.

Then patch #2 fixes the eth pseudo-wire code. This requires protecting
the session's netdevice pointer with RCU, because it still needs to be
updated concurrently after the session got registered.

Remaining patches take care of ppp pseudo-wires. RCU protection is
needed there too, for the same reasons. This time it's the pppol2tp
socket pointer that gets protected. For clarity, and since the
conversion requires more modifications, introducing RCU is done in
its own patch (#3). Then patch #4 only has to take care of fixing
sessions initialisation and registration (and adapting part of the
deletion process).
====================

Signed-off-by: David S. Miller <davem@davemloft.net>