From: Willem de Bruijn Date: Fri, 7 Jun 2019 20:46:07 +0000 (-0400) Subject: can: purge socket error queue on sock destruct X-Git-Tag: v4.19.56~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5ad9a23e6daef31c23895c5a0d8f0bc1fb4f69f6;p=thirdparty%2Fkernel%2Fstable.git can: purge socket error queue on sock destruct commit fd704bd5ee749d560e86c4f1fd2ef486d8abf7cf upstream. 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 Cc: linux-stable Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/can/af_can.c b/net/can/af_can.c index 1684ba5b51eb6..e386d654116dd 100644 --- a/net/can/af_can.c +++ b/net/can/af_can.c @@ -105,6 +105,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)