]> git.baikalelectronics.ru Git - kernel.git/commit
ppp: fix pppoe_dev deletion condition in pppoe_release()
authorGuillaume Nault <g.nault@alphalink.fr>
Thu, 22 Oct 2015 14:57:10 +0000 (16:57 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 23 Oct 2015 10:30:01 +0000 (03:30 -0700)
commit14c45c543326cdb97a23564e503025dfc5114cf6
tree095cebc2ead8abbaa4165a650b5997da39911285
parent6b59d7e5e62787298a2fa87223ca8a9882b22961
ppp: fix pppoe_dev deletion condition in pppoe_release()

We can't rely on PPPOX_ZOMBIE to decide whether to clear po->pppoe_dev.
PPPOX_ZOMBIE can be set by pppoe_disc_rcv() even when po->pppoe_dev is
NULL. So we have no guarantee that (sk->sk_state & PPPOX_ZOMBIE) implies
(po->pppoe_dev != NULL).
Since we're releasing a PPPoE socket, we want to release the pppoe_dev
if it exists and reset sk_state to PPPOX_DEAD, no matter the previous
value of sk_state. So we can just check for po->pppoe_dev and avoid any
assumption on sk->sk_state.

Fixes: d67c08dd08c3 ("pppoe: drop PPPOX_ZOMBIEs in pppoe_release")
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ppp/pppoe.c