From mboxrd@z Thu Jan 1 00:00:00 1970 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 E5C2BC433EF for ; Mon, 7 Feb 2022 20:25:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5E7F96B0074; Mon, 7 Feb 2022 15:25:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 570DF6B0075; Mon, 7 Feb 2022 15:25:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 410CB6B0078; Mon, 7 Feb 2022 15:25:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0118.hostedemail.com [216.40.44.118]) by kanga.kvack.org (Postfix) with ESMTP id 3248E6B0074 for ; Mon, 7 Feb 2022 15:25:26 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id E946D181C49CB for ; Mon, 7 Feb 2022 20:25:25 +0000 (UTC) X-FDA: 79117113810.24.DDAA312 Received: from 16.mo583.mail-out.ovh.net (16.mo583.mail-out.ovh.net [87.98.174.144]) by imf06.hostedemail.com (Postfix) with ESMTP id 32341180005 for ; Mon, 7 Feb 2022 20:25:25 +0000 (UTC) Received: from player696.ha.ovh.net (unknown [10.109.143.220]) by mo583.mail-out.ovh.net (Postfix) with ESMTP id 6DB6422BB0 for ; Mon, 7 Feb 2022 20:25:23 +0000 (UTC) Received: from sk2.org (82-65-25-201.subs.proxad.net [82.65.25.201]) (Authenticated sender: steve@sk2.org) by player696.ha.ovh.net (Postfix) with ESMTPSA id 154781CFCE83A; Mon, 7 Feb 2022 20:25:16 +0000 (UTC) X-OVh-ClientIp:82.65.25.201 Date: Mon, 7 Feb 2022 21:25:08 +0100 From: Stephen Kitt To: Christophe Leroy Cc: Miaohe Lin , , , Kees Cook , Andrew Morton Subject: Re: [PATCH] mm: Remove usercopy_warn() Message-ID: <20220207212508.432a6894@heffalump.sk2.org> In-Reply-To: References: <5f26643fc70b05f8455b60b99c30c17d635fa640.1644231910.git.christophe.leroy@csgroup.eu> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/BTXhOGVfCk=eNZZtoTesO7u"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Ovh-Tracer-Id: 9237445785914672774 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvvddrheehgddufeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepfffhvffukfgjfhfogggtsehgtderreertddvnecuhfhrohhmpefuthgvphhhvghnucfmihhtthcuoehsthgvvhgvsehskhdvrdhorhhgqeenucggtffrrghtthgvrhhnpeejkeffvdfhjeekffdukeehvddtvdfhieehhedvheekteekudefjeffueeuvedvvdenucfkpheptddrtddrtddrtddpkedvrdeihedrvdehrddvtddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpohhuthdphhgvlhhopehplhgrhigvrheileeirdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepshhtvghvvgesshhkvddrohhrghdpnhgspghrtghpthhtohepuddprhgtphhtthhopehlihhnuhigqdhmmheskhhvrggtkhdrohhrgh X-Stat-Signature: y1w3yguid917pjwqd6ur78ryxtxx7i4e X-Rspam-User: nil Authentication-Results: imf06.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf06.hostedemail.com: domain of steve@sk2.org designates 87.98.174.144 as permitted sender) smtp.mailfrom=steve@sk2.org X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 32341180005 X-HE-Tag: 1644265525-355348 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: --Sig_/BTXhOGVfCk=eNZZtoTesO7u Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Mon, 7 Feb 2022 20:25:19 +0800, Miaohe Lin wrote: > On 2022/2/7 19:05, Christophe Leroy wrote: > > Users of usercopy_warn() were removed by > > commit 53944f171a89 ("mm: remove HARDENED_USERCOPY_FALLBACK") > >=20 > > Remote it. =20 >=20 > s/Remote/Remove/ >=20 > Except the above nit, this patch looks good to me. Thanks. >=20 > Reviewed-by: Miaohe Lin Likewise, Reviewed-by: Stephen Kitt > >=20 > > Cc: Stephen Kitt > > Cc: Kees Cook > > Signed-off-by: Christophe Leroy > > --- > > include/linux/uaccess.h | 2 -- > > mm/usercopy.c | 11 ----------- > > 2 files changed, 13 deletions(-) > >=20 > > diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h > > index ac0394087f7d..bca27b4e5eb2 100644 > > --- a/include/linux/uaccess.h > > +++ b/include/linux/uaccess.h > > @@ -401,8 +401,6 @@ static inline void user_access_restore(unsigned long > > flags) { } #endif > > =20 > > #ifdef CONFIG_HARDENED_USERCOPY > > -void usercopy_warn(const char *name, const char *detail, bool to_user, > > - unsigned long offset, unsigned long len); > > void __noreturn usercopy_abort(const char *name, const char *detail, > > bool to_user, unsigned long offset, > > unsigned long len); > > diff --git a/mm/usercopy.c b/mm/usercopy.c > > index d0d268135d96..e7b0cb49daa1 100644 > > --- a/mm/usercopy.c > > +++ b/mm/usercopy.c > > @@ -70,17 +70,6 @@ static noinline int check_stack_object(const void > > *obj, unsigned long len) > > * kmem_cache_create_usercopy() function to create the cache (and > > * carefully audit the whitelist range). > > */ > > -void usercopy_warn(const char *name, const char *detail, bool to_user, > > - unsigned long offset, unsigned long len) > > -{ > > - WARN_ONCE(1, "Bad or missing usercopy whitelist? Kernel memory > > %s attempt detected %s %s%s%s%s (offset %lu, size %lu)!\n", > > - to_user ? "exposure" : "overwrite", > > - to_user ? "from" : "to", > > - name ? : "unknown?!", > > - detail ? " '" : "", detail ? : "", detail ? "'" : "", > > - offset, len); > > -} > > - > > void __noreturn usercopy_abort(const char *name, const char *detail, > > bool to_user, unsigned long offset, > > unsigned long len) > > =20 >=20 --Sig_/BTXhOGVfCk=eNZZtoTesO7u Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEnPVX/hPLkMoq7x0ggNMC9Yhtg5wFAmIBgCQACgkQgNMC9Yht g5yLtg//ZTIlI9ZMBzHv0WwyUdxM+A7Zt9ud+2LrYM4Y45YUnO2ZVhuYEYMfyvN5 7W7I+SbijmY6NlwDFlFV5tqomeJYC1u4eNqJL1owcpGT6wz6XkOPo2O28VYv2/Z5 Kq5CUP9HLxxhLICwC61rcCDz+uezwe+6OzfGl6SphlDCLng+XHiKky7gPJeL6o31 zmE1O1jFovodFjjP0hKw0Zla3aQnxBWEUPZxSH4bij/5yBKc9JG2EpiUm3YsDb5q aBU6ZOi3LuDhXvxrqak70jG72jpITSyzLcC8Ob0aWDcA6uA5OFckE7mIYm26FpBN ke1wDkBB02UYsr6qJ7LFFkdxFRAFY6En2eEHyksDp8R27BGLk7q9ca3yO4noO+4Y xq46iAZo8Sl2SFSPXc2PjaOc0wt41dJFnduK6OoYukQRBXQ8OENcOijcO598tGwt Rq4p1Ltu82N7U9+WnrANydDgU1D4oC8ldqqVmC1JIfCaGuSti+97S9iiQRH5hwXF LUH5IdSi2Acax2w5gMHF0NRInJMx0C7yHAdcgNpCsSMCP8NBTbmKChKR2UMZlsq9 2lBtYjbdTNCds/HfbtD1NGAWk5PYtOgrOsTR9GhsTxXTaxROylxW/KslF7F4Y6IV nX0xXW914tejTbOH9sm28U+PxDhQz6boGjf0bz3fwMhvhtWnEWM= =c9dy -----END PGP SIGNATURE----- --Sig_/BTXhOGVfCk=eNZZtoTesO7u--