Received: by 10.213.65.68 with SMTP id h4csp1112300imn; Wed, 28 Mar 2018 21:04:53 -0700 (PDT) X-Google-Smtp-Source: AIpwx49S2cKro5H3ypQsiI/MNieg3dvGHJfacTkbSL6Ln3XjH2KmENmQl5JgqbQyRZELYgvsNMct X-Received: by 2002:a17:902:6ac1:: with SMTP id i1-v6mr6446940plt.152.1522296293267; Wed, 28 Mar 2018 21:04:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522296293; cv=none; d=google.com; s=arc-20160816; b=STeZb8JrZOeI4PGUio//IDwGAul/f0KeOgwRYAsQynYJ2VjBS2l3cl/wsKj/c1ANT2 jeUQ3KlAUxqCaPGck7OKMlj/RmQ68KQvszwh63ciHLXFOt4sR+YPfJXJiOyf2prhSW+o sfOIhHRWphnnabyzf50Istu/m/2COHHKodHJ1iAS/MiQPkK1AmSo7lNOhQVy1GbVAn82 eT329KCdYbNEgTbKgSJZWpl8ZngTeJu73ixMgPSzz0Ya+X43ZSs5KAC+9Ci41LPWd87T gn1WcHrSZ8ZVkJsiKoUO3m97wR1eXkFtWUMmS0EGHx8O9eLzqioeAsiTnOaRd6sdx7ox dlMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=wnNqmxMrS6TT5RxCenVeES34T44+8mxMx2TXPb6e07E=; b=Cj3NEhNqjQgr3tu8x0OuSrqsUgtZOlOO0bQwe/hcuT04w2bpg6N8enn14JlFroY9jE j884eO2CjnoVaSpFbvB1KRf3a60lhcSZDiX+8cvaFgXv3N0PePKCS0H8i3/E+RVRMo2c evfhV9mP8HMLK/oR/x8xrDvukylBfhcdk/ZpXLVAhEmDKqMSJe6OI6jqCftjE8F0QW1s B4rPTjhLsHwfT0uU30EwLUDokckvnZ8hjltaBC/VBKtUKp4SWtB0mAAqi+fbZvjfcmNn 20H9rtHwvE++dy53XBkJZpl3O66mjhWKmoVpNHaG0PSq7IUyfy7tGeU+pew8fbR2bvzp hymQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dMOysWMr; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l30-v6si5038987plg.541.2018.03.28.21.04.37; Wed, 28 Mar 2018 21:04:53 -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=@gmail.com header.s=20161025 header.b=dMOysWMr; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751227AbeC2EDo (ORCPT + 99 others); Thu, 29 Mar 2018 00:03:44 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:42042 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750707AbeC2EDn (ORCPT ); Thu, 29 Mar 2018 00:03:43 -0400 Received: by mail-pf0-f194.google.com with SMTP id a16so2371928pfn.9; Wed, 28 Mar 2018 21:03:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=wnNqmxMrS6TT5RxCenVeES34T44+8mxMx2TXPb6e07E=; b=dMOysWMrS4uPV5CAcHFzbfBkIILdYtiSy8O1H8HwxiHHVP9ucoibmrmjemuVfIdFwF GIxExPNjFS5OcdB2rfZ5eRYaCQJpgDh+BfpyUuaHggOKOSyk20AL9C5uX9zLNPgGoNAP XuFKbv6bIxA1HJjGu6eXseS3IwJMPzGGoqOLq5W9UF9gkob09I+QhmB6dzu9mBewoUDQ gxA92gBq8d9Ko2czuB6XjbcKID/tGSP5u2zgs0Ne60++iF5hpi+pgc7mwpM9pxzPk0k5 A9hhXjoCUzPHt1XQKrNovba8ntrHN8aEGsHpZgHiGLFd+s1TfZmkmaauy4RXaDpc1akG VsbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=wnNqmxMrS6TT5RxCenVeES34T44+8mxMx2TXPb6e07E=; b=dXKgOHNP7FjOWwhA9HKbidCeVmUSmpuZxDZ94Ydord9ssMPOahuIGCu9h3jeGEVgPQ /ncbvermajSmErZv88DWRMQPhqGpOeCOU9DMOiZCi/sX/bzNpvewExAWcnLbd1Jrgoer 3q3R3S8jegWfpg+svb8YcDMN3tVe7qRbA7CKr+C0z1HGQs8B38a9xb5R61ZOT6n8xdRi 5jNVO6M5VhAGARsEFIvZKpe7fdrPHcC8BQHUIJmwXLfYto6CRAuBOh617AJYXRKx3foK zkzvrPZ44Sk266ZRSotML8Bj7dwLqCVUvOeVKBIo7pYvLubCx51//WfpOL99ZCJPrzDf WTtQ== X-Gm-Message-State: AElRT7Gih/CelfQe6CqFIsgB4R70a8CM82JHdD1hXYUPu7dWZSlgSQSY cLRltHFWju0mxw+d+eC7BRM= X-Received: by 10.101.76.77 with SMTP id l13mr4382554pgr.192.1522296222374; Wed, 28 Mar 2018 21:03:42 -0700 (PDT) Received: from [192.168.86.235] (c-67-180-167-114.hsd1.ca.comcast.net. [67.180.167.114]) by smtp.gmail.com with ESMTPSA id r21sm7999274pfj.58.2018.03.28.21.03.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Mar 2018 21:03:41 -0700 (PDT) Subject: Re: [PATCH v2 1/1] xen-netback: process malformed sk_buff correctly to avoid BUG_ON() To: Dongli Zhang , xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Cc: netdev@vger.kernel.org, paul.durrant@citrix.com, wei.liu2@citrix.com References: <1522295463-469-1-git-send-email-dongli.zhang@oracle.com> From: Eric Dumazet Message-ID: <2c741a81-23b3-fa26-89b2-6c3d94b20b96@gmail.com> Date: Wed, 28 Mar 2018 21:03:40 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1522295463-469-1-git-send-email-dongli.zhang@oracle.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/28/2018 08:51 PM, Dongli Zhang wrote: > The "BUG_ON(!frag_iter)" in function xenvif_rx_next_chunk() is triggered if > the received sk_buff is malformed, that is, when the sk_buff has pattern > (skb->data_len && !skb_shinfo(skb)->nr_frags). Below is a sample call > stack: > >... > > The issue is hit by xen-netback when there is bug with other networking > interface (e.g., dom0 physical NIC), who has generated and forwarded > malformed sk_buff to dom0 vifX.Y. It is possible to reproduce the issue on > purpose with below sample code in a kernel module: > > skb->dev = dev; // dev of vifX.Y > skb->len = 386; > skb->data_len = 352; > skb->tail = 98; > skb->end = 384; > skb_shinfo(skb)->nr_frags = 0; > dev->netdev_ops->ndo_start_xmit(skb, dev); > This would be a serious bug in the provider of such skb. Are you sure you do not have instead an skb with a chain of skbs ? (skb_shinfo(skb)->frag_list would be not NULL) Maybe your driver is wrongly advertising NETIF_F_FRAGLIST commit 2167ca029c244901831 would be the bug origin then...