mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Luotao Fu <l.fu@pengutronix.de>
To: socketcan-users@lists.berlios.de
Cc: linux-kernel@vger.kernel.org,
	Michael Olbrich <m.olbrich@pengutronix.de>,
	Luotao Fu <l.fu@pengutronix.de>
Subject: [PATCH] CAN: make checking in can_rcv less restrictive
Date: Thu,  6 Aug 2009 17:24:55 +0200	[thread overview]
Message-ID: <1249572295-7801-1-git-send-email-l.fu@pengutronix.de> (raw)

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


             reply	other threads:[~2009-08-06 15:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-06 15:24 Luotao Fu [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1249572295-7801-1-git-send-email-l.fu@pengutronix.de \
    --to=l.fu@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.olbrich@pengutronix.de \
    --cc=socketcan-users@lists.berlios.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®