diff --git a/net/can/isotp.c b/net/can/isotp.c index f5dc9d04bd68..d3e43ab48425 100644 --- a/net/can/isotp.c +++ b/net/can/isotp.c @@ -755,6 +755,14 @@ static void isotp_rcv(struct sk_buff *skb, void *data) if (skb->len != so->ll.mtu) return; + /* check for correct CAN CC/FD frame content */ + if (so->ll.mtu == CAN_MTU) { + if (!can_is_can_skb(skb)) + return; + } else if (!can_is_canfd_skb(skb)) { + return; + } + cf = (struct canfd_frame *)skb->data; /* if enabled: check reception of my configured extended address */