From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jon Rosen (jrosen)" Subject: RE: [RFC PATCH] packet: mark ring entry as in-use inside spin_lock to prevent RX ring overrun Date: Wed, 4 Apr 2018 14:34:48 +0000 Message-ID: <54c7cbde468c45609e36738baa5ea084@XCH-RTP-016.cisco.com> References: <20180403215526.15934-1-jrosen@cisco.com> <20180403161630.24f8339c@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "David S. Miller" , Willem de Bruijn , Eric Dumazet , Kees Cook , David Windsor , "Rosen, Rami" , "Reshetova, Elena" , "Mike Maloney" , Benjamin Poirier , "open list:NETWORKING [GENERAL]" , open list To: Stephen Hemminger Return-path: In-Reply-To: <20180403161630.24f8339c@xeon-e3> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org > > 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, stru= ct net_device *dev, > > if (po->stats.stats1.tp_drops) > > status |=3D 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 <=3D TPACKET_V2) > > + __packet_set_status(po, h.raw, TP_STATUS_IN_PROGRESS); > > + > > po->stats.stats1.tp_packets++; > > if (copy_skb) { > > status |=3D TP_STATUS_COPY; >=20 > 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.