Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2526736pxb; Sun, 23 Jan 2022 07:28:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJwF9f/8UK6913kA8luxftDGp5ovtRsFteX1NU7JBLa2YVeg4ImsOTZBFme6M1FN3vu52gpr X-Received: by 2002:a17:903:120a:b0:149:8dd5:f0e1 with SMTP id l10-20020a170903120a00b001498dd5f0e1mr11050180plh.71.1642951739031; Sun, 23 Jan 2022 07:28:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1642951739; cv=pass; d=google.com; s=arc-20160816; b=a2JUJCrWgLXwM5+VdIhaFKZN06X/TQLvpZ1OGKHvBctaRmHCfLnZPbtriUNas2tijD QjnXHX31bIp3KtRdZuEZkxtGMHcdEhTlJEmTRgS1bOjRzwwbwkB+eO07ZWkyfYYSHRut a5War0qnydiGkD/E65RN80zVh4vkdrc2Lw9kACMIVYkomWlwgh1uWaYnVscBWn2tFRCz XF1g1t29XqHelc70n+cZ4diF19FV2gbdK/sfw9AWetXkfB86rrYSMsPegG9aLZMFWX9V B1MV/yT8FNb9c85tNQ4/9M9Yd5kcuLGE9luKyp+lalZiKxPBbaX7LRmIq4ft7MBDIKjn 38pQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6+A8I0IGmsqYJ8c2Hy1RY7N1zsNxbKFBser6ZyliCTg=; b=qarI/yT9klFFOd16iBQkp1nNwTzSgGQfySjXXaTPHHq7Hai84H9KEVso8vv6HDslIt wkU4tVVze74xx7zPuB2dMTGyPhdFlw5tGTv+zdjOhNkHwDl0GLIqdNxaP2zVYGwFJwnU q8KTM9qFCumCiaWeiqFWcIAxiOvstJqvUuzETwyUJtfQhuPD5201QU33RG7ewlxCrZhF c5aU1Rg81Uh+dFZjtpVJvqvODx6OP4O7046KIYLqju7MKBahY9QZ4a/1UJ5mnFmhc6se i4qPTKDSsIxfa6RRuR7N57AJ30vyqjfdwo+yJnEQ4pTsi63meyAh6+Qh99eOhcWkrjhH jQKw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b=EMDAgTET; arc=pass (i=1); 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=fail (p=NONE sp=NONE dis=NONE) header.from=in-advantage.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pc10si12865435pjb.38.2022.01.23.07.28.47; Sun, 23 Jan 2022 07:28:59 -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=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b=EMDAgTET; arc=pass (i=1); 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=fail (p=NONE sp=NONE dis=NONE) header.from=in-advantage.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234830AbiAVTq2 (ORCPT + 99 others); Sat, 22 Jan 2022 14:46:28 -0500 Received: from mail-dm6nam11on2131.outbound.protection.outlook.com ([40.107.223.131]:23585 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229534AbiAVTq0 (ORCPT ); Sat, 22 Jan 2022 14:46:26 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SIbyabuDJQOzE6hq244K3Yw+hLwHCrIag1Nz9xcfKgjqq2N3ID8FORTSYvilvRU0Dtqf7atCdBz6s3aq2dQQuUkJJB51qZH1cdjU+W8tQvOPkelg4tAlaCCRezgpz6wmLtZW+tMXYK1oaSNhFBAYjffLGbZvH7BFjy5nKas9ETLARriSb8MXDNDvRhsznEJQGpPrYKNguM5KGovg4HvwWgQg7KXOQruFrxjLoDpPR31YsuxEtD4LkA2jISRX/uLotCW4/MbmMKmEMpzWvKIpeVOVKkBJI8Oc1GZMWEPEbeAdOcnqiBvsxMBhp6BfqxaswsgN8J3DIAp0GvfpyKOnDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6+A8I0IGmsqYJ8c2Hy1RY7N1zsNxbKFBser6ZyliCTg=; b=aLAhzFfFUjWnQo8CCQ0xb2UcaewWx2J/T00y+QWQi91MZOWi+GcJtjOI5X6iRe0rPWInocxD6doyJKtgO1tzKq7DPE+rRBvugkYSoOfzkE720VvGKc+5l/8MM3AQcXRc52d7AwTgCwexpr7vVPa8+ObnwCqO39d4SHLiLRexNa6YK198r7rdiP75xOUBGsmV4dO6VBPrtgJJhGt6YcOqKqic5JC2zpCNdtKoAXOdOa/NSJXh8AjnKuooEhin6xuqWzold0YToHcEJci9F58ULqtZAXug37T0GuyPr579X1+2/MBLM/MOHLkS7uU02ADWcqm0b7PjlRylkH5XrjbAXA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inadvantage.onmicrosoft.com; s=selector2-inadvantage-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6+A8I0IGmsqYJ8c2Hy1RY7N1zsNxbKFBser6ZyliCTg=; b=EMDAgTETH+0GOnYTxMVOSAwxA1Yt8yZWpD5fzFvclFjCmbvG5tjZWLvNhFqeah85C2bIe5nAiyhF2s7r6cn+2FqVRRE0teD7qTgve3AJ84k48str18fzAy55cpyufFAFqKeIS0Mtd43CAljLtjcDgcLhtRSJXJZQ1BTjABmSfLA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=in-advantage.com; Received: from MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) by MWHPR10MB2045.namprd10.prod.outlook.com (2603:10b6:300:109::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.12; Sat, 22 Jan 2022 19:46:23 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::2d52:2a96:7e6c:460f]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::2d52:2a96:7e6c:460f%4]) with mapi id 15.20.4888.014; Sat, 22 Jan 2022 19:46:22 +0000 Date: Sat, 22 Jan 2022 11:46:15 -0800 From: Colin Foster To: Jesper Dangaard Brouer Cc: Alexei Starovoitov , brouer@redhat.com, LKML , Network Development , Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= , John Fastabend , Alexei Starovoitov , Jakub Kicinski , "David S. Miller" , Ilias Apalodimas , Jesper Dangaard Brouer Subject: Re: [net RFC v1 1/1] page_pool: fix NULL dereference crash Message-ID: <20220122194615.GA914030@euler> References: <20220122005644.802352-1-colin.foster@in-advantage.com> <20220122005644.802352-2-colin.foster@in-advantage.com> <20220122024051.GA905413@euler> <5bd8f1bd-1a21-df1b-6d6f-9fe5657fdd7c@redhat.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5bd8f1bd-1a21-df1b-6d6f-9fe5657fdd7c@redhat.com> X-ClientProxiedBy: CO2PR05CA0009.namprd05.prod.outlook.com (2603:10b6:102:2::19) To MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0dbb78b4-6c39-4bfe-0f04-08d9dddfde29 X-MS-TrafficTypeDiagnostic: MWHPR10MB2045:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:655; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CMXtSE31axv2igiPOCZmAcTZsefoxCwewbDBgl47QN0gAF0Hwvyd4ZkFSqRixd993z1bA59TWOWOhM6MfPM27ZyqCZxn8/+qBG1CuRnbgeyBx0856p7Vqh56V7xIMtwz+77M6xRqKr6rn37FKcWo0u32ZNxoFanWYl86RjalyM4MsLMc28vCrsYYJRqeA+L0HcB9n1gpFXi624Lfw8R7lXKR9ObrARnV5C4vnCZonW08ds7ao5s3aRWHLh8ogo5vz2m6kHvZZZcs2hgWzsHr+26Q3/fl5dVFH2YZ5LwJUeuUjfzSzip/Z7Im1oIW9GmyOGv+7TEh6JZZWFO83Bu/4TPpCsvaX4mMZyHvL1ImCu9VXk7jV31ugs6IhBP9GbJQhqux7poxs/HU3a9wr+2nXtPW6ttWf5T/F4QgeWYPfcN/nFHB3SIHQJ4ifnyRP4M4gntlvGO6XrWBZVoz99RwyGRMixbqhfYe2PZPMI/xf2lt/zFeFzvpgb+fEnR8cYbl0nz2IDVofa6maCIsJfU/U5I2MqFO/SbkdH9r7WJQCVTfaKwuYTx2ISTlAUkDft8NFoBvcBkRuYpY/dhi8hGIUuXqT3i4c910x+HhV/7wzD0JU2WPKJGluKwALFCjrPUTtG0ktoyxDH9VHesiU8w1d9X+pdsZiZiCVgTpHMButujgU+6gSDVX4bHvBWY7HSgMsiNft/tFcesGzYIgMv689w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2351.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(7916004)(346002)(376002)(42606007)(136003)(39830400003)(366004)(396003)(66556008)(186003)(38350700002)(6916009)(54906003)(6666004)(508600001)(5660300002)(26005)(7416002)(38100700002)(52116002)(66476007)(316002)(2906002)(4326008)(86362001)(6512007)(33656002)(33716001)(53546011)(1076003)(8676002)(66946007)(44832011)(9686003)(83380400001)(6486002)(6506007)(8936002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?g37wnPWBzgnlt0gKipfxvkxOrng65aP28eRftOCIQhtItSSaE/hs483unb/A?= =?us-ascii?Q?Hk4Yf/KS99JYBhCrfz9bWM9L7AMxK9oKeTV8lvBEgGwA/ArEYp4wC6t1n/Bd?= =?us-ascii?Q?1pB0AewCMcShR7820L4DibTLyINabR1QKmoRkkO15/sgLkIfQwy2eM/RaoQh?= =?us-ascii?Q?UAOUqUPUM6/2ruUDTncRQ6USnwWi5EhD8E3PG38y2HOBbBYKgl4tDOJG7WbU?= =?us-ascii?Q?7eUuAY3ksmcbMG5Z/EYOxesLVhpaYfPORKtQ985Wzc1kHRioDgyg0l8mDLry?= =?us-ascii?Q?0EIUb7qdW8piVzFz4CgTsLI8rlPst9u4mfF5ImiS1F8CeHs5XE3UxlRvP9Dy?= =?us-ascii?Q?xf4gQIUNW5L8rgQU/szJmiBKar0VU2GmPDJtO6349T1zEu6K5/amSCdNfPXa?= =?us-ascii?Q?dd/+pQ4k99b/sA0CoTDuu4s8pbBxVjsGBqFgGWbivqoobe80Derb3f/IJMmN?= =?us-ascii?Q?mgRfpbCm/YV9Y2EYGdWqdFmHkw+Fotm/E91bCSkDiTPs7M9HHddVlySBLJQY?= =?us-ascii?Q?69X76b5NpzQpyKc+2g5fcHSBLE218qe+kbf2Oz7dN8GAHmMsl7klPcIRDO/9?= =?us-ascii?Q?nNE647DmeB0WDZQ6GNNyZAXurLvwOSwBslwpacq1klOMPm9dnkVmaBf/l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PtX5F2aNSwoBoFUxVlkVgBKO6/L+Y/IV?= =?us-ascii?Q?qWQDOgoa6Auo+/eSY1xhf25WLyFaBayLzTEf4L2mlQJ1HdNLQh2+W1scdTfW?= =?us-ascii?Q?S6Bi3tpToBvp21nmfITdf2HDbGYaHuBP3tTifIdqmPXps62uge3a794NrRBu?= =?us-ascii?Q?ItzeDg=3D=3D?= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0dbb78b4-6c39-4bfe-0f04-08d9dddfde29 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jan 2022 19:46:22.8063 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 48e842ca-fbd8-4633-a79d-0c955a7d3aae X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ca2aztkyd+0WzWlb2TlfL4H7yKvLXj+GKnW74P+yMOw5zx/6jQTxxRtsP05qn+uCCf7nRoNA6SRSlpnP8y7Nx5xsENU2VzmhJBHdbZxH748= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB2045 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jan 22, 2022 at 09:31:17AM +0100, Jesper Dangaard Brouer wrote: > > > On 22/01/2022 03.40, Colin Foster wrote: > > On Fri, Jan 21, 2022 at 05:13:28PM -0800, Alexei Starovoitov wrote: > > > 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) > > > > And my apologies - this should be if (pool... not if (pool->p. kernelbot > > will be sure to tell me of this blunder soon > > Can you confirm if your crash is fixed by this change? Yes, this is confirmed. I'd obviously like to make a more comprehensive commit message - my main question is "is this an issue for all DSA configurations?" Seemingly that is the case, but like I said, I'm unfamiliar with this code. I'll see if I can get a better understanding before sending the real patch early next week. > > > > > > pool->p.init_callback(page, pool->p.init_arg); > > > > } >