From patchwork Fri Feb 10 20:20:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Saeger X-Patchwork-Id: 13136414 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D8A49C05027 for ; Fri, 10 Feb 2023 20:44:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gRdwWBAggAfDlnVVlBbid7mJtjIcETCmLJzmoLNLfq0=; b=EUtazhumps7ceX MTDKotSDtZQIJlaBo/Jstjzdu7gDKzRV0OT579/BnijJHLsEp4O/RDzs14S3TWy2Bu7YLwSQJ1mie G3exqhKCYOvOTOPaDHNG6T5t1I9Cv4L4zJXqkVkh+4Bp3UNeMqPLd6Bw85+d/qO5xvejpw8QphOUZ w5fHIfjdtIAwiroo+rPUZBjWCvcKBSxy0DHQ8sc8oGlKAyuTKGXXKDoA0sh8a7bEVAU5eoJIj8H7w 3GR12bA8GOZKhA1tEREcZLfF6lTCUvpnUMSWr1Ds6La36nFDA1qPZi/sASBWFXht2XeddG8bPAfx4 iF40JQfF/13eEGF9+1Aw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pQaG5-007Sla-Sg; Fri, 10 Feb 2023 20:44:38 +0000 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pQZt2-007M6n-PE; Fri, 10 Feb 2023 20:20:50 +0000 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31AHwhii005533; Fri, 10 Feb 2023 20:20:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : content-transfer-encoding : mime-version; s=corp-2022-7-12; bh=r7KjTkFRoyk1VYqkeou6pOGL5sJNyxPRtaHo/h9tUs4=; b=td2IIriQsY4Yhbz5BRc/YhawONYFAifA/mc8pYlYglNvwK20uZ6k4JSVegu1seacsyBp oJH3V/SjWfxAt0DqkL+f2KtHHRPUg7DzDulE3zoWBrUtTlJT/P0hvKSs6HDHTEMfuAK/ qPQXns6EHhdfq3P+wpY4puW9pFrQGxEWEQhV4BTwr7iuyvooWUYSTwVl9L+GIFXW0zyj Mr3ZdwHZCq+fb+Pnb8pibSbXRvIIgIloHfyW7dg8cLDPm6Bik6lWQxdt/HslM1cqchdo vZ5DR28TUjZtca4F7EyHUpIgg5kWWtgmYhhS9ky6+2/1g7W1CzDkYnI0FXGqTiV1/h29 rw== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3nhe53p6f1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:20:39 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 31AIvq7E036260; Fri, 10 Feb 2023 20:20:39 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2044.outbound.protection.outlook.com [104.47.74.44]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3nhdth2d4c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:20:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CmaaECtac0rTQ3EqyeNDJYAoL1MC1wZPXcML4ONGBK80MVY840x0xijOtWwgsXvvd0/azIwVqCzYN/0tJB7G2R42Y795gCimfweL+nvebdd9FYfRgvgkml94fbR4QNElEKeyaO8yuNN50tnkPW2N5MtoxEsnRPCD0iOMlNQnMKi2qBYOiHWhv1St28d7MVtdPgj0dWIf8J1bRS0bJThBW/ex9cDSjuLD5EolLz4HLIY5gJLdEQPMQRqYFVm5/zLCIdtAFtPdlMrB6G+5UlDZM9ghi4NWEY5hOmNos/KjkWfWQ+xsSEVmjuRmYXHDjYf24aGzotxZI3YdKi6pzGpyrg== 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=r7KjTkFRoyk1VYqkeou6pOGL5sJNyxPRtaHo/h9tUs4=; b=iCuK3Z8jjPn7fYdGVvPARXTnJ54OkTvZseo7a1Re812FOXltJWYtCHp5aVhUts3meRg+ZLcA076aLxzahdD5EViVI78TdctgDpX/Z82nf7TsNR3BpQEdWZnLgVK5mtg5ZqtQkQ4KTFldY6t/n1PdREIbgURT4RVWExkgLvjBRrB8gRRDVdr+M2yJ9VrRZQ67QwUJ0dHNd90SoA1ZW9lj3KRlFxl+8tIAgLkS5GKvOVkmESJ1fZVH1doRHxCS+owMoGUZzY5mtg/lBZWPlyaOfBlk9f6sA7J6JJ2k084BDGsUpIecM/jpLxHwhV76058iqSmbt7xcaRn2zG8odX2xPQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=r7KjTkFRoyk1VYqkeou6pOGL5sJNyxPRtaHo/h9tUs4=; b=ziOesL+sZc3dpUgkrQlS7GShnvTgrDcDPWK0nYbxmL0+UOXOkFj40EilnY46KKYwDgUOa8H1jU6/IzZDR5/2YP7g5RM5nUxNgnjxYfYqnqbgR+KOHkN5IDohl10UqgQcV+J5inQ86x0PGhuW1x3YDR88YPRPELhYNxCFjCLyzqk= Received: from BY5PR10MB3794.namprd10.prod.outlook.com (2603:10b6:a03:1b2::30) by CO6PR10MB5652.namprd10.prod.outlook.com (2603:10b6:303:135::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.19; Fri, 10 Feb 2023 20:20:36 +0000 Received: from BY5PR10MB3794.namprd10.prod.outlook.com ([fe80::f37e:ad45:7d9e:d84d]) by BY5PR10MB3794.namprd10.prod.outlook.com ([fe80::f37e:ad45:7d9e:d84d%6]) with mapi id 15.20.6111.006; Fri, 10 Feb 2023 20:20:36 +0000 From: Tom Saeger To: Greg Kroah-Hartman Cc: Sasha Levin , Naresh Kamboju , John Paul Adrian Glaubitz , Rich Felker , Masahiro Yamada , Ard Biesheuvel , Nathan Chancellor , Dennis Gilmore , Palmer Dabbelt , Arnd Bergmann , Andrew Morton , Tom Saeger , stable@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, "H.J. Lu" , Borislav Petkov , Kees Cook Subject: [PATCH 5.4 v2 1/6] x86, vmlinux.lds: Add RUNTIME_DISCARD_EXIT to generic DISCARDS Date: Fri, 10 Feb 2023 13:20:22 -0700 Message-Id: <20230210-tsaeger-upstream-linux-stable-5-4-v2-1-a56d1e0f5e98@oracle.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230210-tsaeger-upstream-linux-stable-5-4-v2-0-a56d1e0f5e98@oracle.com> References: <20230210-tsaeger-upstream-linux-stable-5-4-v2-0-a56d1e0f5e98@oracle.com> X-Mailer: b4 0.12.1 X-ClientProxiedBy: MN2PR10CA0026.namprd10.prod.outlook.com (2603:10b6:208:120::39) To BY5PR10MB3794.namprd10.prod.outlook.com (2603:10b6:a03:1b2::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR10MB3794:EE_|CO6PR10MB5652:EE_ X-MS-Office365-Filtering-Correlation-Id: 5cbc6105-8df5-41a8-f748-08db0ba444fc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Nm4e8+jCFEttqehWGgvpMzf9DLKgaqtst2yRQiIN++Tq978u4H2E19Y6xZjmQhsnnVCM61yqHTf7XOEuPdOiK+BvN0RbtTElLBTbo10Qv5rJRubOx6sj98irJ3xMg5CeveXgN+SwG5dbmwbRCSVAYbVQ4oPCZGh8i1hb6CpquqknPE/CwVNCOTu+/dLP25T6tkz/x/t1zOG71pegH1EntWVwFJG97eB72JqKETk5IjrwiHQqOt5mJZLczlI0Ja6fiRVqsBYCYU7XtvphtXehZMBlRCBDGj9eWJn2tgEBcwYEVxiK5AvORn0IrDcReP83TC6QUduFK24PYAUkGvaphWGyG+iRsV+wdPGP5Agr6dxdN52l7uE1y0m0ItaisUu2YEH5hbF91/gjQHHU2LavaxOclw5nr1tYW+AUo3hymIew3U7+8ySFW7C9qTckPphT7IbD0PVEo3ldBvOKtMYrHPkqEt+NNsXFXQ8vPJmjv7BNrV9lr2wOZqszgEyR8vyVZU5MOy60bMb5pGuYUMGLyFf3BbGOEk7N8s/JtUaujbTN05JO75geri9c/b+38jx0jwlmtTSGHDak/sDbgTKT7uEdJz3aGybSCBrPC0+zOysmo+3i3stZBRPDzxnDr3A1kkuYTZN/gIMe7wnH1AxrzcHFor8JLIgU2xLtYga4ClpeqZUnIT4cH6qWor6XeZB3oKJaJc4b1dyA2N1UJrL1kRWgkv3t6ng/v1iKYCnffSA= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB3794.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(376002)(136003)(396003)(346002)(366004)(39860400002)(451199018)(2906002)(36756003)(966005)(6666004)(6486002)(478600001)(6512007)(86362001)(2616005)(4326008)(83380400001)(6506007)(6916009)(8676002)(66556008)(66946007)(66476007)(7416002)(44832011)(186003)(5660300002)(316002)(38100700002)(8936002)(41300700001)(54906003)(41533002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?7JiSNYOJAyv88RvQWAgZ0Y5b8P3g?= =?utf-8?q?FD//C7g+/1/Tpcu3ZeXbJDafeg5BCZD/XlG6jvN4v8i5Vb8ZCIxctz/bHwM7R6IDC?= =?utf-8?q?Xn7RR1oZ4AB0pnlK7TX7Bekp4LtXBXl86PJmMLW3+PKS/n7qQA+AmHnJoZpws2VSv?= =?utf-8?q?BwvAtAIkmB9fHKpZGLnRL6G57W5Ar4pG1mWrLLoWIuloz5Ps8pSnmVPANfpPLnnza?= =?utf-8?q?r1uZd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?22ThoNLPxVkCoYPUB5YfHRBDMqf2iGwukIVlL064fq1OR6cqq+wpuZBkIz2deRDh5?= =?utf-8?q?J7Z63jSog6UPw0dJC8G35v+DqgNFDflN/AMZpD0q9w/fDxnQ6yJ7iwzUmyK3ca5ya?= =?utf-8?q?RKZAIRcaXsS4O3dh+ImSSKSTVPQqP4kolpw/PULTCDkr4LjazlinYNdG//0AKU59N?= =?utf-8?q?8XC/Fe/cfmyOsR++e2mZg2Qqhw0aLOqSZ8N7ggshyngF2nFIFYNT1ZwqmtTGHodoX?= =?utf-8?q?7xzUSWVQbSwWC/Ozrnuc6WlQHIAyS8OlQQn56Tn4IVsiFPC9qt1keZ69SIehNWMyu?= =?utf-8?q?jZXUMhphAUx24o9Fw+l1LY17kqD9LPaFe6+56pDClSY3AYWEMOpHLIPLv83C5RC/d?= =?utf-8?q?BOsC3mH4dfSJTFGSqCy1GyUtwleT/6ZD1ivzC70K2gYcbgrifqJoYevK83lSM+H47?= =?utf-8?q?/5jWIl1d1qx7ftSQaXA9qYGjRjndnsLTcF9/2j73Tq1WDbTbfmI5K0A=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: =?utf-8?q?ehONV+5AJwr42jCs?= =?utf-8?q?SCyWYcmbnlR8CoPVk/wt+NdO05B9mmxb2djc1+pwxapln9LV13GP4l7Jrdn/dI4o4?= =?utf-8?q?ezw7Q/vBdkcLTO352a2KYkYzbXrPnOBGQhUcs82fCRZibxUn9q/ZXwwZtcRm9bXE5?= =?utf-8?q?UzyWBqA2VO/BK6Y+FcwYZ6LmBuwqDuqfC8Ys+eN9R4Wrap9ImErkpfpunWyO2newR?= =?utf-8?q?VF0j9JbhD452IVh545EKrLTvkft9QhxX8ejKKGbntI7VPh9pEAYXgFJWyYzAFBGj2?= =?utf-8?q?YZe2ixvmkZvOR7u4pnk4xrTq3XnmEHXzwYAV/dyjALi9xwtry8lc4S96SiV14Nbs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FgU//PmhxXJFwjhXNIvkBnM6P5CottGvXwPDNw=3D=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5cbc6105-8df5-41a8-f748-08db0ba444fc X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB3794.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2023 20:20:36.5684 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7F8JeDv8woMptHQunOU/qj23XY19YKk5CXiygNAD00rkUARpvapXqbAWjEIW4PCxZ9P0iJodL36lyjYKPotWFg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5652 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-10_15,2023-02-09_03,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 adultscore=0 malwarescore=0 mlxscore=0 phishscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302100173 X-Proofpoint-ORIG-GUID: OmZkZ9rXb3vIbezrscjuRnPcng-x3xVA X-Proofpoint-GUID: OmZkZ9rXb3vIbezrscjuRnPcng-x3xVA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230210_122048_985303_0021FF7A X-CRM114-Status: GOOD ( 19.24 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: "H.J. Lu" commit 84d5f77fc2ee4e010c2c037750e32f06e55224b0 upstream. In the x86 kernel, .exit.text and .exit.data sections are discarded at runtime, not by the linker. Add RUNTIME_DISCARD_EXIT to generic DISCARDS and define it in the x86 kernel linker script to keep them. The sections are added before the DISCARD directive so document here only the situation explicitly as this change doesn't have any effect on the generated kernel. Also, other architectures like ARM64 will use it too so generalize the approach with the RUNTIME_DISCARD_EXIT define. [ bp: Massage and extend commit message. ] Signed-off-by: H.J. Lu Signed-off-by: Borislav Petkov Reviewed-by: Kees Cook Link: https://lkml.kernel.org/r/20200326193021.255002-1-hjl.tools@gmail.com Signed-off-by: Tom Saeger --- arch/x86/kernel/vmlinux.lds.S | 1 + include/asm-generic/vmlinux.lds.h | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index 1afe211d7a7c..0ae3cd9a25ea 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S @@ -21,6 +21,7 @@ #define LOAD_OFFSET __START_KERNEL_map #endif +#define RUNTIME_DISCARD_EXIT #include #include #include diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index c3bcac22c389..2d45d98773e2 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -900,10 +900,17 @@ * section definitions so that such archs put those in earlier section * definitions. */ +#ifdef RUNTIME_DISCARD_EXIT +#define EXIT_DISCARDS +#else +#define EXIT_DISCARDS \ + EXIT_TEXT \ + EXIT_DATA +#endif + #define DISCARDS \ /DISCARD/ : { \ - EXIT_TEXT \ - EXIT_DATA \ + EXIT_DISCARDS \ EXIT_CALL \ *(.discard) \ *(.discard.*) \