Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1978767pxb; Sat, 22 Jan 2022 12:01:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJza6X9h5pxMNPFQ/JLeCOKVdVXwDgIbfJA3AyjwQDBY+ph7PaRLm1E4Cxu/wpkmYF6NUV/H X-Received: by 2002:a17:90a:65c2:: with SMTP id i2mr6480653pjs.34.1642881704172; Sat, 22 Jan 2022 12:01:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642881704; cv=none; d=google.com; s=arc-20160816; b=m8dgFA5yn8VsgL3HWzwtQO/NGswb7MC1RIDr40DOW1XSdSXY8SdShy3HiGzcbV8yCi kd+Gx7fmQNa266YKdyi2pQqz1swDTQsbGBDf/MwtkF6IXMyhNFx0t9GbZywsRxgu9IKe bsqrDslWwvIhz8rKzpCFWA7XwB0cdkq9skIXhhfV8OlSUDYu5XYpywkYW0XSKm+Mdz3G 8R+AeN7i3fjwPlNvjH7GkQ/hQs1Tpki2X1HMAXFW1hNwR3KaOYKcHiljkB3IAx/CgxPZ nhXZY/uVpyS8lKUwK7EnscKf3I4xL2sGDVMq9QwS3dWcaw9WpE4m/UmgZbrxgr2AFKlN D7mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=cNgg6eO7ColBOjJRtsN+izURgDgh5DwLKUT8tJKn3F4=; b=lZPo2BpGj28AtLmfs0cxkzXcW3xXPdi5A85gdoitju8Y4I80PjNveDkbixXESJMoqR x5PJPW6XDVFk2fQRirnR0OVCn76lE6LI1Gu7eE42MYUB+9wZgJCmaoIZsMOoL2ByGfnz kD8RIIJl+7uXw4vj6jTWd+Z12vbiTi++5dvPmTP7co+t883VCApLkOstePpqn2hsxxla v9TUHe/YWaPw3DbGGXIEnFflppX9vJZ+pgM8yxAIskD20lTQ8xxC3uCqgR+GwrHeRfo4 dF42JjFC8mapfQroQNJ3dz4L5/1mLf+byJ+kPsOmXnUZm288vTxPOvU5X+DmFwGO2mjp X5xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=R6eZjlgA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id u5si9489110pga.242.2022.01.22.12.01.32; Sat, 22 Jan 2022 12:01:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=R6eZjlgA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231533AbiAVBNl (ORCPT + 99 others); Fri, 21 Jan 2022 20:13:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231402AbiAVBNk (ORCPT ); Fri, 21 Jan 2022 20:13:40 -0500 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CF3AC06173B; Fri, 21 Jan 2022 17:13:40 -0800 (PST) Received: by mail-pg1-x52e.google.com with SMTP id e16so214872pgn.4; Fri, 21 Jan 2022 17:13:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cNgg6eO7ColBOjJRtsN+izURgDgh5DwLKUT8tJKn3F4=; b=R6eZjlgADSq02DqjhCypwUKjz3PcPDkXKE0wqhasQKfPcGsv4RKyqhhtRZs212NqCv c0dUIqzlNoh7tXPEH4KB8Q0fhvUxvCf+7N8ZZvM7e1kOmIXlZ180NqUazn+nLDWQ3O8S Ncj9TyQELzEzlCO9o2sYq3QuonbpxzJXOOzk6wIevna/AG5g+cZH2Tq7fspXfLVPgMW7 /Veb+7BpLvTstFOEB8xMofx7iydtql2nWm0g/uZy8tSJvIJNZh5Id8HBY10EM5uZAKGp tUdvvyUppV7Y+dhSmdQeElaVVwZxLfuwDCEqbq2HCr27MD17H7lvvchcKlZlZbq80dLA XBfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cNgg6eO7ColBOjJRtsN+izURgDgh5DwLKUT8tJKn3F4=; b=GwqT4VzPpWrmsdC3x/oEaFJQWsm828kqyoYWJ8ABBCq7sFFERv7MeaHznym8n6ijIv 2yFG4ArhERdr/3+QPwGXyq8U48jlcHaHRTsZstApNjmWUHuRXE8Wnbe9Pd+yViW0mf6Y TGQVIB3TlJEtGka4qFvGZpv3ookGQZN8hidpIrHMGrhEm8tveYcEjOCgC6iw9U0+0nUF E4lCfKmBCSjIZrJDPwk3SB4osuKF5PQEb9W5fWZw22F0JAEbcdLSA8qgmugKdFxAupX7 m45ahaLjAM3C5nUyFRsRIpVXLlfRs2D9whM4nJVxSpqR0Nr8QEA8n0uULG0gtI2mTgkB McoQ== X-Gm-Message-State: AOAM532HrHX9qB3EVsw3S8jM83Pyrr5ZS3CzmbGF3LJGbiRR1Ey5qGmR 7LTz9nZaD2jOwqlK5nZUpdogmLAcr5vIYmz8iGao81HJ X-Received: by 2002:a62:6342:0:b0:4bc:c4f1:2abf with SMTP id x63-20020a626342000000b004bcc4f12abfmr5957394pfb.77.1642814019152; Fri, 21 Jan 2022 17:13:39 -0800 (PST) MIME-Version: 1.0 References: <20220122005644.802352-1-colin.foster@in-advantage.com> <20220122005644.802352-2-colin.foster@in-advantage.com> In-Reply-To: <20220122005644.802352-2-colin.foster@in-advantage.com> From: Alexei Starovoitov Date: Fri, 21 Jan 2022 17:13:28 -0800 Message-ID: Subject: Re: [net RFC v1 1/1] page_pool: fix NULL dereference crash To: Colin Foster Cc: LKML , Network Development , =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= , John Fastabend , Alexei Starovoitov , Jakub Kicinski , "David S. Miller" , Ilias Apalodimas , Jesper Dangaard Brouer Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 21, 2022 at 4:57 PM Colin Foster wrote: > > Check for the existence of page pool params before dereferencing. This can > cause crashes in certain conditions. In what conditions? Out of tree driver? > Fixes: 35b2e549894b ("page_pool: Add callback to init pages when they are > allocated") > > Signed-off-by: Colin Foster > --- > net/core/page_pool.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/core/page_pool.c b/net/core/page_pool.c > index bd62c01a2ec3..641f849c95e7 100644 > --- a/net/core/page_pool.c > +++ b/net/core/page_pool.c > @@ -213,7 +213,7 @@ static void page_pool_set_pp_info(struct page_pool *pool, > { > page->pp = pool; > page->pp_magic |= PP_SIGNATURE; > - if (pool->p.init_callback) > + if (pool->p && pool->p.init_callback) > pool->p.init_callback(page, pool->p.init_arg); > } > > -- > 2.25.1 >