Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2098967pxb; Sat, 22 Jan 2022 16:13:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJy4SdxCPvIpfZhREPZMnFUnkp+WR6pFPWTwp8sJlY8Eqx3A9jTgV9VPsy6rLtb0BzuEKBnA X-Received: by 2002:a17:90a:474d:: with SMTP id y13mr7066426pjg.4.1642896838145; Sat, 22 Jan 2022 16:13:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1642896838; cv=pass; d=google.com; s=arc-20160816; b=N3V3v8pUtLLwLPYlo1RN9b3iXGV1kQPIF4Igy+NSUL2brfsAy4rd4ip5oCO7RCoXZ4 DdTmTkX3AOXfUtKKfcuJ3SFojMoV4sBdbmela/dcTWnrLafjE4tPeOR/6wpz/zP4/00E GhDxCB/LuMaOTjFIk885I3V4gFsdRoQkzzFFlg887KqnfQfYqY50TdXxkAV6SPR9AiHE OI7TmFYQOzw3n1RwzwYjQ0UInBLzPUBLKN8RLXFUcgHubFb7qWN1Ug0bO8hWDuDy+YRU rIoZknDWkudeo6OvcvzvS4yb1mCfdGG0fR7aV+PtN2WO0+xPb6HF9c34vqMfLyMQocln rjTw== 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=j9BoLsPO+w5iMqzv1V8UMsCDJ7hsdYtEGuw7b+EzV6c=; b=NrfdzkjctenmTy8CsUDuTsBrb96xWrn1j7HNEw+fT/whs5aFumbcE2t3F3pq86sBz7 EIbSO7nGNMVRLbvfr8xwaqGG89CDZsdhnvXjIUfifx9TaS1M0yQer7tmyTaPkZb/6dCT dB8pQHAYKO+Nc30INtD7W+GJtisEoWcdUoU3zF8ZnPj8myMR1kNqIbOMkEzvrWNzY4+T bIuOFPs7yC/PASXnhImbsog2ocGzSGWgA8z0CrWorH+NPYBYOm9HuZxOSGNRVVbCYHv9 9RmV2IjWnP6xoxZU7sHk+prHV7BIR3n9VQ4DRVAqgNrfjINw3+/H7/knVTqkpBUBAWsh 0N7A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b=WoBs6cUJ; 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 f7si9912903pgg.204.2022.01.22.16.13.46; Sat, 22 Jan 2022 16:13:58 -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=WoBs6cUJ; 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 S230195AbiAVClC (ORCPT + 99 others); Fri, 21 Jan 2022 21:41:02 -0500 Received: from mail-bn8nam12on2114.outbound.protection.outlook.com ([40.107.237.114]:38102 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229603AbiAVClB (ORCPT ); Fri, 21 Jan 2022 21:41:01 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iUC5+NbE1e94xU4yzXm1tjhZrwUSHUmHUSPd/YLEZYO/wzaWM9TiLiCNpMj0oE35xohwHNcXkTUmk6q0200+ceowXAutzb1bru5hNJ1AD9tVVbisM2B7mK6C/f9phyR0xuYXAJ9l9hZw6FFZR1tsRKcGOIxrNvMRHiBxALsFH9pJOGEJsZzg+LoHxVosOhgSx+qBaEhn3e2mG2d3kp1c01UttWy+ZWTRAOji+r6NpaxNSawLu0A+rMcA/pdIbDArboayQ3xZMEs/LUogtz01f4/w3s+DOZL8OOeKVI7PUAIBXOuTbDMRq0vttFBdowTRZfeYS4F1k0697kBQ+G4gpQ== 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=j9BoLsPO+w5iMqzv1V8UMsCDJ7hsdYtEGuw7b+EzV6c=; b=RFtcrqZrAeTgVRzzMUx62lB4NnAfmN9d6ZVMIOp+zymI36qhdJMmUpr5+4sM55keFPAFvGV+YgrRnbNIkaw5spL5uoUXuHz3toHGF7iHjelGlvx9hJwV2LYUZpLEIeCgdxmugB48ptwRb46bcxtaWAz5XUF/UvSNOrzHsCyJHyAw9nKBCvchiJFXXEciiBjzil5ZtVNCp4ENUmb4z3LucAQl6TUpTK9UxA+uYrmEj6k9OHUMsjougsVu7/pi5D59i+44/9yP3sMAm3QYgzgrKSBQQ9KyIlyYRmlOqRum3nkxn73/sOpPSpx1f/km469lnoX2n0xJPfpUdXzt+Rh8EA== 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=j9BoLsPO+w5iMqzv1V8UMsCDJ7hsdYtEGuw7b+EzV6c=; b=WoBs6cUJpfo6gwWjPxs5fICfASy5VpyzYaELekJsGq3wI4sTL/2hLrIuM4v3qyML1oF19Ud/t8pQTUyMQJf8fDKjZfEnChcoj1faPlKm82XTAWIUFe2XDsUT7vmazdaYmpVfHtlCRQBiNw6mbAN1eUSMpkSkjprQfEKOl4VPNqA= 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 DM5PR10MB1596.namprd10.prod.outlook.com (2603:10b6:3:14::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.10; Sat, 22 Jan 2022 02:40:58 +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 02:40:58 +0000 Date: Fri, 21 Jan 2022 18:40:51 -0800 From: Colin Foster To: Alexei Starovoitov Cc: 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: <20220122024051.GA905413@euler> References: <20220122005644.802352-1-colin.foster@in-advantage.com> <20220122005644.802352-2-colin.foster@in-advantage.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: MWHPR15CA0033.namprd15.prod.outlook.com (2603:10b6:300:ad::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: 66dbdd6e-d597-48b4-6dc2-08d9dd509eef X-MS-TrafficTypeDiagnostic: DM5PR10MB1596:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: w3l4RMv8CjpMmAjns5cYFLrTSzzaYEQGUEpPffjaFs1VDat48/zhvjkS6Yp85zXNE9p4rpQmkyFxaK1NPhJPZNvsyJkaSYuXEVqN2hBEmYE+hgMxtBYq/MoxzO++OAd3OqFvQmu81ij4e357pfgzRVZo5zO0FXJc6ys4FSDo35h2sl3fNgwGPoWGgLiRR4bq/g8WcLr0lrOSmU6DVwBIGiqECu7dKQTmP3Mxtvq48CsZB7KrNz5rtEwXHNzgV5FrLK4GnM2GqJ5NhEpCtDW17C8YK9qJZziCTnIDgY1C7YgYbs5Dh7aeS4TtqvdTzjUY88HRTdXtoSlFemGki07h3EeaV1jpC+quQMb0sEHPUDTAbI5VsS1CyP7q7L6yDMEeYNKQcoW3tFlrPoV3cTxhyQP1MzZQtnxlK2fovQchCVWtdD9UeupqgtsTW6/Si26Qxrv4Oj9FWjs3dLryvJcrlJxPWeHuUL3Yn6EznqXWGz4jjm2R2wiqPzTKM6wxCopwVhXvblmb79VqWl9AH3Np0//R3pt5HfKOnhytmi9vpIoMV9jgJka5acES3Pcg+lbq+/jKNaVwijd0U586H4lbMNMGq6ge3j/idtVTQ1tLB+HubiCfUBoSVdqGccOJKThMfSFxYxR0B0j/3HHZoD2CCIt3s56X8HieOzd0op5o+dR5il5j2oHfyNAIypUZy3fdwDmvBCBEz599iwAKlLOjBw== 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)(136003)(376002)(346002)(42606007)(366004)(39830400003)(396003)(33716001)(5660300002)(33656002)(6486002)(4326008)(66476007)(8936002)(38100700002)(44832011)(38350700002)(2906002)(66556008)(186003)(8676002)(53546011)(54906003)(7416002)(6506007)(316002)(9686003)(6512007)(52116002)(66946007)(508600001)(86362001)(26005)(6666004)(6916009)(83380400001)(1076003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?mMtSS6OdGpKEDmE4XiM9Styg2lhHcGKOUtrM5lEthT/Om/idK1NyP1UF6o4U?= =?us-ascii?Q?ydyAV4cmcLbAphyCL2MQFpK0paN/LuNFQaStkwMMhqgJSB+bTgFDTrEkAie6?= =?us-ascii?Q?j2LmgUXxUjed81Zcqq3nvtvGOKfajTrN8/LJkFHBJ0cx4KcHbDQ+smH33onM?= =?us-ascii?Q?SrFINbVb9MZykcNqK3er6PK8BDUDluzFongQ2Hrmedy8WD4b2iDKRVznI5cV?= =?us-ascii?Q?QSrAysCg66KzBjjZzga6S5U17EhP99epUlQ0qvrfUQnZViSGkWg/RxlJYcqF?= =?us-ascii?Q?2RZxgSfVh9fCH4tvN73PHM26yNrHCEEqwC1HEXNkzrUh2UmdCRKKfQEzZl22?= =?us-ascii?Q?tGF3Ec2RmNRhNtOoSoQvKPchuUDmYU5GXjC6eJIDdfc25fzCu0XZAt5Cbx8t?= =?us-ascii?Q?arjC7ngf4uq41oQUCEEfmZa6pXi4bDC8yyw/Kdft6hCC852OHa5ZPpUZ/SY1?= =?us-ascii?Q?bN7uV+snG6qRnH0AlXrmZUjJA+ITC59S9/MaCnwZzYCWI9+hZz3gidRBcupm?= =?us-ascii?Q?vpCfvmkgGLZTgSIou/9V8Lo9Ple1eYR41T2jXLrBksnPM96q9BgJr92mvong?= =?us-ascii?Q?szPyyjFozQuCKeljpQSXw926QFxFeQmed1P9d9Ox7mXJgJTgvedVUCc5fyGu?= =?us-ascii?Q?emSjdr/+gYeq8J8Mhoyh6pAunhOI3r3FAwlbTLcMim1h2uQUoJfHn7kim+tS?= =?us-ascii?Q?hXgoUeRt6SZwVWQ9IWVoBy1ERDfbw7z6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NY2uNLyGrLyHo9H1TYxUS/ImX64cNHUZdVPll78+f7DzDnL6WQ1s?= =?us-ascii?Q?B1vyt7QcLpt9joTbwgSiRgahS9c=3D?= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 66dbdd6e-d597-48b4-6dc2-08d9dd509eef X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jan 2022 02:40:58.6530 (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: qZTknn6VO8FZ7XNfwZLzbFGohNxR6ad9jdLVfvWb5O8Hsz8Qu9RbOHvhR/Mjl6rGLUd0yGrmKbiyb1LSeA2y7KRTcKq1DPriF/U3zmaDfNA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR10MB1596 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > pool->p.init_callback(page, pool->p.init_arg); > > } > > > > -- > > 2.25.1 > >