From patchwork Sat Jan 22 00:56:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 12720386 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5934C433F5 for ; Sat, 22 Jan 2022 00:57:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231190AbiAVA47 (ORCPT ); Fri, 21 Jan 2022 19:56:59 -0500 Received: from mail-bn8nam08on2114.outbound.protection.outlook.com ([40.107.100.114]:63832 "EHLO NAM04-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229457AbiAVA46 (ORCPT ); Fri, 21 Jan 2022 19:56:58 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D3OlRgJWRiGIfXO1c1YtCVdEiEBmf7HxfH6ewbhr877RLANDPRmV6JPiZBfhU5PFnXhjwRXN+yJkKo/HGZTHDnGtZUVxUNliML5prLtgFr0mRVmC60JP1VbPQHsEPDZ3SJOsZAVObr5tYynfFbWIfZ1XgWPzc2ONwuGUrK3PMcEk5/k9WTy+bUj3bqmXL+Zo01f2O3NQreHKpoB5+OvxuLBEwPKIQ2EZ5XSQw5WVgVr+Z78Vsx6UxzA6iMEYeJ47yKDTXkxp8i5kYzEAD+R25S5WQrOKjiQa338bNw16ieRwAB057VnzNTtzlWX1wpzhsJPIDS6JFqF/+A5OvJjwFQ== 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=csOGeUerndB/exQwBHTXHTvA3zR/xmGXpFV4dZIU2wQ=; b=WhEIMsyhOG70zWOuk1uSNIzYt3SJL6skFzlE+1vhsGZ+efQdAvvuTriI0Vy8x4zSQwiaAzCloNNmE/da75VroEZJaL9GTh4OHahc1z9ia+WIp9QbfAaqUvMPv4UXNg7Fy95wIs/rgJwzbWOwb+BbjtMFXiAaAJMaAmUNt5jz+9LQhFM5l+1UO2zUUYlzMGaY/O0FLQzIgxZz7OHzIMzbKilk2fZjAxZFNIlKArc6XzVzq4cMdo62DIP6ElSTgtDr82KPTUuR6DWHQzH8GKeJZiDhvLz3+U7EedEJweksNz2p2GgczB2LfAyjaYa4AXiF8wXU5O2CBsWURFtOvpHVkA== 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=csOGeUerndB/exQwBHTXHTvA3zR/xmGXpFV4dZIU2wQ=; b=rV1v+7Hc5lN5mrIlZPZN95ll9aTK8iSgFop0ZrMUgtidcb7t3DGJLDCTomtQ48/aNp1XBov7y7gfenF+07Swfn033lQnrDzl0QogvoXP0nlnjIoxaTI5em0t3i9TKymbs/izLbmzArG+5AGBTxZf6X75pmqx1K1xBXxJ8K2A/2U= 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 CH2PR10MB4022.namprd10.prod.outlook.com (2603:10b6:610:9::30) 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 00:56:56 +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 00:56:56 +0000 From: Colin Foster To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= , John Fastabend , Alexei Starovoitov , Jakub Kicinski , "David S. Miller" , Ilias Apalodimas , Jesper Dangaard Brouer Subject: [net RFC v1 0/1] Fix NULL pointer dereference in page_pool Date: Fri, 21 Jan 2022 16:56:43 -0800 Message-Id: <20220122005644.802352-1-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: MWHPR13CA0030.namprd13.prod.outlook.com (2603:10b6:300:95::16) 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: 30ce11d3-6d89-49b1-c4a6-08d9dd421642 X-MS-TrafficTypeDiagnostic: CH2PR10MB4022:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: R+vJo7dz34uFzwGnDuDWhHc9Z92CGv027799U84gADJWXqzpxSwHIlbHRP56Aijge95pCni+/lTiZF+p3PNKILodeZfI9nmn9aG2FIvjtoUrb4b2DIFQusvmXksy1ybCsAUZ6O7m3kFaWmAnBavF2AXeF/+ON2s7iE1mwzOn9hgBayuM2UBGAb+E8mhco9E0mmE3IGVOIKNtRa3zdZuuJ2QEmg1hL5SY56udCOYMyQad7WjPMzBfxccFu5CKdbZtNc6QIx5AmF+fWBW4r2Ch1v/1Es5dt+RXH9XMNHQ5Ja3YUGLyOG0L2oEHsDOVGTmO6/KDCoRb4iAE6WmqIPz3ApTl/286O3YbZZ49Ucx4T4cithwct6flKUAoL79RPqqF6heLdRDiatIZP2GaAuva4AxZev6J6ikTT5O5TvHG+BiWl1hU1Zp/eZrdjnlVcUIMduoXiSPUILkR9E+LQvkO6nHFzW1OKnnOSROwQpoJRFapg/pAxCbY+URgh8GcF2DppZoB5k4uD6mHbh6IzLAoTPOQUi7qAS9WA7C6STllTRAQ25wNRg2XGX6qIsKOlARzUpQO+AHbQiqH2YSChj1CRYa0YRad5dzdD/7QjYqe7sXqTZ8pVMdOjlJYQhgsJmzFvGVgJlErJOFmPVaZVrpfOF6/j12IWhdCGhcTz84KVhf5dSUO16Ujp56l77dHhT/BFesNqIOVhI2KIoDtpbDwVQ== 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:(42606007)(39830400003)(376002)(366004)(136003)(346002)(396003)(2616005)(52116002)(2906002)(44832011)(6486002)(186003)(316002)(8676002)(6512007)(26005)(54906003)(8936002)(66946007)(66556008)(4326008)(66476007)(6666004)(4744005)(83380400001)(5660300002)(86362001)(38350700002)(38100700002)(6506007)(1076003)(508600001)(36756003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: C0MSiNsITuz7Y0YO7jfZ5P2AMzOhZBwiRhM1gIfceVj+ZXCOMLGwueN3QAYjrJm/hDyH07rFTPzJDCXJw5rJO+ddJtXvDL7/fGTbmGeSAD/+Pf3xKyir0BzMHqe3QFdDNb20wbJJ6482xoeQZV/Tp8lJvINF28eQE0GwhWlleSIly0tDZhSp4CfC8XH5/3fC5DSgbqTUnGTR+gik+NbfoKU4FkN5C/Kt/TQMcV6XgnpaZV/omf+KNiLf4cb7122ft/WypKa2JxbpmtJ17FxNKUNsDJ2J3Ds0HaVtLeJzhvpIVnrPpx11ydF/V3a9+18MZqQOG7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V0YwznY1bomnID9CQmpPHUTR1UgRi5fooU1ktlnzrukIXmBkmGkNKQ99dCLvZGrRt7idgiU0/iWy4e6Bec2KcgvLXNUvziLcGZ7kcDC7EGOJGPG2TXbRppcU/zJ/ycwhgfzvQWcD64aiE15MXRsQfgP4wS9OaPNobalIauPG/8sf9PL8jXziNbXcDFzrD7EeGeihLsnVZxtTdaVJfHwK6Jyg31RsnqgZdKaCZKpR6Oc7oxt4FNcyQ9f+v9MFbY1+7qIfuebV3EDhxtQ9shbAQfxA== X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 30ce11d3-6d89-49b1-c4a6-08d9dd421642 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jan 2022 00:56:56.3971 (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: g6bYoowf37FopHv4deTvw1oIBsM/mYblV+kneUnnaA06xzM3Thr1JctU2/P7S7hNwPJBHdmif9pEjnS18AggueAIbIDP+I5CMLghfDTxGwU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR10MB4022 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC I'm not sure if there's something wrong with my config, but as soon as I run "ip link set eth0 up" I would get a crash that would invoke a seemingly endless memory dump. git bisect led me to the page_pool, where there isn't the existence of page_pool_params inside of the pool. Therefore the check of if (pool->p.init_callback) would cause a crash. I have some out-of-tree patches currently, so I'm not sure if my case is valid. Specifically the MTU of cpsw_new has been updated to 1520 to account for my setup (beaglebone with eth0 as the CPU port of a DSA). I'm also not familiar with much of net/core. If it is valid that page_pool might not have page_pool_params in a DSA scenario, then hopefully this patch is sufficient. If it isn't valid and something I'm doing is invoking a memory issue - then I've got my work cut out for me :-) Colin Foster (1): page_pool: fix NULL dereference crash net/core/page_pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)