Netdev List
 help / color / mirror / Atom feed
* [PATCH net 0/2] l2tp: session creation fixes
@ 2017-09-01 15:58 Guillaume Nault
  2017-09-01 15:58 ` [PATCH net 1/2] l2tp: prevent creation of sessions on terminated tunnels Guillaume Nault
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Guillaume Nault @ 2017-09-01 15:58 UTC (permalink / raw)
  To: netdev; +Cc: James Chapman

The session creation process has a few issues wrt. concurrent tunnel
deletion.

Patch #1 avoids creating sessions in tunnels that are getting removed.
This prevents races where sessions could try to take tunnel resources
that were already released.

Patch #2 removes some racy l2tp_tunnel_find() calls in session creation
callbacks. Together with path #1 it ensures that sessions can only
access tunnel resources that are guaranteed to remain valid during the
session creation process.


There are other problems with how sessions are created: pseudo-wire
specific data are set after the session is added to the tunnel. So
the session can be used, or deleted, before it has been completely
initialised. Separating session allocation from session registration
would be necessary, but we'd still have circular dependencies
preventing race-free registration. I'll consider this issue in future
series.


Guillaume Nault (2):
  l2tp: prevent creation of sessions on terminated tunnels
  l2tp: pass tunnel pointer to ->session_create()

 net/l2tp/l2tp_core.c    | 41 ++++++++++++++++++++++++++++-------------
 net/l2tp/l2tp_core.h    |  8 +++++++-
 net/l2tp/l2tp_eth.c     | 11 +++--------
 net/l2tp/l2tp_netlink.c |  8 ++++----
 net/l2tp/l2tp_ppp.c     | 19 +++++++------------
 5 files changed, 49 insertions(+), 38 deletions(-)

-- 
2.14.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-03 18:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-01 15:58 [PATCH net 0/2] l2tp: session creation fixes Guillaume Nault
2017-09-01 15:58 ` [PATCH net 1/2] l2tp: prevent creation of sessions on terminated tunnels Guillaume Nault
2017-09-01 15:58 ` [PATCH net 2/2] l2tp: pass tunnel pointer to ->session_create() Guillaume Nault
2017-09-03 18:04 ` [PATCH net 0/2] l2tp: session creation fixes David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox