From patchwork Thu Dec 19 12:18:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gal Pressman X-Patchwork-Id: 13915003 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDE2AE77184 for ; Thu, 19 Dec 2024 12:18:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 60FC46B0082; Thu, 19 Dec 2024 07:18:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5BFE26B0083; Thu, 19 Dec 2024 07:18:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 439526B0085; Thu, 19 Dec 2024 07:18:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 258236B0082 for ; Thu, 19 Dec 2024 07:18:35 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 7816A46726 for ; Thu, 19 Dec 2024 12:18:11 +0000 (UTC) X-FDA: 82911609438.27.B7BE56A Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2061.outbound.protection.outlook.com [40.107.94.61]) by imf04.hostedemail.com (Postfix) with ESMTP id EE83C4001F for ; Thu, 19 Dec 2024 12:17:33 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=Z2agY3oh; spf=pass (imf04.hostedemail.com: domain of gal@nvidia.com designates 40.107.94.61 as permitted sender) smtp.mailfrom=gal@nvidia.com; dmarc=pass (policy=reject) header.from=nvidia.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1734610657; a=rsa-sha256; cv=pass; b=k5H0P5AZnhZr9ptwxiyKE1uZR9Ho9vrvPX2TLl9TgMjYTkNb2G2yMqjUVEkub5pfIzs8rg qTnwy3g5VCo/XgBGsvDMLQx2jLqOJtaTofeGchmydfMeBmzRbxac2u+e4xuWa/b9fVjJKv UByHaAhx4snN6rzveK9Px9NDByPs5os= ARC-Authentication-Results: i=2; imf04.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=Z2agY3oh; spf=pass (imf04.hostedemail.com: domain of gal@nvidia.com designates 40.107.94.61 as permitted sender) smtp.mailfrom=gal@nvidia.com; dmarc=pass (policy=reject) header.from=nvidia.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734610657; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=Sx3q2ybJLpBuKbwAjxOZxgV7sRBBZue/I2ol2o1LNBk=; b=4dpRa7CdHK/u3+c/fPD7xPvlrxRduhN0q3MvtHcJwFXAEVbMV0wLNIpKWTCeQxj00PZ1CX bYutZG/CNabp8qJ0TVpTA83Q9p56AR1kzYXQ1KEyj6dkxeiC0DYhbnDhyXEVXQGpJbbGTb IhjAhYfGlzGRaA+n8NLrMUPaot4C9cY= ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tXY3XHeSQHkFwwGilJfaHzawOENtGEvYvL64rX8Ig2ij0i4fV760cHibhSTte0GsVvZyH69e/UtaO6j02WNyhB69DM4XzvUtCBwxI8PgvIt2Ydz8ONWyMivxSXpeGIASs/2CYA/5YcwQH5eFF7iHuI7/j34dsDfVkJYSC1U7ycVfUmc3kaeREvwF2b7OOWm03p3qb/g5Vi4um3qS+KDVV5s6l+UXS5tVqV+Oz/duZbFdjJ6nZ+eqtaf3+Ssm8c5CmmFoiinFwa9Ap3ytAJo+ksqwf0+IKR4VP26zXyZJJdHxy+18bNfe40FlIfLnlfR8ZXVccU+MIqtAB28nnEw4NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=Sx3q2ybJLpBuKbwAjxOZxgV7sRBBZue/I2ol2o1LNBk=; b=eiQ3F2wqS9+b1csjJS4kgwO8GULfhN0j3FcAdWeicB2DmNd2JrR4JYDF31BHBjKDcG0HssMKY3E6nf7suR/07nS3VBwsfpbFTUuXWiY8c8QxtmOO6w4xHRULdjczHLqV0uVxxNqd0xptpF8m1SwKT9emWBiROQoSkMp45kE/vRAZ3SP942V1CbTEWlRxuoxh2xy/zn9eCdg5ImtV/QAOEXhpzWG9Tiv87lHDVymI1AdP5VeglGYOaCAM0qVdZuKvLU+L7+2/Y4kdYOx38qnRmq+s95rooR9lvJyZ2Cf1/Kt4HHkR3vcnvNEm1yKD5dizOrEBT+P3TqjMqqVpb5lv4g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Sx3q2ybJLpBuKbwAjxOZxgV7sRBBZue/I2ol2o1LNBk=; b=Z2agY3oh9paWtsb8WYomZV+fOTzWzWGxKwNuW54i0cOtGnZKiHoKVTBfkJf0Wrpo+nEdc+iiQ7vNubAnwduJ8sIjhfhSnl5MutB+9zFDB2nsc9vgAKoFsaeoa1b+yeW/os7h2L3+yX+XJJ4vGDdQKowqI1Vro1X5MUdo69jl9SG9gsJEBu4hHuQoGlAloFiMxMxMT7KY3xaxb7e7B1pnAUeOB9YIEUl/xcP8rk5HFGVIuPBYcBhhWWgepSM6q1zzw7GLHimBH6hnHrYbM7UOkuM2SiY9WDOR55d3Mi0kse4aiIrZnwnOF7n7xLDeTA9HQ+udX0Pv1UYRQ5akNY4w6Q== Received: from DS7PR03CA0038.namprd03.prod.outlook.com (2603:10b6:5:3b5::13) by DM3PR12MB9436.namprd12.prod.outlook.com (2603:10b6:8:1af::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.13; Thu, 19 Dec 2024 12:18:04 +0000 Received: from DS3PEPF000099D4.namprd04.prod.outlook.com (2603:10b6:5:3b5:cafe::d1) by DS7PR03CA0038.outlook.office365.com (2603:10b6:5:3b5::13) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8251.23 via Frontend Transport; Thu, 19 Dec 2024 12:18:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DS3PEPF000099D4.mail.protection.outlook.com (10.167.17.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.15 via Frontend Transport; Thu, 19 Dec 2024 12:18:04 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 19 Dec 2024 04:17:54 -0800 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 19 Dec 2024 04:17:53 -0800 Received: from vdi.nvidia.com (10.127.8.12) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Thu, 19 Dec 2024 04:17:50 -0800 From: Gal Pressman To: Dennis Zhou , Tejun Heo , "Christoph Lameter" , Nathan Chancellor , "Nick Desaulniers" , Bill Wendling , Justin Stitt , Uros Bizjak , Andrew Morton CC: , , , , Gal Pressman Subject: [PATCH] percpu: Remove intermediate variable in PERCPU_PTR() Date: Thu, 19 Dec 2024 14:18:28 +0200 Message-ID: <20241219121828.2120780-1-gal@nvidia.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-NV-OnPremToCloud: AnonymousSubmission X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099D4:EE_|DM3PR12MB9436:EE_ X-MS-Office365-Filtering-Correlation-Id: cc7f5316-0540-4aa5-941a-08dd20273040 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: TJr+JjHUN2X4BqrZnrrS40WJymjLinegZwGvoIwANCERPC0Xi3gdxSPSik+MyxTZjtsED1h52sqWURS0YuaN7D4IbKt1ZQuVT8h08Gb06zvIvfYAXCH/UxQKDdtKDyMoavksNZP1BmD7zLd+BLulYXhgJG/FV1pjEV6/YO8OMfnJawCA8pfmJhmhlgCr9GCx2l7wFsJeVQfaQRxuyHdpYqn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D/LsSRI/KBAyNMBQ+ean6BiWaKgr9gmvIQpZYIBLAymqtX22GKis+zURCeBGYCClGfdfsw1MA5r+0zPZF4y6zT6+ityQ+epqReAopGC7o2sGQ0EepSfMC22A5DSKfoyC372UFI1X0eOKL9SPOx7OQmwaVzijG7xaajhXtsO0TDoygjeLs/pDlOlZqVWAcLp9zHQdmy7G/wACR+KX9NlitxfD48= X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230040)(7416014)(1800799024)(376014)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2024 12:18:04.0424 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cc7f5316-0540-4aa5-941a-08dd20273040 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF000099D4.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB9436 X-Rspamd-Queue-Id: EE83C4001F X-Stat-Signature: e13j6rd7nkwfzumpmhwoq5445orgdput X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1734610653-402560 X-HE-Meta: U2FsdGVkX1+1G8WC02qjyP5vDovNJelaFr9ecpfuPnDAjUXSmlhEu1ogK1/Wubv7XSUVY0oRV+hsZMJhS7Hn8DwnZ2zvrMPZrjUc9g6/mICcHTH28EbqIbr0z3qKxfhe6WcefAiCxxVXCLKjvF08HmN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LkGTaCzvv4aoqzTlBqggPcHBTBewPtmfYK8y15S1+dH/S5FSBYTlEZJMJKOh8nmj65SbycPeAzYTeEFV0y8NoNi7+jV9UA95vBeplgFaDt1lKhPvxG/rp+TvjvgqavofniDN7+vRbmrQkxAnECSbHiwyoQjkloyCwU5KKipx7i6+vjFUtjUoJ2shCh/G8RIXan7bN9VmkpW+YkEXBkRFTh146VhxIlhfSJ7gI0h9U12/lRtfReHywcrAZW8zvz3REehX6hCP66LyyC3/4znxGuFbSJVfUCzVoN0RB5VrXZbzK385vGBU X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: The intermediate variable in the PERCPU_PTR() macro results in a kernel panic on boot [1] due to a compiler bug seen when compiling the kernel (+ KASAN) with gcc 11.3.1, but not when compiling with latest gcc (v14.2)/clang(v18.1). To solve it, remove the intermediate variable (which is not needed) and keep the casting that resolves the address space checks. [1] Oops: general protection fault, probably for non-canonical address 0xdffffc0000000003: 0000 [#1] SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000018-0x000000000000001f] CPU: 0 UID: 0 PID: 547 Comm: iptables Not tainted 6.13.0-rc1_external_tested-master #1 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 RIP: 0010:nf_ct_netns_do_get+0x139/0x540 Code: 03 00 00 48 81 c4 88 00 00 00 5b 5d 41 5c 41 5d 41 5e 41 5f c3 4d 8d 75 08 48 b8 00 00 00 00 00 fc ff df 4c 89 f2 48 c1 ea 03 <0f> b6 04 02 84 c0 74 08 3c 03 0f 8e 27 03 00 00 41 8b 45 08 83 c0 RSP: 0018:ffff888116df75e8 EFLAGS: 00010207 RAX: dffffc0000000000 RBX: 1ffff11022dbeebe RCX: ffffffff839a2382 RDX: 0000000000000003 RSI: 0000000000000008 RDI: ffff88842ec46d10 RBP: 0000000000000002 R08: 0000000000000000 R09: fffffbfff0b0860c R10: ffff888116df75e8 R11: 0000000000000001 R12: ffffffff879d6a80 R13: 0000000000000016 R14: 000000000000001e R15: ffff888116df7908 FS: 00007fba01646740(0000) GS:ffff88842ec00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055bd901800d8 CR3: 00000001205f0003 CR4: 0000000000172eb0 Call Trace: ? die_addr+0x3d/0xa0 ? exc_general_protection+0x144/0x220 ? asm_exc_general_protection+0x22/0x30 ? __mutex_lock+0x2c2/0x1d70 ? nf_ct_netns_do_get+0x139/0x540 ? nf_ct_netns_do_get+0xb5/0x540 ? net_generic+0x1f0/0x1f0 ? __create_object+0x5e/0x80 xt_check_target+0x1f0/0x930 ? textify_hooks.constprop.0+0x110/0x110 ? pcpu_alloc_noprof+0x7cd/0xcf0 ? xt_find_target+0x148/0x1e0 find_check_entry.constprop.0+0x6c0/0x920 ? get_info+0x380/0x380 ? __virt_addr_valid+0x1df/0x3b0 ? kasan_quarantine_put+0xe3/0x200 ? kfree+0x13e/0x3d0 ? translate_table+0xaf5/0x1750 translate_table+0xbd8/0x1750 ? ipt_unregister_table_exit+0x30/0x30 ? __might_fault+0xbb/0x170 do_ipt_set_ctl+0x408/0x1340 ? nf_sockopt_find.constprop.0+0x17b/0x1f0 ? lock_downgrade+0x680/0x680 ? lockdep_hardirqs_on_prepare+0x284/0x400 ? ipt_register_table+0x440/0x440 ? bit_wait_timeout+0x160/0x160 nf_setsockopt+0x6f/0xd0 raw_setsockopt+0x7e/0x200 ? raw_bind+0x590/0x590 ? do_user_addr_fault+0x812/0xd20 do_sock_setsockopt+0x1e2/0x3f0 ? move_addr_to_user+0x90/0x90 ? lock_downgrade+0x680/0x680 __sys_setsockopt+0x9e/0x100 __x64_sys_setsockopt+0xb9/0x150 ? do_syscall_64+0x33/0x140 do_syscall_64+0x6d/0x140 entry_SYSCALL_64_after_hwframe+0x4b/0x53 RIP: 0033:0x7fba015134ce Code: 0f 1f 40 00 48 8b 15 59 69 0e 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b1 0f 1f 00 f3 0f 1e fa 49 89 ca b8 36 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 0a c3 66 0f 1f 84 00 00 00 00 00 48 8b 15 21 RSP: 002b:00007ffd9de6f388 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 000055bd9017f490 RCX: 00007fba015134ce RDX: 0000000000000040 RSI: 0000000000000000 RDI: 0000000000000004 RBP: 0000000000000500 R08: 0000000000000560 R09: 0000000000000052 R10: 000055bd901800e0 R11: 0000000000000246 R12: 000055bd90180140 R13: 000055bd901800e0 R14: 000055bd9017f498 R15: 000055bd9017ff10 Modules linked in: xt_MASQUERADE nf_conntrack_netlink nfnetlink xt_addrtype iptable_nat nf_nat br_netfilter rpcsec_gss_krb5 auth_rpcgss oid_registry overlay zram zsmalloc mlx4_ib mlx4_en mlx4_core rpcrdma rdma_ucm ib_uverbs ib_iser libiscsi scsi_transport_iscsi fuse ib_umad rdma_cm ib_ipoib iw_cm ib_cm ib_core ---[ end trace 0000000000000000 ]--- Fixes: dabddd687c9e ("percpu: cast percpu pointer in PERCPU_PTR() via unsigned long") Closes: https://lore.kernel.org/all/7590f546-4021-4602-9252-0d525de35b52@nvidia.com Cc: Uros Bizjak Signed-off-by: Gal Pressman Reviewed-by: Uros Bizjak --- include/linux/percpu-defs.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h index 35842d1e3879..573adb643d90 100644 --- a/include/linux/percpu-defs.h +++ b/include/linux/percpu-defs.h @@ -222,8 +222,7 @@ do { \ #define PERCPU_PTR(__p) \ ({ \ - unsigned long __pcpu_ptr = (__force unsigned long)(__p); \ - (typeof(*(__p)) __force __kernel *)(__pcpu_ptr); \ + (typeof(*(__p)) __force __kernel *)((__force unsigned long)(__p)); \ }) #ifdef CONFIG_SMP