public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] CAN: make checking in can_rcv less restrictive
@ 2009-08-06 15:24 Luotao Fu
  2009-08-06 16:48 ` [Socketcan-users] " Oliver Hartkopp
  0 siblings, 1 reply; 6+ messages in thread
From: Luotao Fu @ 2009-08-06 15:24 UTC (permalink / raw)
  To: socketcan-users; +Cc: linux-kernel, Michael Olbrich, Luotao Fu

From: Michael Olbrich <m.olbrich@pengutronix.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@pengutronix.de>
Signed-off-by: Luotao Fu <l.fu@pengutronix.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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-08-07  4:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-06 15:24 [PATCH] CAN: make checking in can_rcv less restrictive Luotao Fu
2009-08-06 16:48 ` [Socketcan-users] " Oliver Hartkopp
2009-08-06 20:17   ` Luotao Fu
2009-08-06 20:58     ` Oliver Hartkopp
2009-08-06 21:02     ` Luotao Fu
2009-08-07  4:08       ` Oliver Hartkopp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox