Skip to contentSkip to conversation

Patch "l2tp: check ps->sock before running pppol2tp_session_ioctl()" has been added to the 3.18-stable tree

PATCH [email protected] 1 participant 1 message Nov 16, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

    l2tp: check ps->sock before running pppol2tp_session_ioctl()

to the 3.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
l2tp-check-ps-sock-before-running-pppol2tp_session_ioctl.patch
and it can be found in the queue-3.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Thu Nov 16 15:48:06 CET 2017

From: Guillaume Nault <[email protected]>
Date: Fri, 13 Oct 2017 19:22:35 +0200
Subject: l2tp: check ps->sock before running pppol2tp_session_ioctl()

From: Guillaume Nault <[email protected]>

[ Upstream commit 5903f594935a3841137c86b9d5b75143a5b7121c ]

When pppol2tp_session_ioctl() is called by pppol2tp_tunnel_ioctl(), the session may be unconnected. That is, it was created by pppol2tp_session_create() and hasn't been connected with pppol2tp_connect(). In this case, ps->sock is NULL, so we need to check for this case in order to avoid dereferencing a NULL pointer.

Fixes 309795f4bec2 ("l2tp: Add netlink control API for L2TP")
---
 net/l2tp/l2tp_ppp.c |    3 +++
 1 file changed, 3 insertions(+)
net/l2tp/l2tp_ppp.c +3 -0
@@ -1017,6 +1017,9 @@ static int pppol2tp_session_ioctl(struct
 		 session->name, cmd, arg);
 
 	sk = ps->sock;
+	if (!sk)
+		return -EBADR;
+
 	sock_hold(sk);
 
 	switch (cmd) {

Patches currently in stable-queue which might be from [email protected] are

queue-3.18/l2tp-check-ps-sock-before-running-pppol2tp_session_ioctl.patch