Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp734301rwd; Sat, 27 May 2023 05:47:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5HXWfzsf0wGDG2sC5eH82zFuoMRP91398wpWIcaXbPLnRvJdAqEa3kPkIoxOpZ0HJtrJf7 X-Received: by 2002:a17:902:da8f:b0:1ae:2f3f:881b with SMTP id j15-20020a170902da8f00b001ae2f3f881bmr7355508plx.10.1685191671911; Sat, 27 May 2023 05:47:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685191671; cv=none; d=google.com; s=arc-20160816; b=OJ7NGXWblmobZ+/NY7qCGj4GLpb9bcRe24UVo04hXA8Zp0sWtM+pO1ldRCEFh/CCn0 u4XbEhsoV23/wGe4GP7zM+Gl/d7VkG2s+orzvfxOMav8DyQu93kRIMmw6OPCtV04kWl4 Tl/Qq+fQCK2XDxQYf62a0QeggBla7Cizq5yzbwDLceI7vzbRCvDveKR7cy132q6ZShfk wlO7cR1wqMT12RHcsmfIjNbpV51IoeAg1xtS8wRha3dROW4TJzJuGtHLrRsK9F3B3q91 P1r+e4ePGryWj5aDzptdW2F6gk58AtHk0ghcO32U1lAK0D9gp0XG0bZeCp3cCVdJf/UE 2SHw== 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=luEVOxwc+hf1I6vnh0OMg4uHH06RianYGAZT40fbv6Q=; b=d24l0mH+XSHyfj38X0y7WQRHAd3WDkWdcoDMljESisDcrOLhDaLrdfGWzBO8czeHSl JOCIt7fKOhHMdtgJP46IzqKZDa27CmIDnwGgtptmGEYyIXx8NYRnd9YXVfzv2P55tVhq VVOhLgpkcQXK9JUeUHbaMBN7Z0u0H8pEv5kzoi+tmiFI4iWaGj78RBTP45g3ulCAug4P 44MGwXDGqCQXCaQc/S9Eemg8aA5bpbjk/bMBtFOOvlkLNoywQqml7cE2nTOFc/khmlAE i6UVe2rzgHsF5dsPK5JHFxahsLta46z3mjXXY/QK4xL/ZqTCej4AF3SqL+ipf2uRSRBg +JWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=B36wSsFQ; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k8-20020a170902c40800b001a637615a89si7092573plk.561.2023.05.27.05.47.38; Sat, 27 May 2023 05:47:51 -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=@gmail.com header.s=20221208 header.b=B36wSsFQ; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232430AbjE0Mdq (ORCPT + 99 others); Sat, 27 May 2023 08:33:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229593AbjE0Mdp (ORCPT ); Sat, 27 May 2023 08:33:45 -0400 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 534ACF3; Sat, 27 May 2023 05:33:44 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2b03d3e41fcso31837011fa.0; Sat, 27 May 2023 05:33:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685190822; x=1687782822; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=luEVOxwc+hf1I6vnh0OMg4uHH06RianYGAZT40fbv6Q=; b=B36wSsFQrmHI133lMAzYbT/95M8XFCG5dcna7rLtoQT7qTWUkLxMO9uDXQfa0JpkFz faXPMxbI+2Uq5rE3ruOQKeEI200212EZZlFde2tAf5QjLGFO1UeVLw0S2NdhHu6MIDDf yKZgePb7HQxDP0XudTRIylVRhogwCRfW12v8BUAP0c4FGRZjnuXCYf6cddQcmbEejMiP BGNs8G2CeK5h4CehPTvq5KNkwcpubHCJlDU3ZZ4BsrvVCSEWmNZNcYDDTLVYWKhhJi2Z EUBkj+jfKLkkg9G4ktk+rfkZgm9QhLL5xhQv+N9t3guIB4lqB7b8+fRe2zKg0Kb7YEcQ lBVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685190822; x=1687782822; 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=luEVOxwc+hf1I6vnh0OMg4uHH06RianYGAZT40fbv6Q=; b=ezV5LTnn0jyL9sHYvCanxJJrcpszlIs0SdgCLsm+cbL8k25FvEu1sqWTQ87D0ZSpsF e6N9ytndh6gTJ4lTsqgVUbJgoe7GqG1FUR3J25v5+/bNF5LNYLowONpmsve5Jp5xzWvb IVJ6TM1dXJqNAGFDtuE0KBLAoZzyNC7ISwjxyx2LoOuxoM6YERMu91hkDKQsAkP47Onb 7t/toQH8EHFXnw4wJukiaD38HDpHjXNuukQfzG77zcB91ZPRVE2qDOR961lYjhBP8Okl b6j3rI77ZsSR+0oTpR0PeSQvNBqczVWiSy8lNSqljbAMZlvqMYxIyg3uCtoDgkOTwVpN piRg== X-Gm-Message-State: AC+VfDwRA4BatJxeP1zgtcP7sytRMZTnc3B3Ud79Z9toanVKMeXbD7uo f9O2cX6OZw1txAdbw9HNQi/nVfbGJmV3F5tGviE= X-Received: by 2002:a2e:b94a:0:b0:2a7:b0b2:29 with SMTP id 10-20020a2eb94a000000b002a7b0b20029mr723614ljs.22.1685190822334; Sat, 27 May 2023 05:33:42 -0700 (PDT) MIME-Version: 1.0 References: <20230526054621.18371-1-liangchen.linux@gmail.com> In-Reply-To: From: Liang Chen Date: Sat, 27 May 2023 20:33:30 +0800 Message-ID: Subject: Re: [PATCH net-next 1/5] virtio_net: Fix an unsafe reference to the page chain To: Jason Wang 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,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 2:39=E2=80=AFPM Jason Wang wr= ote: > > 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 t= o > > avoid such a problem. > > If this issue happens only in the case of page_pool, it would be > better to squash it there. > > Thanks Sure, 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_i= nfo *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 > > >