[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 4 Apr 2018 14:34:48 +0000
From: "Jon Rosen (jrosen)" <jrosen@...co.com>
To: Stephen Hemminger <stephen@...workplumber.org>
CC: "David S. Miller" <davem@...emloft.net>,
Willem de Bruijn <willemb@...gle.com>,
Eric Dumazet <edumazet@...gle.com>,
Kees Cook <keescook@...omium.org>,
David Windsor <dwindsor@...il.com>,
"Rosen, Rami" <rami.rosen@...el.com>,
"Reshetova, Elena" <elena.reshetova@...el.com>,
"Mike Maloney" <maloney@...gle.com>,
Benjamin Poirier <bpoirier@...e.com>,
"open list:NETWORKING [GENERAL]" <netdev@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>
Subject: RE: [RFC PATCH] packet: mark ring entry as in-use inside spin_lock to
prevent RX ring overrun
> > diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
> > index e0f3f4a..264d7b2 100644
> > --- a/net/packet/af_packet.c
> > +++ b/net/packet/af_packet.c
> > @@ -2287,6 +2287,15 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
> > if (po->stats.stats1.tp_drops)
> > status |= TP_STATUS_LOSING;
> > }
> > +
> > + /*
> > + * Mark this entry as TP_STATUS_IN_PROGRESS to prevent other
> > + * kernel threads from re-using this same entry.
> > + */
> > +#define TP_STATUS_IN_PROGRESS TP_STATUS_LOSING
> > + if (po->tp_version <= TPACKET_V2)
> > + __packet_set_status(po, h.raw, TP_STATUS_IN_PROGRESS);
> > +
> > po->stats.stats1.tp_packets++;
> > if (copy_skb) {
> > status |= TP_STATUS_COPY;
>
> This patch looks correct. Please resend it with proper signed-off-by
> and with a kernel code indenting style (tabs). Is this bug present
> since the beginning of af_packet and multiqueue devices or did it get
> introduced in some previous kernel?
Sorry about the tabs, I'll fix that and try to figure out what I did wrong with
the signed-off-by.
I've looked back as far as I could find online (2.6.11) and it would appear that
this bug has always been there.
Thanks, jon.
Powered by blists - more mailing lists