mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-01 10:45:49 +00:00
l2tp: fix missing refcount drop in pppol2tp_tunnel_ioctl()
If 'session' is not NULL and is not a PPP pseudo-wire, then we fail to
drop the reference taken by l2tp_session_get().
Fixes: ecd012e45a
("l2tp: filter out non-PPP sessions in pppol2tp_tunnel_ioctl()")
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
60a01828f3
commit
f664e37dcc
@ -1201,13 +1201,18 @@ static int pppol2tp_tunnel_ioctl(struct l2tp_tunnel *tunnel,
|
||||
l2tp_session_get(sock_net(sk), tunnel,
|
||||
stats.session_id);
|
||||
|
||||
if (session && session->pwtype == L2TP_PWTYPE_PPP) {
|
||||
err = pppol2tp_session_ioctl(session, cmd,
|
||||
arg);
|
||||
l2tp_session_dec_refcount(session);
|
||||
} else {
|
||||
if (!session) {
|
||||
err = -EBADR;
|
||||
break;
|
||||
}
|
||||
if (session->pwtype != L2TP_PWTYPE_PPP) {
|
||||
l2tp_session_dec_refcount(session);
|
||||
err = -EBADR;
|
||||
break;
|
||||
}
|
||||
|
||||
err = pppol2tp_session_ioctl(session, cmd, arg);
|
||||
l2tp_session_dec_refcount(session);
|
||||
break;
|
||||
}
|
||||
#ifdef CONFIG_XFRM
|
||||
|
Loading…
Reference in New Issue
Block a user