From patchwork Fri Jan 21 08:42:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12719498 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 939F4C433FE for ; Fri, 21 Jan 2022 08:42:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 30F9F6B0083; Fri, 21 Jan 2022 03:42:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2BE5B6B0085; Fri, 21 Jan 2022 03:42:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 15EAC6B0087; Fri, 21 Jan 2022 03:42:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0132.hostedemail.com [216.40.44.132]) by kanga.kvack.org (Postfix) with ESMTP id 072036B0083 for ; Fri, 21 Jan 2022 03:42:11 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id B52E09369B for ; Fri, 21 Jan 2022 08:42:10 +0000 (UTC) X-FDA: 79053652020.20.CD463CD Received: from FRA01-MR2-obe.outbound.protection.outlook.com (mail-eopbgr90089.outbound.protection.outlook.com [40.107.9.89]) by imf20.hostedemail.com (Postfix) with ESMTP id 2D8FC1C0008 for ; Fri, 21 Jan 2022 08:42:10 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hniHVEgINr/dW7UjgJNkJJ36yMXO8qMzy9HOJgUgDZixXwxn57ZVPb2SUs5kOjVYKbyXohKRZcjXxCNf6LGYraj8XUyKL9yLI3DpwQxLUTrq+Q+UYse3HWuYYE27yO9YMmhi/FvZaqW9xBrUKPqVJEbZ1wjczOLXNZ8jrRJG00OO8e7tPNE+HA9wUZSyeoV/INjuV+zxqsMbn2gsrZngu3eENNo3JQKukzWty2FdC8Q+Dp5WPYNEH0kTSjTZd4/MY9c44HEtW8g/g9kDWSecq2LutaujThy5LG4ueCWxnnx+Q77wmM6Mv66iPpjjhh8TfUcq3qkl8lonT6/vGRZZZw== 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=CecWjS/2UZ0IgcjyZ1BNFW6PGMsjPsk8NnvtJJ1/fvs=; b=G/Y51wIGbclaP6EFQD85MsAXiDiiOmaoaH/LRyBDcbqaIqHKmU61dHCBrada/z5IenThPqoQpbwxCGAgP1bXc1rjWssoMOqgMipYUHBJom/BHGaO4/ST630r5v1bmX/OyXXccm1To0Hcyhq+gbb81jJJCQIlzQrfH2xGN5vegfJNHFyU8AWS9ZqeZ+SKpHChmLddEHaOCeea2pmNidHfdCZmTdx1le/NK45OC2JLbaC5qUKolNFqgkoOZKvYTrrt46C94m+tVp61o8F+0ok14MXx5l02XqoGWaEQ02ZkisYy4rSyhp4+QtnbzCjgCIgFMpAv+Yx9euc4OS1HDq9F6A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:31::15) by PR1P264MB2206.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:192::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.8; Fri, 21 Jan 2022 08:42:08 +0000 Received: from MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM ([fe80::9d4f:1090:9b36:3fc5]) by MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM ([fe80::9d4f:1090:9b36:3fc5%5]) with mapi id 15.20.4909.008; Fri, 21 Jan 2022 08:42:08 +0000 From: Christophe Leroy To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , "alex@ghiti.fr" CC: Christophe Leroy , "linux-kernel@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "linux-mm@kvack.org" , "akpm@linux-foundation.org" , "catalin.marinas@arm.com" , "will@kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: [PATCH v7 01/14] mm: Allow arch specific arch_randomize_brk() with CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT Thread-Topic: [PATCH v7 01/14] mm: Allow arch specific arch_randomize_brk() with CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT Thread-Index: AQHYDqLG97pmfW9CEEqBlISb/pIgvQ== Date: Fri, 21 Jan 2022 08:42:08 +0000 Message-ID: References: In-Reply-To: Accept-Language: fr-FR, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 36ccaa1b-d141-4529-0f6c-08d9dcb9e8b7 x-ms-traffictypediagnostic: PR1P264MB2206:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2657; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: mVhkSBl0XA/B0xhE4yNVc9wUgk2YaVU6HWqVItwUGjYilElnx55oovsmLEQ6LlBHGjyedubp2uOnov+hUMmD5sVUIADkz5VE22MLu5U0wi/4o8Sl2e0vW3iSuN4yic4Us1R3cy0M66B3Np/mqSEiPT31oDD/aC4VXwEgeTNMHZ54kAj7k2EOZ7c/te8JUOoQcThhrwb7Xj+f1LjcLbPxzY+y95fc+xOc8giy4/F3FUr/qI1Biy2EC7pXjxuLKHaGH+M5/iKrITSZb4t86TjWgbjMtGa6hasOdAAFQI2eupcbMiYhcRTWIgXVn7cdmH4xjAgrgSBhDL5nIhkUnHrtqmeNFmhsC2sEIK2hkQwNu8yJbV4iYpm0xzg2oqT2I6R0Hwy6krMkU/IXEYEIBr1G/YWLeoFkB9mCjY/PN4fg5Tetwswxrox8iqdUOjI1uzvj/Np30BvMR4+46HkDEzbFLFkG0P7T3kdCoro00rzwxDos5aCftyNc2diEk3+wRo57NGfOVC+1bc46Ko6vteGWdNmDWCf1Y2VkBhirSBd/O5mstiZ/ymsuXo4a+dMvyhwCmb5IJngCiD/McHDtiBjtoU6l81iqMYeNu1aqosYCVWWcZuOoHNiPX/Uz+jWPzYT6gZyV3/KH2Kz5fSZvwyvNCGJKH16SO1uPZm78OWFor9ulveQqUPDTy3obMEe+BA9euuLZkglkCovJAni6vwh/wQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(4636009)(366004)(71200400001)(316002)(54906003)(38070700005)(2906002)(6512007)(8936002)(6486002)(86362001)(4744005)(186003)(2616005)(83380400001)(7416002)(110136005)(26005)(66476007)(66556008)(64756008)(91956017)(36756003)(66946007)(44832011)(76116006)(66446008)(38100700002)(508600001)(5660300002)(8676002)(4326008)(122000001)(6506007);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?UJdXKOA9IhibxVi/SCjqTte?= =?iso-8859-1?q?GpdMoH+ru1bnugusxKD4Fs75sphrH0/CW/8EdfgKaW+6DBIYLsrt7OiWKsPV?= =?iso-8859-1?q?OLtNhGOlsS/4lkYPPFOTwrrmjcy3K62gPWkW14jOl8cKpaZUOz7Fwdy+JTZ6?= =?iso-8859-1?q?Oh7rO9zP1thuOvogWouptZLu9rjSGQ+rhHGs3iDHLe8nKlux8GncTW/kjb0I?= =?iso-8859-1?q?rnrpYC+q3pXii3RK/FeJZJSMJQ/x5Khf8qYX3Q/+DdRltrfIw+4QkblhS8RM?= =?iso-8859-1?q?OxeHXqqZ+afAowQA4m+ci8DBzWyPGj6zMMddVUJSHk7er3LaBMwXB1syE41+?= =?iso-8859-1?q?G7FqhfbvRAn24556htWU2uvfggnJ13hjocvr6kx3MiQdM/uibjTd3ol/163H?= =?iso-8859-1?q?Ol7jyp1xaETogsG2wk/V/BJVO9N3Xfl6y17zqvljq0m8NfYKc9mLQaWW25Ji?= =?iso-8859-1?q?IOhjge4iKjrYO6uUwnlovWVfpVqTY5+jgUJdtOITY6Qv4RpaHYDoReyrL93k?= =?iso-8859-1?q?oK4FlJtKqtQo928TzuPEwkg5jmSHrkEEjSZC42kqAX6tfnTcBMU9tr9jZPGO?= =?iso-8859-1?q?f0/1wR1cjflD6qu1M5G2CPA2rKwpKb2FNh991B5rwt23i76+QEzMwSwHUJ8t?= =?iso-8859-1?q?asWtHqVXwGyT3sxpKuah7x+ekbot8F8wApQoWc9vZjoaKP2PGng9qyOHGvUY?= =?iso-8859-1?q?3I9R2b9kKt4xx1RVBT0vbLiG47yLjTisWlnj2FDXOvQW2D3Vvep2f6kxv9JB?= =?iso-8859-1?q?nK48x9G76LBR0lMVqd435awel/nLsHbFxx+2yNtFPV+JrDfuuTbaHm972xHI?= =?iso-8859-1?q?DHZKRRIx5Dp3ekVPLGfspAGrPkQfcADlqnRPb3TEALoQSrL9zHfiPdIgpyXS?= =?iso-8859-1?q?wclYlEWPAmulujGfYs4pZeqCjkClpf4hk6pye9KCh08THeyq8kuCvQPEiiUG?= =?iso-8859-1?q?xjc+hWecoksmHC1dpv+tkR5hQSTWcE3s323ezEUWmZDJkmpVlLF5DvrewQjZ?= =?iso-8859-1?q?v7uPknq0Lz7YbveKaq1UKGoQ3Vpa1TgiTP+6KYIpZLovz9N2J0eIPe1sTkIh?= =?iso-8859-1?q?GTEUGlauQyBCcBTa2UUQyBPu0RneRZ5hPeeFCON2iFmoawFGt6WckqC3H1wP?= =?iso-8859-1?q?xMGGk9CHJuqIT/iQGaUaSik6x7ikMT7gO7ZuBewpcInnhqu/TItcKYW5dEEZ?= =?iso-8859-1?q?JfZgAL4I1UO+YZwsK2jvw+O1Qj6BbfFbQSQl14KEoLi3fP/zCBynr0FLhMbv?= =?iso-8859-1?q?ot2gIu6CWXHK9HTU+fPmp4w4YHK9louDl2j2ik7VtcP9c1k5jM8dP3EQ5ky6?= =?iso-8859-1?q?J/1DfSnQgdMwi6iYkaQa3sTNS40IFNIRxBTpbX2gNVne1yGF1GcGoWIIeGyd?= =?iso-8859-1?q?PtqMmq8HSbJcA0rBTXaLqryWfHeORpoRma68z4rfsYtMz1yfMJUJn2TdGc2K?= =?iso-8859-1?q?bwdHiqHJutjYinByOC95v/VbVg6N7OWxcExmmnuAydaXzg/s2bbexgkuWK30?= =?iso-8859-1?q?RmSeNF4OqT0zTjI1nbIYXS2UuRDaAtuDAUzOxyyUwEIq4fOkU/hRft25qnGy?= =?iso-8859-1?q?FcX7RPnWS5qx4FrUl9OqhWQ9f1BdAUkhhYxX+t1YLb0z8HNqbK8UoSc8PtNV?= =?iso-8859-1?q?PhXj9Cv2HfmmpGqoe+KeyY7TxMy+eent6KF7c+ztetIMZOkFukyTfi6+LPt5?= =?iso-8859-1?q?Z/AFL24TseyYY0uB++E+kWjXY/z/WNEQslQBMDWPQQ0bR8fVgJmGhTMGELCn?= =?iso-8859-1?q?6JkE=3D?= MIME-Version: 1.0 X-OriginatorOrg: csgroup.eu X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 36ccaa1b-d141-4529-0f6c-08d9dcb9e8b7 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jan 2022 08:42:08.0695 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 9914def7-b676-4fda-8815-5d49fb3b45c8 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Yk8XOQq/H64TBm8jZ6Q1AWWvvBiwercDMiHAfyHsoKRuONmEvtoKe86ywh85aBq6BCM7WxnPbYqmVI3IBB8mAPnq4Ce7cBcXUFlZCtvxBis= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR1P264MB2206 X-Rspamd-Queue-Id: 2D8FC1C0008 X-Stat-Signature: 5rambxxamizxqyru7c4mpjgdy9t36tbs Authentication-Results: imf20.hostedemail.com; dkim=none; spf=pass (imf20.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 40.107.9.89 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu; dmarc=none X-Rspamd-Server: rspam03 X-HE-Tag: 1642754530-611677 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: Commit e7142bf5d231 ("arm64, mm: make randomization selected by generic topdown mmap layout") introduced a default version of arch_randomize_brk() provided when CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT is selected. powerpc could select CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT but needs to provide its own arch_randomize_brk(). In order to allow that, define generic version of arch_randomize_brk() as a __weak symbol. Cc: Alexandre Ghiti Signed-off-by: Christophe Leroy --- mm/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/util.c b/mm/util.c index 741ba32a43ac..46d1a2dd7a32 100644 --- a/mm/util.c +++ b/mm/util.c @@ -344,7 +344,7 @@ unsigned long randomize_stack_top(unsigned long stack_top) } #ifdef CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT -unsigned long arch_randomize_brk(struct mm_struct *mm) +unsigned long __weak arch_randomize_brk(struct mm_struct *mm) { /* Is the current task 32bit ? */ if (!IS_ENABLED(CONFIG_64BIT) || is_compat_task())