net: qualcomm: rmnet: Skip processing loopback packets
authorSean Tranchetti <stranche@codeaurora.org>
Wed, 3 Oct 2018 00:52:01 +0000 (18:52 -0600)
committerDavid S. Miller <davem@davemloft.net>
Wed, 3 Oct 2018 05:16:00 +0000 (22:16 -0700)
RMNET RX handler was processing invalid packets that were
originally sent on the real device and were looped back via
dev_loopback_xmit(). This was detected using syzkaller.

Fixes: ceed73a2cf4a ("drivers: net: ethernet: qualcomm: rmnet: Initial implementation")
Signed-off-by: Sean Tranchetti <stranche@codeaurora.org>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c

index 7fd86d40a3374df1fba991ece10e6ec48bc197e1..6908b26feb9ed58113116365675258ee267441da 100644 (file)
@@ -189,6 +189,9 @@ rx_handler_result_t rmnet_rx_handler(struct sk_buff **pskb)
        if (!skb)
                goto done;
 
+       if (skb->pkt_type == PACKET_LOOPBACK)
+               return RX_HANDLER_PASS;
+
        dev = skb->dev;
        port = rmnet_get_port(dev);