summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoic Poulain <loic.poulain@linaro.org>2021-02-02 16:44:03 +0100
committerLoic Poulain <loic.poulain@linaro.org>2021-02-04 10:43:11 +0100
commit751fc06dd6ca3abce4899eacbbf1a9fe6da3d26a (patch)
tree544e1afcf5d04fa1c7d196c0d88e5a02ff904edf
parent405b488f9d22fd374a0628f92579b81b90c44671 (diff)
net: qualcomm: rmnet: Fix rx_handler for non-linear skbs
There is no guarantee that rmnet rx_handler is only fed with linear skbs, but current rmnet implementation does not check that, leading to crash in case of non linear skbs processed as linear ones. Fix that by ensuring skb linearization before processing. Signed-off-by: Loic Poulain <loic.poulain@linaro.org> Acked-by: Willem de Bruijn <willemb@google.com> Reviewed-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
-rw-r--r--drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
index 3d7d3ab383f8..3d00b3232308 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
@@ -183,6 +183,11 @@ rx_handler_result_t rmnet_rx_handler(struct sk_buff **pskb)
if (!skb)
goto done;
+ if (skb_linearize(skb)) {
+ kfree_skb(skb);
+ goto done;
+ }
+
if (skb->pkt_type == PACKET_LOOPBACK)
return RX_HANDLER_PASS;