OSDN Git Service

can: rx-offload: can_rx_offload_offload_one(): do not increase the skb_queue beyond...
authorMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 9 Oct 2019 14:03:18 +0000 (16:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 08:19:42 +0000 (09:19 +0100)
commitb83d4e4899d647bab00e1f5f544a8e4900120a7d
tree0173ea9498c4a0e156761e83e717ac2b1fcd8323
parent77f94f0d7f523691b9b677e1f683ad7d01640d60
can: rx-offload: can_rx_offload_offload_one(): do not increase the skb_queue beyond skb_queue_len_max

[ Upstream commit a2dc3f5e1022a5ede8af9ab89a144f1e69db8636 ]

The skb_queue is a linked list, holding the skb to be processed in the
next NAPI call.

Without this patch, the queue length in can_rx_offload_offload_one() is
limited to skb_queue_len_max + 1. As the skb_queue is a linked list, no
array or other resources are accessed out-of-bound, however this
behaviour is counterintuitive.

This patch limits the rx-offload skb_queue length to skb_queue_len_max.

Fixes: d254586c3453 ("can: rx-offload: Add support for HW fifo based irq offloading")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/can/rx-offload.c