From: Timo Teras <timo.teras@iki.fi>
To: Francois Romieu <romieu@fr.zoreil.com>, netdev@vger.kernel.org
Subject: via-velocity skb_over_panic
Date: Fri, 13 Nov 2015 18:49:47 +0200 [thread overview]
Message-ID: <20151113184947.09d57da5@vostro> (raw)
Hi,
I recently saw via-velocity skb_over_panic() on one of my locations.
The panic happened with two separate hardware devices, so it appears to
be network related, not broken hardware.
I did not get the actual over_panic printk, as I got only screen shot
of them monitor. But the visible part of call trace says:
<IRQ>
skb_put
velocity_poll
net_rx_action
__do_softirq
irq_exit
common_interrupt
<EOI>
The was recurring every few hours, so I patched via-velocity with the
following after looking the code a bit:
--- a/drivers/net/ethernet/via/via-velocity.c
+++ b/drivers/net/ethernet/via/via-velocity.c
@@ -2060,6 +2060,11 @@ static int velocity_receive_frame(struct velocity_info *vptr, int idx)
stats->rx_length_errors++;
return -EINVAL;
}
+ if (pkt_len < 4 || pkt_len > vptr->rx.buf_sz) {
+ VELOCITY_PRT(MSG_LEVEL_VERBOSE, KERN_ERR " %s : the received frame size %d is inconsistent.\n", vptr->netdev->name, pkt_len);
+ stats->rx_length_errors++;
+ return -EINVAL;
+ }
if (rd->rdesc0.RSR & RSR_MAR)
stats->multicast++;
This seems to have fixed the panics. And I do see one of the NIC's
ethtool report's in_range_length_errors increasing once in a while. For
some reason I don't see the above debug message though, so I'm not sure
on what pkt_len triggers it.
In any case, the cade a bit later on does unconditionally:
skb_put(skb, pkt_len - 4);
So it's possible that some bad packets make the NIC return unexpected
packet sizes, and the current code can panic on it.
Any suggestions for better fix?
Thanks,
Timo
next reply other threads:[~2015-11-13 16:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-13 16:49 Timo Teras [this message]
2015-11-13 21:07 ` via-velocity skb_over_panic David Miller
2015-11-13 23:21 ` Francois Romieu
2015-11-16 12:36 ` [PATCH] via-velocity: unconditionally drop frames with bad l2 length Timo Teräs
2015-11-17 19:37 ` David Miller
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=20151113184947.09d57da5@vostro \
--to=timo.teras@iki.fi \
--cc=netdev@vger.kernel.org \
--cc=romieu@fr.zoreil.com \
/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;
as well as URLs for NNTP newsgroup(s).