Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2029683rwd; Fri, 26 May 2023 00:07:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7ZSwJKgUAygYODVwjStYq7z8126oKIBUBIc/5ouwAcTP7jFzCeJyJui5KG4JetRGeyinmg X-Received: by 2002:a05:6a20:4425:b0:10e:ff8f:8edc with SMTP id ce37-20020a056a20442500b0010eff8f8edcmr1047471pzb.55.1685084867006; Fri, 26 May 2023 00:07:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685084866; cv=none; d=google.com; s=arc-20160816; b=Auzwsdbs7vHoVJ2/ojL64QFkrtGlhzKICf1dS7qiYN5ahRnwiXoYhDy7FAWhuz0vte U7XBE5XP4qwv+4+BR4IjX37yItTOJjjRv1+2o/5C3uYMatBM5PiAYtPXAjwO+j0q2icr XqSzqigHcLbswkaZC+M/7S8bv+XnA1XBrtgvDH4RZWakYTsPujJsCUpd8jSn7LvYsl8D SaH5IHb0xH32lCA+M/j2Ubp7YfT1ZrGg+gbzSawBhG6SXSN7GbCmp4TTh0iIMuFKeHqF fQV1JFQ8EvvxuERpwMysMkUmBZjBY7YgnCXn/1+EtmA/prGm3mO3as5FTiRbvL1WgAQB M0rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=x+bs/EeksfHI43M3AGFfTiuW/uRtRdXfogNY4shc8y0=; b=wnjEiR8In2GNOCTWwA9kk6/+z2XDrMxvijyr8hnMm4Mu36tjY9rgJPi5cbIJLtoIZD DgguIjhIqqw+QuXaF5nEouGTFvneCWeFJWRdTrr6zvzNhuw/ZQbE6i+KjO3v5YDDvpCk 5tCNJKFW7JTd8Y5a+qb8/RDyHyOgBAWQHOK58HKozlr90KXBtacB+6Jeh8HLWeSQ0940 933jHlEmB7MyrFmVfZ1F0RM1sgNZ8q0vbwcQHHPZBo5EHVgFOuF2APC7OKFxIqZADOM0 3Lb7x5/3XB3MIvHZR7rB0h2xGtlPXWYOdd9EGCRxj6O8I9W7AR6Q1X6LvPKqmdwcwFzl Vh+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WLMbS94x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t13-20020a17090aba8d00b0024e1eed547esi1494226pjr.96.2023.05.26.00.07.35; Fri, 26 May 2023 00:07:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WLMbS94x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241794AbjEZGkK (ORCPT + 99 others); Fri, 26 May 2023 02:40:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233393AbjEZGkH (ORCPT ); Fri, 26 May 2023 02:40:07 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1457319D for ; Thu, 25 May 2023 23:39:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685083149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=x+bs/EeksfHI43M3AGFfTiuW/uRtRdXfogNY4shc8y0=; b=WLMbS94xPsz+u7Wie7Ayi82I70i2vj2Rr7bz452sX4SdjFMpS9nufnsXPcxZhrLqRlZLEJ ZFThEwWBZXOJS7Rmki9rZ/YeBxDsUXoGLzbLeA23YBK00NcXIaFJX0/bVTHAz1Doj5w4UZ cZjUta8gbKrja2bJj8tnJrOL5kcTkXY= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-279-WnTrTTXAOMOI_IfSkuWpTw-1; Fri, 26 May 2023 02:39:07 -0400 X-MC-Unique: WnTrTTXAOMOI_IfSkuWpTw-1 Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-4f4b7b4e7c5so181979e87.1 for ; Thu, 25 May 2023 23:39:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685083146; x=1687675146; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=x+bs/EeksfHI43M3AGFfTiuW/uRtRdXfogNY4shc8y0=; b=Lnben8ZfjYlpNs6YHeSgIUoKKM+wlcMqkbSp0BRnnw+qjZHakN5zuoCjPOaP3khTnB O+hbL6avT7fhuJHa2KOLxPcwuwanX6ZfSlp9iSRwIRlH4w5FOvZNpbs0quyjKgts4W7P 9HCdVjJfkjRWECAE1jX14iLqC4T//8bwSm3vbsWMKuOdAiZnA76JeF/noKa8K43OzPZO pzuf4/Tt6B6tmVLYCXXBu6A0rSmvCPJOEG6btpVDNK3/4hiekT/rSc3DBcgFPbz+QsI4 7I2QIs/6L9hq8oAlA0gTe6WOoRLWSOYdgh2lo1KCPRHWMMPIYJBn27pGMOJMsAzHnd7O 6+Mw== X-Gm-Message-State: AC+VfDzLMVFfykmoKpkKHanZANyaCADMO4QcWNikfnB+W9TP//UpPyC0 ICVUUHUIve0PhFMzGwI84ZckVlpaRd0RIRhralivgUXFHXJVED90J3hZeTBbWVzirshs63hwbWt 1035POd5iVqN/NVbQBQtDXoGD1l0hl94xoPD8Riw8 X-Received: by 2002:ac2:5584:0:b0:4f3:ba53:35f2 with SMTP id v4-20020ac25584000000b004f3ba5335f2mr348199lfg.49.1685083145940; Thu, 25 May 2023 23:39:05 -0700 (PDT) X-Received: by 2002:ac2:5584:0:b0:4f3:ba53:35f2 with SMTP id v4-20020ac25584000000b004f3ba5335f2mr348187lfg.49.1685083145623; Thu, 25 May 2023 23:39:05 -0700 (PDT) MIME-Version: 1.0 References: <20230526054621.18371-1-liangchen.linux@gmail.com> In-Reply-To: <20230526054621.18371-1-liangchen.linux@gmail.com> From: Jason Wang Date: Fri, 26 May 2023 14:38:54 +0800 Message-ID: Subject: Re: [PATCH net-next 1/5] virtio_net: Fix an unsafe reference to the page chain To: Liang Chen Cc: mst@redhat.com, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, xuanzhuo@linux.alibaba.com, kuba@kernel.org, edumazet@google.com, davem@davemloft.net, pabeni@redhat.com, alexander.duyck@gmail.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 26, 2023 at 1:46=E2=80=AFPM Liang Chen wrote: > > "private" of buffer page is currently used for big mode to chain pages. > But in mergeable mode, that offset of page could mean something else, > e.g. when page_pool page is used instead. So excluding mergeable mode to > avoid such a problem. If this issue happens only in the case of page_pool, it would be better to squash it there. Thanks > > Signed-off-by: Liang Chen > --- > drivers/net/virtio_net.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > index 5a7f7a76b920..c5dca0d92e64 100644 > --- a/drivers/net/virtio_net.c > +++ b/drivers/net/virtio_net.c > @@ -497,7 +497,7 @@ static struct sk_buff *page_to_skb(struct virtnet_inf= o *vi, > return NULL; > > page =3D (struct page *)page->private; > - if (page) > + if (!vi->mergeable_rx_bufs && page) > give_pages(rq, page); > goto ok; > } > -- > 2.31.1 >