From patchwork Wed Dec 8 17:18:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12664907 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 F30DBC433EF for ; Wed, 8 Dec 2021 17:18:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EC70E6B0073; Wed, 8 Dec 2021 12:18:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E75FA6B0074; Wed, 8 Dec 2021 12:18:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CEEEB6B0075; Wed, 8 Dec 2021 12:18:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0067.hostedemail.com [216.40.44.67]) by kanga.kvack.org (Postfix) with ESMTP id C0FF46B0073 for ; Wed, 8 Dec 2021 12:18:31 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 85E058245578 for ; Wed, 8 Dec 2021 17:18:21 +0000 (UTC) X-FDA: 78895285602.09.ADEC5EC Received: from FRA01-PR2-obe.outbound.protection.outlook.com (mail-eopbgr120048.outbound.protection.outlook.com [40.107.12.48]) by imf04.hostedemail.com (Postfix) with ESMTP id F268040002 for ; Wed, 8 Dec 2021 17:18:20 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LE/s6+WRbMDbfUncsYoBUC9WNZEatc0K0R7Yzyl4x5r1ml9XGBlsrHxU6aUzkVeF1aSIZAWj9AlYeF1kfHW/UBygy+BUyNMdpdnLcqSHQY7C07CMtBAo7T1Ckg6LQ3zn2N7emys4/u5kSGbAQxKanAaerbAoxrc//pfQwztTGF7B//2IaDULlsDFWJL5A33QGbcjZwUaH6LAU837y3QpuNHQv6Qj1HwTTKBmmGFhjooFAcOe4fL1a2E5wFkzCvV398jTAUMZYfyEhVJHaeIt2Lx2dJeapNpkT3fDo2BH4xpsl4s94ayFDUl1EYwUZaopwIG+yJWoFvSfc3GdaH8ifg== 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=h3fUGFXwPFbNzmOmiKKth9884dmg9d1gmKik929ZFnD5fdG5rERTR+pOF/QNGMs7Gd9Lw1PGA8Sbd088pn2HGd2JjCfvFIu1vXw5EbvOrJp6SPw7jfqYbp2NwPFkmfpGdiQpPmj43khdiljNOtUuCJF9VpQpI0o6wuInDGUIPe5MQOjcAJrEzeJtG2o61Ercb2GuCHmNN9x1VFW7Z8xrrQXWMxDLIfZ5KiemEZ/Xm/XTDOMMWRVXBsg5oTsB4ZargWPOe+/OLblejn6meBt8s5GNlWdWGb1DzHGYQ6hA63ax342xSwyjSPw3CpNg2k9uV2FZWsUBK2pKHlCY/J9Frw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=csgroup.eu; dmarc=pass action=none header.from=csgroup.eu; dkim=pass header.d=csgroup.eu; arc=none Received: from MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:31::15) by MR2P264MB0228.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.12; Wed, 8 Dec 2021 17:18:17 +0000 Received: from MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM ([fe80::fc67:d895:7965:663f]) by MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM ([fe80::fc67:d895:7965:663f%2]) with mapi id 15.20.4755.022; Wed, 8 Dec 2021 17:18:17 +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" Subject: [PATCH v4 01/10] mm: Allow arch specific arch_randomize_brk() with CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT Thread-Topic: [PATCH v4 01/10] mm: Allow arch specific arch_randomize_brk() with CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT Thread-Index: AQHX7FeXvLiXZmbMIE6c9kZusjZ8EQ== Date: Wed, 8 Dec 2021 17:18:17 +0000 Message-ID: <75bf69360af50be65643a1f02ccbbadac9eb3157.1638976229.git.christophe.leroy@csgroup.eu> 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: 3d1cb298-bcc0-4687-358e-08d9ba6eb9ef x-ms-traffictypediagnostic: MR2P264MB0228: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: tWItzkakzdTfEjSoU2u2PoZgH60sVieVzMXN4/ef+2mQfejo4LVfjuO1pU1lS1E40KwHN3QMRpEN8pJ/pnC66ojNoO0fiXRmh2wlOEfUmO8ZfRquCQc57c8td55ahe0tOHdoJ9b4e3CIsUKlezaj0885Yi3AO1l0qToA/l10xwsmXkBiwe6EAmgh5dxVZMyDK6d+IGnbOWDzifKsoeTyBKI5brhl4hDOw92h+uoALyElCJmDubUhFs0Po3n0sRVPoxedhOZ6cCo1OJDzCmcgwLXjsO9PJUfcqRu1piifI0TsQLWLTloeaQKMxDCiuWj85UE9gzU6Ai2bYj3OH2jUJPDfaZOz69UMYikMV0pd9rCibIhtpoXiUtDuz+ESsLPX6gdvJh/EpVZy1t+UdKicbN7kWldKXBgkIXrn20PT+N9hUvFECSwcjl5hLFEwZOgjfjskGaqT07KIscnzBCR1UdXRXtY6lDVFJ1pow49XS0XxVX9NentBllURcViDzbExPwU4niIlkQXyxiz1qUgo/qQDyv67Qmz2WHGODDc86nTIP6NlEbXqoMw1/n9iv1EJ7a6N1/CqyuZ8lp0mKU+XWNxnB8D24H+5oc7uz/C4z6R2CuGncdX/1MEuULkyKX9wHmqJYLXifIRXxqVATDX+RMDZUBN/jQQ1x097KXZO5Uw57d390yUaMirj+cL/r97VXLYb86Zs1QQoQ1Ls7YBZuA== 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)(2616005)(91956017)(76116006)(66946007)(122000001)(4744005)(5660300002)(38100700002)(66476007)(44832011)(6512007)(64756008)(66446008)(6486002)(66556008)(8676002)(86362001)(4326008)(8936002)(54906003)(508600001)(36756003)(71200400001)(38070700005)(316002)(83380400001)(26005)(110136005)(6506007)(2906002)(186003);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?juKbev/1O23S7CAZaDCSmBC?= =?iso-8859-1?q?K/CLdeUb/Us+Vif2uWPIYrxV2PQypIkgEfdWuOGZpTudManVyKQe4Xhp1NiH?= =?iso-8859-1?q?f87hLsu0ZdymiUsn7qGgNzOQF1Ye6o0O2cDPmXrYHCxByoNxG7X5PsgK0YFL?= =?iso-8859-1?q?JFwKsSiN75tlZ40kG7F7YFSeGxBqJkjx2l+oEmia4eRyOosykvakEngbSBzf?= =?iso-8859-1?q?VxS2jnMEzHHeYkQTnDoxVMwGNE/jHiLFWPC4SwbEKpqC+mrXhxwPTqhTB3P7?= =?iso-8859-1?q?BMW4xD9gxmWf0+BmryC2Fox/Lr519f+LEv3pCcMyRx0GtMMcoovsEE4hHHTV?= =?iso-8859-1?q?J8tzxW+JBqXTmliRFpI6eVw5FBwi/KA2NE1ZeM6DUjAw2piY8HL4UFm4AotP?= =?iso-8859-1?q?EDhByCR42cOAbK5s8t4lRiRxTOaZCeB2OmVd6H2jVbqbwHexLFuVP8evHWTq?= =?iso-8859-1?q?0Bg2RrRxYSTrLovzWlFL6c0j8Pz5h8r6zCBrK3pBW5XkuC9DqmI/JjHpVwqa?= =?iso-8859-1?q?2Y1YR1hapGN96Yb/kutudElOARL9H0qP1PZiflqVcD+ItBUyouhTjXN7i336?= =?iso-8859-1?q?qorhbFrVZRNSLklIV5t38pyZY72HnVq7/buJaj52VdK2WLOajjoUIKAjjNkL?= =?iso-8859-1?q?CNIZgH1dlcGW1vhCS/qJErkrdox3NJCVGtu0c04fbiFFkc/EeU1wi4d/0Rz8?= =?iso-8859-1?q?GsuJUX/SOWoI2B0TbQF1yWg5vWUYF1cJjoeyXrXNu48w/SmC+Rh0tgjJsOan?= =?iso-8859-1?q?MbncXcfZcnkNEn++2eLDQOLBvKvi5jJl/42xTRKe2Jqi/E5H2Cch6XunhUwE?= =?iso-8859-1?q?8CgOme1awo7SoVwt2KkC0NcGBgYuBki2uE7+X2QRdLP/03SEI3XefEuYGX0S?= =?iso-8859-1?q?0t3Lai46EaTMog9zwqCFwIpmzmM0qYgvK7kTo9vtiFJGE7lJWydiAuSE6EdM?= =?iso-8859-1?q?rwgj+swRtl9hQvj1dMbrZ2lZbAYXeesSg/sd74/DQmBQM7hMdT3j9YT5qJ4U?= =?iso-8859-1?q?lcSFfeA/kEm784mCZ5VcOuvMRNCBt8RYxT3dLg+jLMlUXhjzmtyukJVcccd/?= =?iso-8859-1?q?z0hZMdGSpPaj8SGdC/P//bRT7Q3X0DPJ871Y8xQpwJRqsOPTB9vP1x/u1Ku6?= =?iso-8859-1?q?S7KwrCeuDxj+Ouadtth2xpPqAckyE0TRA9i8+eSAaf8op1P7OIy1Jyt884jA?= =?iso-8859-1?q?7R/dImKEsDXUZLvnGVAB1hetnJva/Py7AjK80sXrgiRrG10MHQHmgVkMO97N?= =?iso-8859-1?q?aKyHTam5aca48SaSgwek31FKtr/gj34+eG8HZWhHX1gWYl4oK3Ew9MY4Mjda?= =?iso-8859-1?q?zAJV2p59SL7N0SEOsQwiK51qF63b1X4VYL77pqmtgTPH8e1D19zlgcKHNsWM?= =?iso-8859-1?q?B9QiTYGfbIjpDGnhAcd9eTlWLv0t80NTCgaX7GYl4GfEudHElLwujCWxw0o3?= =?iso-8859-1?q?QDiNT20YXd8yNPKk+km4l4pdOzZEo9AxDdiU4vnU6WEzP8TlP2Y9nOPzGysS?= =?iso-8859-1?q?hMGUjDz5DvioqA6Q/DlCXf1+bZivBNVLVBfivhjTNgpjgbGBVNY87cHsIqRZ?= =?iso-8859-1?q?Hq5BF9/xLN/8TMSAFWxdVkOIL9tNtPGMAa+WW93Owz0bIODtsmCFyvfkEwwI?= =?iso-8859-1?q?G58Lq7Cnn2SuNHCMdQNrrE+TUney1VYpzhusTg8W1xIEBoXIebPJBTyFMgxu?= =?iso-8859-1?q?nq2ZYJv7wTwUkbb3hCJh3jYgmn8DC0xu8MBwaGoYgd9LXQa/GmDdjIkiGQ49?= =?iso-8859-1?q?AaZE=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: 3d1cb298-bcc0-4687-358e-08d9ba6eb9ef X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Dec 2021 17:18:17.6962 (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: 6PuNUaWXPQTEPG/xTIg4OKZqHDRaOFlLZ1qyFRNU2VGcghBpLIxJYWbI6lbn6ldUAKSW9qfpzP9K5ECLmZ/1c8poFiXusX37JvDJ62iRp8A= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MR2P264MB0228 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: F268040002 X-Stat-Signature: 6goncsk8iye7igiahziw4zg4q18w9ynd Authentication-Results: imf04.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf04.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 40.107.12.48 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu X-HE-Tag: 1638983900-776871 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())