[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1249572295-7801-1-git-send-email-l.fu@pengutronix.de>
Date: Thu, 6 Aug 2009 17:24:55 +0200
From: Luotao Fu <l.fu@...gutronix.de>
To: socketcan-users@...ts.berlios.de
Cc: linux-kernel@...r.kernel.org,
Michael Olbrich <m.olbrich@...gutronix.de>,
Luotao Fu <l.fu@...gutronix.de>
Subject: [PATCH] CAN: make checking in can_rcv less restrictive
From: Michael Olbrich <m.olbrich@...gutronix.de>
Checking for can frame format in can_rcv() is too restrictive. BUG_ON is way too
heavy for the case that the can interface probably received a can frame with
malicious format. Further it can be used for DDOS attack since BUG_ON can lead
to kernel panic. Hence we turn this to WARN_ON instead.
Signed-off-by: Michael Olbrich <m.olbrich@...gutronix.de>
Signed-off-by: Luotao Fu <l.fu@...gutronix.de>
---
net/can/af_can.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/can/af_can.c b/net/can/af_can.c
index e733725..e6dcf4b 100644
--- a/net/can/af_can.c
+++ b/net/can/af_can.c
@@ -656,7 +656,7 @@ static int can_rcv(struct sk_buff *skb, struct net_device *dev,
return 0;
}
- BUG_ON(skb->len != sizeof(struct can_frame) || cf->can_dlc > 8);
+ WARN_ON(skb->len != sizeof(struct can_frame) || cf->can_dlc > 8);
/* update statistics */
can_stats.rx_frames++;
--
1.6.3.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists