From patchwork Wed Dec 15 06:45:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12677563 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 41EC3C433EF for ; Wed, 15 Dec 2021 06:45:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 85C296B0071; Wed, 15 Dec 2021 01:45:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 80BFA6B0073; Wed, 15 Dec 2021 01:45:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6AC736B0074; Wed, 15 Dec 2021 01:45:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0074.hostedemail.com [216.40.44.74]) by kanga.kvack.org (Postfix) with ESMTP id 5B91B6B0071 for ; Wed, 15 Dec 2021 01:45:26 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 1614C8849F for ; Wed, 15 Dec 2021 06:45:16 +0000 (UTC) X-FDA: 78919091832.17.C187623 Received: from FRA01-MR2-obe.outbound.protection.outlook.com (mail-eopbgr90052.outbound.protection.outlook.com [40.107.9.52]) by imf06.hostedemail.com (Postfix) with ESMTP id 431CA180006 for ; Wed, 15 Dec 2021 06:45:13 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AUHeP1gEvZEgjrlh5EUkLoSwaiHBdnjn8wIziQWxy7mNsFpFDaGxvGYYf0E/kmO3GOobur3GXC/aZ+7UIKSimiAwXc19fQ9jhoDJye/U33/J87GC19gGzzxOHAHleECnfI2jknXVrodVFkgG5xmqA2Mg6bxAGcxwQsqyPB9WArtb3BU4yYlO+uiaqnssr6q6m3lOED7z6iQvV4GIbhQP0eD750tEls1olsb/xmEHkCTXv+/NrxgSeHbpETQgozP9bTW1YDxciTr/hmO+IgdRExZwi331MU6+qxqi9pPGA8WvQgB05B/z9flCrtBozq8umqpF2H/vZPXbchgc06Yx6Q== 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=YBu/rNZbVR5tsc/OSVit3IKOiXeebF/e/ouhfG4ijHsF46Aza5Tk8L+m7wLxr4LHNUJg6texK6uyQ3Gd7NA7eDcmt+NFx+Rz7gVtISNUK/OUcLdgCz8GGWgBIbC6mDZV3M2v73IdL8RZKuM9tRDSHZL2w+Yj7YH73izqtdDaGkRIL7aIPN2poKn72RnArcYg2tA5hJ2APEpBkxlWIZpIS8DhFW9A2d7EUz+9V2RnPSFjWVwWFAkvarckJhrexsLcM7OFw2g64PEFf4pz5YCLpPwUjn89syTs/qJ1QPt1NSXR/cRc2MXKpMLQ+ZJrj25A0m3nPOdou8OAZ6T6X3Z28A== 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 MR1P264MB2147.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:11::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.16; Wed, 15 Dec 2021 06:45:11 +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.4778.018; Wed, 15 Dec 2021 06:45:11 +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 v5 01/11] mm: Allow arch specific arch_randomize_brk() with CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT Thread-Topic: [PATCH v5 01/11] mm: Allow arch specific arch_randomize_brk() with CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT Thread-Index: AQHX8X9O5i5ZFBctQkOLkg7QNFqn7g== Date: Wed, 15 Dec 2021 06:45:11 +0000 Message-ID: <961336afce7a10ecc4e68021246772ee239dbc84.1639550392.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: 9802936d-ce33-4d4e-9e80-08d9bf967153 x-ms-traffictypediagnostic: MR1P264MB2147: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: vgZMCLDyaBr5fAUJrqG7mHoFcsTqwsG69NZeV7AgWsafI1eneMg3TtQEd7Sje1YJtP8euJKncXHGpz1PTgpTl8vebx5j4O7XmChijr1SpTpXbad6oYDkN/1rRaMuFHjiy2ieghKn7wRspU7JXFwNGE1NBBBy1dI8+XSS0GLYRapEvtqGBDn3NoC/xW+FQpxPc2UGATyqNY5bZSfObaALXmxwAOzT/7DNC2hpytLbKcuTQubvJy25WPsf2OVtAfEAXJJBb3utxsnnk2/GyH/A5050K8jwdtseSSCQGwzykEVV6Dd3SM20GpotV/t7UKvOZM+/x09ltd4sd1FmRHqAHNJM0QfeMlU7EemYYsQFPNzlr16CQzHJQCGQrkAqtMz052hnVODvBXPd+gkvUI9pXjfNAZE+YB84hlHF0URcKtMNwQ2cdZ2ph9eYzlxrSfaKC7j6r+smr0oRzTyytqrWlSyyLyPLcOTk0mROV3//StebX6uH9UUbMmj3pf6qixq/CIymZfE/v/kxE8qayxD1r/Z0Y4ijTVUSuXjVqLBt7B3hXv0fwiIQQaaKqRpCcRdf1NjD++UtVm/4Rqp0j/F39+QYGzVJjcnrCiwPL+BJuP7BE7FpQjlAZeJPlI5FqgXqv3DoRs6e02AIB7FlHVs+yt9ry/dmmEfQXEmu0BH1S3OneTQgosDpmR+OBbiCh5YD6jJ2Jwc/zzfmWo32xKNmpw== 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)(110136005)(36756003)(6486002)(2906002)(86362001)(5660300002)(508600001)(26005)(186003)(38100700002)(8936002)(44832011)(54906003)(316002)(66556008)(66446008)(66476007)(64756008)(6506007)(76116006)(91956017)(8676002)(66946007)(4326008)(2616005)(4744005)(122000001)(83380400001)(6512007)(71200400001)(38070700005)(7416002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?oR2v3J4xwyotNZVkC5299Rp?= =?iso-8859-1?q?izXG6DXXGn5dY0nBZwaUfG8P5kMEWT04mzcf/9/Tj427PTS6ig07zUM1mG83?= =?iso-8859-1?q?ScaBYCj6MBKNfiZ/kRz2DLNw6QbX/qWd1AqKs2exPx/1+Mv49Siz6PLKCC7D?= =?iso-8859-1?q?6isOCX7L0OB5P51dwtyOMc1QCZbgxUEkzNRbsstqtRpSfS4NUBpHtsHmcHQh?= =?iso-8859-1?q?9Dun8/Cg+tPd1FxYEetgpiFiC0lMINUA7hBhjHmb5Yt86XPJOiclNK++F3ya?= =?iso-8859-1?q?uwHERQumadHjFFSMz3gMn5VHh8L0+klMZK4ZgIhSIIu6FF8noY4RJh4ukU3Q?= =?iso-8859-1?q?ElQY+Nx6V0J9rOh1qNA5PcH6ns0j3AT9zTQPCD/YpJdHNT8FgxZehJY13E8I?= =?iso-8859-1?q?/f3MiQ33XIKuYxw29eRxlJ9H7ELVyTwGC3ZpE0EsPx/CY5m8mKM1TJF6gbMz?= =?iso-8859-1?q?g0KRvmfVhMDWa1CULffVJmoprhia+Vfo+VWfaK0/6TozA23A7qYBp8O5pPR5?= =?iso-8859-1?q?AybFitwH4v++x2TLlokoSURyySVxr3fvo5ZIH3VU67E4MiRKpfbAB6zGerUB?= =?iso-8859-1?q?OoldyRW7fbvYLM5DgipJ8S4qbzKlMBLoWKcoTtH0PgZeMnPShsWLRQWDc30R?= =?iso-8859-1?q?i1Ics9dbwAFvJKwYvbuMkVv1Nanfncm/4b9TOsDRAO875x4v3/YJZgh0qgxi?= =?iso-8859-1?q?1xodWuj27Ur34ud7CWJU6lHt+vA6b4a6iYExkytMBoF7kzW85Krjw9ehmcEn?= =?iso-8859-1?q?kQA8oUUbEzMemn3FN+hamsvrFtaxdQD4SrFjxJLFqLei3K3mt/e5smpCcl8M?= =?iso-8859-1?q?LSYLFiDxHx8lKHexgMV7LkmDkogpIJDP2aWD9Ct0P5It+rif8DFwJsB/epy0?= =?iso-8859-1?q?2CBsF3lATzw0iydZyNEDmbVb0SNseUx+3EOGQP3bn4IFAzv3v9jnGvdEZzyt?= =?iso-8859-1?q?C1xKK2xT18D1CkV97fBxUt5p7oQGq1Uq71lSGaZUipTrY4zrf4hpiqKsEmqh?= =?iso-8859-1?q?Md4UzmokxENVr9mmlyrnOyqIrSVmvAkDGFADHEnvGzUj9ADCShSySsce9G7m?= =?iso-8859-1?q?2+PFbCs2Tq9F9KhiXmm016H6oyqjetUP80pYyiieh54AcxFEN2nwdMEGaZ0i?= =?iso-8859-1?q?zd17E7+s0oFn6vYdXr4+uP/mcBTxOXbtQuaAogdc09zEucWZGk9SdaCP33j3?= =?iso-8859-1?q?mhVQ194+STxFA++wLc4yf2Mr0d6BWG5BEMWhd/dK0lUiPVGkMOaYf3DWqknS?= =?iso-8859-1?q?7QO7h/iszB1rIVqRAgnTi+x9VAF5R22GcnaoelivWXBC9gZiZEXjkzD92uvd?= =?iso-8859-1?q?khHb7Ta2oApAgr9q8Evx7b1Ewg7eUTjF4SkF24/lZri8xOZEfHXIxidAWIiu?= =?iso-8859-1?q?kFJvAhTa9hrDa5i50EIDvDWEgyShhQd2HK/ivOlTbjUXpNLh6ahNjJWCUbF1?= =?iso-8859-1?q?CSDUc+mMSbYjHLW5a0dOCChU+7oSrmIQ5FnAQtqKILYPb3zUmMbxkrVL0c7a?= =?iso-8859-1?q?PbmIWtEyvo5k4cQa6aSCptwrcdCMThiorXdrJFELzOVehzUhbB79rQQ5j/tH?= =?iso-8859-1?q?tXN/9OuF1MEYSDNrGqaUeHMiF01UA3vv9cjWsN4kGdmm+HVeTBw3oSateGk8?= =?iso-8859-1?q?CFeMj1eMI1Fjt9eUEn1+u/231pTDXYZuq02hiG6BKxLF8blcaJN2keyRJN4q?= =?iso-8859-1?q?bBVZnuAFIzihuyHZSadM0sdzlOyWqmYAo6hE3oeeu5njX3FP4sGqmJY7+4IC?= =?iso-8859-1?q?uGuA=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: 9802936d-ce33-4d4e-9e80-08d9bf967153 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Dec 2021 06:45:11.2739 (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: ntzYLw0v9+dVumhMfq5NO7Yf2/Bz7N8g++LaODTIdgpVsGOsB3O+sZ9XdoqRtbeZAPY4tcRzYp5pEsrxOkc2kJgWTQg80q7QrJuaCW70lb4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MR1P264MB2147 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 431CA180006 X-Stat-Signature: tnpttksxyue1yojhtekh45w55bt9gt57 Authentication-Results: imf06.hostedemail.com; dkim=none; spf=pass (imf06.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 40.107.9.52 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu; dmarc=none X-HE-Tag: 1639550713-316256 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())