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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D12CFC433EF for ; Mon, 14 Feb 2022 19:47:07 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4JyF9P6qf0z3cPd for ; Tue, 15 Feb 2022 06:47:05 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=TI55dNwj; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=2604:1380:4601:e00::1; helo=ams.source.kernel.org; envelope-from=arnd@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=TI55dNwj; dkim-atps=neutral Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4JyF8c5311z2yfc for ; Tue, 15 Feb 2022 06:46:24 +1100 (AEDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id 64773B81257 for ; Mon, 14 Feb 2022 19:46:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D5B0C340E9 for ; Mon, 14 Feb 2022 19:46:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644867980; bh=kZ0Ha+ZttRWbRYErkpKyuJC1dyK+QrO2i6Uu5KgHMvM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=TI55dNwjd34X3cSV/R8wDeTsb/jSwyQlCZyHL8eu7Ic1oIyOUVL+4rSQVgDcoP8Sj 1PVP/2FxK28M6D6pl5spQ8ViEdjm0asBiIQ3QaGMRSNGXtdQwYM0C1pyauS+768E7z /7ozMU3ZgPrBst3JRTF6f4wLTGM0Y2MXaeKVBAVqNtdt1rwDh6l/uj/fP+2o65aVwU DK4OU3Cu8+XjClTput1qYc3H4kir+aqyouyEftPTymyGX5nkytf3U4k4kODfZt5krg f2J2BVoV77x29P9gcslC02lh0sSCMwpso6r1gtaCVIUlvY0e+uOPgwPCjSsCIMFRg4 daQLLHhhTNb0g== Received: by mail-ej1-f47.google.com with SMTP id jg20so14721181ejc.3 for ; Mon, 14 Feb 2022 11:46:20 -0800 (PST) X-Gm-Message-State: AOAM530HLNICShRRuO7Y6/EoQHyybjfeabWMPPpto2vQe8qbWbWxYqVw mB9iiCkZYI/aRhZXkE/7RGwXRctumV1dVHk4bGc= X-Google-Smtp-Source: ABdhPJyfeYwWpAfp1t9O1z8BIiteD6oMiQUhUFLNHvAQyjgPbxD0FyJauHtAzbL5TNr8UyIGWRM1U9VPuoeyXIyyYo0= X-Received: by 2002:adf:f6ce:: with SMTP id y14mr445399wrp.219.1644867968239; Mon, 14 Feb 2022 11:46:08 -0800 (PST) MIME-Version: 1.0 References: <20220214163452.1568807-1-arnd@kernel.org> <20220214163452.1568807-5-arnd@kernel.org> In-Reply-To: From: Arnd Bergmann Date: Mon, 14 Feb 2022 20:45:52 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 04/14] x86: use more conventional access_ok() definition To: Christoph Hellwig Content-Type: text/plain; charset="UTF-8" X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Rich Felker , linux-ia64@vger.kernel.org, Linux-sh list , Peter Zijlstra , "open list:BROADCOM NVRAM DRIVER" , Max Filippov , Guo Ren , sparclinux , linux-riscv , Will Deacon , Ard Biesheuvel , linux-arch , linux-s390 , Brian Cain , "open list:QUALCOMM HEXAGON..." , Helge Deller , the arch/x86 maintainers , Russell King - ARM Linux , linux-csky@vger.kernel.org, Christoph Hellwig , Ingo Molnar , Geert Uytterhoeven , "open list:SYNOPSYS ARC ARCHITECTURE" , "open list:TENSILICA XTENSA PORT \(xtensa\)" , Arnd Bergmann , Heiko Carstens , linux-um , linuxppc-dev , Richard Weinberger , linux-m68k , Openrisc , Greentime Hu , Stafford Horne , Linux ARM , Michal Simek , Thomas Bogendoerfer , Nick Hu , Parisc List , Linux-MM , Linux API , Linux Kernel Mailing List , Dinh Nguyen , "Eric W . Biederman" , alpha , Andrew Morton , Linus Torvalds , David Miller , Al Viro Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Mon, Feb 14, 2022 at 6:02 PM Christoph Hellwig wrote: > > On Mon, Feb 14, 2022 at 05:34:42PM +0100, Arnd Bergmann wrote: > > +#define __range_not_ok(addr, size, limit) (!__access_ok(addr, size)) > > +#define __chk_range_not_ok(addr, size, limit) (!__access_ok((void __user *)addr, size)) > > Can we just kill these off insted of letting themm obsfucate the code? As Al pointed out, they turned out to be necessary on sparc64, but the only definitions are on sparc64 and x86, so it's possible that they serve a similar purpose here, in which case changing the limit from TASK_SIZE to TASK_SIZE_MAX is probably wrong as well. So either I need to revert the original definition as I did on sparc64, or they can be removed completely. Hopefully Al or the x86 maintainers can clarify. Arnd