Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp397346ybb; Thu, 28 Mar 2019 04:57:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqwAUtMzBaTFNdFWTPbEGqqHuv9Id4WIjex2xmZmQYgiMCtJLhqmPXqOV5uuKxYZqNIJb8xo X-Received: by 2002:a62:1a0d:: with SMTP id a13mr6435141pfa.198.1553774249727; Thu, 28 Mar 2019 04:57:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553774249; cv=none; d=google.com; s=arc-20160816; b=v/mRuI/8J7xQBHeBETySxhg/iLn2l4/PXqTvY6I935h661ASPTQv0qoNrN9q+VPD5D by5SPWU8e6Ni9oYWHtMEufCpop3YsELFxiHGJMDQQjjOHHNWmQrZsnDN1MbXSX1iVPHP gvwInEgV9Z0pbvRE2gbsPgf55wfolGnh2EElJoFoSiINj93E1l8SoKlRrRVMPhOqnNom JMGd03ZnXs4BDb60xyYF1YeM/r/lozLbdZoaYAI//23JzbJITy1BaGXFx4Kgh6nQBxy+ cDF4Q4HhrAfWcypUov5BBszTAgMvc2BdFCcKVem7WkQkFGUFBfZWghmpQaaJ5+wAWQFv EtQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-filter:dkim-signature:dkim-filter; bh=04ToiUKlDK6KJwamSHJFMGypQWUxvQb5DLIi0XauHyU=; b=g5mlTpSi+rtGbeFy+aek2boV5ba1pm2dKd2mNPz30LV2eX7V8rkzxGFmlwCmfMaKNq 5xosIFs1B+ZGmlGxNxR2LQASGNGjorH1VwT040XvapTvnztHtWtpKInAomH15g1c9I5l Eig+RmrJ4vf4BMWuX8016Ox+SdwvG4DzbA5FOfSdQLdbTjt7vfl+ns6DeKEVT70uJg8f bnaKPZNRfKWeKhvdf1lJ8mDQzV23CLplOQHjuSVZoQmWGfCagG1Fx4eHuupnRet8l9Uj 9RGTtBO40G5OWgZAwfkN8xErQ/xM8WVpNsR/A1Ta5LcoshpPiwE89XhoZtEA5d0ng2Tf kA+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dlink.ru header.s=mail header.b=YLYeLf9C; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g24si21190180pfd.212.2019.03.28.04.57.13; Thu, 28 Mar 2019 04:57:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@dlink.ru header.s=mail header.b=YLYeLf9C; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726520AbfC1L4d (ORCPT + 99 others); Thu, 28 Mar 2019 07:56:33 -0400 Received: from fd.dlink.ru ([178.170.168.18]:32912 "EHLO fd.dlink.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726046AbfC1L4d (ORCPT ); Thu, 28 Mar 2019 07:56:33 -0400 Received: by fd.dlink.ru (Postfix, from userid 5000) id D9CA71B2128B; Thu, 28 Mar 2019 14:56:30 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 fd.dlink.ru D9CA71B2128B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dlink.ru; s=mail; t=1553774190; bh=04ToiUKlDK6KJwamSHJFMGypQWUxvQb5DLIi0XauHyU=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=YLYeLf9C2ZqXQjJ1eW8XWpLdx271D32aZKz4bbeynXvjKmjNNosTac3Gmso5bK5M4 BAppa004ssa8R+xiHnDk96rXeusFhQdOBU4sNQgxMvc9xMHyJ2ZRga7ubW3qJXO18h Un3ZBQCmsMek5QW7U8+HxzAJWAgWHnqXzIo0x4mw= X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail.dlink.ru X-Spam-Level: X-Spam-Status: No, score=-99.2 required=7.5 tests=BAYES_50,URIBL_BLOCKED, USER_IN_WHITELIST autolearn=disabled version=3.4.1 Received: from mail.rzn.dlink.ru (mail.rzn.dlink.ru [178.170.168.13]) by fd.dlink.ru (Postfix) with ESMTP id 16DF91B211ED; Thu, 28 Mar 2019 14:56:28 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 fd.dlink.ru 16DF91B211ED Received: by mail.rzn.dlink.ru (Postfix, from userid 5000) id E08111B2015C; Thu, 28 Mar 2019 14:56:27 +0300 (MSK) Received: from mail.rzn.dlink.ru (localhost [127.0.0.1]) by mail.rzn.dlink.ru (Postfix) with ESMTPA id 7E90E1B203C6; Thu, 28 Mar 2019 14:56:22 +0300 (MSK) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Thu, 28 Mar 2019 14:56:22 +0300 From: Alexander Lobakin To: Edward Cree Cc: "David S. Miller" , Jiri Pirko , Ido Schimmel , Petr Machata , Alexander Duyck , Amritha Nambiar , Li RongQing , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [BUG] net: core: netif_receive_skb_list() crash on non-standard ptypes forwarding In-Reply-To: <61211987-2c8b-12b2-54cc-5ee23e2d0da9@solarflare.com> References: <1553767399.1271.1@dlink.ru> <61211987-2c8b-12b2-54cc-5ee23e2d0da9@solarflare.com> Message-ID: <5b3ef488e40c31dfa2e8d62b94e4df55@dlink.ru> X-Sender: alobakin@dlink.ru User-Agent: Roundcube Webmail/1.3.6 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Edward Cree wrote 28.03.2019 14:37: > On 28/03/2019 10:03, Alexander Lobakin wrote: >> Here's a working possible fix for that, not sure if it can break >> anything >> though. >> >> diff --git a/net/core/dev.c b/net/core/dev.c >> index 2b67f2aa59dd..fdcff29df915 100644 >> --- a/net/core/dev.c >> +++ b/net/core/dev.c >> @@ -5014,8 +5014,10 @@ static inline void >> __netif_receive_skb_list_ptype(struct list_head *head, >>     if (pt_prev->list_func != NULL) >>         pt_prev->list_func(head, pt_prev, orig_dev); >>     else >> -        list_for_each_entry_safe(skb, next, head, list) >> +        list_for_each_entry_safe(skb, next, head, list) { >> +            skb_list_del_init(skb); >>             pt_prev->func(skb, skb->dev, pt_prev, orig_dev); >> +        } >> } >> >> static void __netif_receive_skb_list_core(struct list_head *head, bool >> pfmemalloc) >> >> Maybe you could look into this and find another/better solution (or I >> could >> submit this one if that's pretty enough). > That looks like the correct fix to me, go ahead and have a > Reviewed-by: Edward Cree Cool! Do we need a "stable" mark in this case to propose it to LTS backports (4.20+, I suppose)? >> BTW, great work with netif_receive_skb_list() -- I've got 70 Mbps gain >> (~15%) >> on my setup in comparsion to napi_gro_receive(). > Nice! > > -Ed Regards, ᚷ ᛖ ᚢ ᚦ ᚠ ᚱ