Skip to content

l2tp: fix some l2tp_tunnel_find() issues in l2tp_netlink

Guillaume Nault netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5l2tp: hold tunnel while looking up sessions in l2tp_netlinknet/l2tp/l2tp_core.c net/l2tp/l2tp_core.h net/l2tp/l2tp_netlink.c+38 -470 replies
2/5l2tp: hold tunnel while processing genl delete commandnet/l2tp/l2tp_netlink.c+4 -20 replies
3/5l2tp: hold tunnel while handling genl tunnel updatesnet/l2tp/l2tp_netlink.c+4 -20 replies
4/5l2tp: hold tunnel while handling genl TUNNEL_GET commandsnet/l2tp/l2tp_netlink.c+15 -120 replies
5/5l2tp: hold tunnel used while creating sessions with netlinknet/l2tp/l2tp_netlink.c+12 -90 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net 0/5] l2tp: fix some l2tp_tunnel_find() issues in l2tp_netlink

Since l2tp_tunnel_find() doesn't take a reference on the tunnel it returns, its users are almost guaranteed to be racy.

This series defines l2tp_tunnel_get() which can be used as a safe replacement, and converts some of l2tp_tunnel_find() users in the l2tp_netlink module.

Other users often combine this issue with other more or less subtle races. They will be fixed incrementally in followup series.

Guillaume Nault (5):
l2tp: hold tunnel while looking up sessions in l2tp_netlink
l2tp: hold tunnel while processing genl delete command
l2tp: hold tunnel while handling genl tunnel updates
l2tp: hold tunnel while handling genl TUNNEL_GET commands
l2tp: hold tunnel used while creating sessions with netlink

 net/l2tp/l2tp_core.c    | 66 ++++++++++++++++---------------------------------
 net/l2tp/l2tp_core.h    | 13 ++++++++++
 net/l2tp/l2tp_netlink.c | 66 +++++++++++++++++++++++++++++--------------------
 3 files changed, 73 insertions(+), 72 deletions(-)
Signature · 1 line
2.14.1