diff options
author | Loic Poulain <loic.poulain@linaro.org> | 2021-02-04 09:40:01 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-02-06 11:28:45 -0800 |
commit | d698e6a00a6092381f2966ac5410ac2dbcce88bc (patch) | |
tree | 5dc7ea2db11a9c934780106f703f46072d7bd428 /drivers/net/ethernet/qualcomm/rmnet | |
parent | a64566a22b6a943105b01f47e8ae97779cab1417 (diff) | |
download | linux-stable-d698e6a00a6092381f2966ac5410ac2dbcce88bc.tar.gz linux-stable-d698e6a00a6092381f2966ac5410ac2dbcce88bc.tar.bz2 linux-stable-d698e6a00a6092381f2966ac5410ac2dbcce88bc.zip |
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>
Link: https://lore.kernel.org/r/1612428002-12333-2-git-send-email-loic.poulain@linaro.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/qualcomm/rmnet')
-rw-r--r-- | drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c | 5 |
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; |