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 F1CCCC433FE for ; Tue, 15 Feb 2022 09:18:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7F5816B0078; Tue, 15 Feb 2022 04:18:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 77DFB6B007B; Tue, 15 Feb 2022 04:18:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 61EF36B007D; Tue, 15 Feb 2022 04:18:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0227.hostedemail.com [216.40.44.227]) by kanga.kvack.org (Postfix) with ESMTP id 4D9076B0078 for ; Tue, 15 Feb 2022 04:18:36 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 04C7B180AD837 for ; Tue, 15 Feb 2022 09:18:36 +0000 (UTC) X-FDA: 79144463832.13.2DE22FC Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf12.hostedemail.com (Postfix) with ESMTP id 8695C40007 for ; Tue, 15 Feb 2022 09:18:35 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A1ECF60A6B for ; Tue, 15 Feb 2022 09:18:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0734C340F5 for ; Tue, 15 Feb 2022 09:18:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644916713; bh=auvbexz8OfCE17jezkrwExlxQUSMdLXG0OAD2bmLs8A=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=R1Pf445AMn7iEf0TcHJGtZqUinPVYRIlRYIhUK+pqFhNMydlmGdLOnDcwqdoOpcxv rM+QtlC5MX40dddlY60U1EemOtvK01KeP4rBm30AWnHXp/wG3B2AqNZ0rlunLaOMbW tr7Vs0w/mpIoN0XApZa80K1xHxowMUZXp7dP4/BbBM9W+v5sudL1uLbQT49sSxdXFp TQxXAYDRaUN8F2rMT1u+N/nJuunLdz+VObtLisWpW965HLfjJNrl621lEvA4NBgly+ FEKN2xUIJ9o0fBCy3UJA1PmxKT+NsxLFmCAClaf0u/3M6fW1/dPCwNdFwRQIJqLuEw iPMY1EoXY49Bg== Received: by mail-wr1-f43.google.com with SMTP id q7so30847639wrc.13 for ; Tue, 15 Feb 2022 01:18:32 -0800 (PST) X-Gm-Message-State: AOAM5339MbkabHtXZnnagtZaj8Jo1uef5iZp1Pq3/T1KGr9k+o9NTEfT JsIZVJvHFzfArGiRLNY4f1JJqKYwU6o06kK04iY= X-Google-Smtp-Source: ABdhPJytLoTfipZUwnG73E442/QjIxHnERGjQ2aeR9o7LjnpbatwjsLI+Mk7641j6VpHXtVWtwvDTIufUdUsOw5At+o= X-Received: by 2002:a5d:5446:: with SMTP id w6mr2390801wrv.12.1644916711299; Tue, 15 Feb 2022 01:18:31 -0800 (PST) MIME-Version: 1.0 References: <20220214163452.1568807-1-arnd@kernel.org> <20220214163452.1568807-4-arnd@kernel.org> In-Reply-To: From: Arnd Bergmann Date: Tue, 15 Feb 2022 10:18:15 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 03/14] nds32: fix access_ok() checks in get/put_user To: Christoph Hellwig Cc: Linus Torvalds , Christoph Hellwig , linux-arch , Linux-MM , Linux API , Arnd Bergmann , Linux Kernel Mailing List , Mark Rutland , Rich Felker , linux-ia64@vger.kernel.org, Linux-sh list , Peter Zijlstra , Max Filippov , Guo Ren , sparclinux , "open list:QUALCOMM HEXAGON..." , linux-riscv , Will Deacon , Ard Biesheuvel , linux-s390 , Brian Cain , Helge Deller , "the arch/x86 maintainers" , Russell King - ARM Linux , linux-csky@vger.kernel.org, Ingo Molnar , Geert Uytterhoeven , "open list:SYNOPSYS ARC ARCHITECTURE" , "open list:TENSILICA XTENSA PORT (xtensa)" , Heiko Carstens , alpha , linux-um , linux-m68k , Openrisc , Greentime Hu , Stafford Horne , Linux ARM , Michal Simek , Thomas Bogendoerfer , Parisc List , Nick Hu , "open list:BROADCOM NVRAM DRIVER" , "# 3.4.x" , Dinh Nguyen , "Eric W . Biederman" , Richard Weinberger , Andrew Morton , linuxppc-dev , David Miller Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 8695C40007 X-Rspam-User: Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=R1Pf445A; spf=pass (imf12.hostedemail.com: domain of arnd@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=arnd@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Stat-Signature: oikwuaojkwbw16cf57gce947f547no6a X-HE-Tag: 1644916715-18600 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: On Mon, Feb 14, 2022 at 6:01 PM Christoph Hellwig wrote: > > On Mon, Feb 14, 2022 at 05:34:41PM +0100, Arnd Bergmann wrote: > > From: Arnd Bergmann > > > > The get_user()/put_user() functions are meant to check for > > access_ok(), while the __get_user()/__put_user() functions > > don't. > > > > This broke in 4.19 for nds32, when it gained an extraneous > > check in __get_user(), but lost the check it needs in > > __put_user(). > > Can we follow the lead of MIPS (which this was originally copied > from I think) and kill the pointless __get/put_user_check wrapper > that just obsfucate the code? I had another look, but I think that would be a bigger change than I want to have in a fix for stable backports, as nds32 also uses the _check versions in __{get,put}_user_error. If we instead clean it up in a separate patch, it should be done for all eight architectures that do the same thing, but at that point, the time seems better spent at coming up with a new set of calling conventions that work with asm-goto. Arnd