summaryrefslogtreecommitdiff
path: root/net/can/af_can.c
diff options
context:
space:
mode:
authorWillem de Bruijn <willemb@google.com>2019-06-07 23:46:07 +0300
committerMarc Kleine-Budde <mkl@pengutronix.de>2019-06-08 00:03:54 +0300
commitfd704bd5ee749d560e86c4f1fd2ef486d8abf7cf (patch)
treea71e9064d8d61e0a9f066517445e2dea92f736d7 /net/can/af_can.c
parenteb503004a7e563d543c9cb869907156de7efe720 (diff)
downloadlinux-fd704bd5ee749d560e86c4f1fd2ef486d8abf7cf.tar.xz
can: purge socket error queue on sock destruct
CAN supports software tx timestamps as of the below commit. Purge any queued timestamp packets on socket destroy. Fixes: 51f31cabe3ce ("ip: support for TX timestamps on UDP and RAW sockets") Reported-by: syzbot+a90604060cb40f5bdd16@syzkaller.appspotmail.com Signed-off-by: Willem de Bruijn <willemb@google.com> Cc: linux-stable <stable@vger.kernel.org> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'net/can/af_can.c')
-rw-r--r--net/can/af_can.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/can/af_can.c b/net/can/af_can.c
index 743470680127..80281ef2ccbd 100644
--- a/net/can/af_can.c
+++ b/net/can/af_can.c
@@ -99,6 +99,7 @@ EXPORT_SYMBOL(can_ioctl);
static void can_sock_destruct(struct sock *sk)
{
skb_queue_purge(&sk->sk_receive_queue);
+ skb_queue_purge(&sk->sk_error_queue);
}
static const struct can_proto *can_get_proto(int protocol)