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 DD958C433EF for ; Mon, 14 Feb 2022 20:08:53 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4JyFfX1cT9z3cRP for ; Tue, 15 Feb 2022 07:08:52 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=google header.b=ZcumWtnh; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linuxfoundation.org (client-ip=2a00:1450:4864:20::533; helo=mail-ed1-x533.google.com; envelope-from=torvalds@linuxfoundation.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=google header.b=ZcumWtnh; dkim-atps=neutral Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4JyFdn0Gqvz2xBL for ; Tue, 15 Feb 2022 07:08:11 +1100 (AEDT) Received: by mail-ed1-x533.google.com with SMTP id y17so26781216edd.10 for ; Mon, 14 Feb 2022 12:08:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dgwPr3jWEXZiHeYJRBUfKrH3C5wLRAnP7Z6R5s1EJ5U=; b=ZcumWtnhggjMFDUHhywZOsPSWocj5WFiFD4wxX4meGi3Jv+FEek8bAx8wm544tPFuD FZMy/4sQc4BwvneObDdXEv1mNtlI8GPACMt1JW8whp1hkRcRU1/uCicaO7g7UXSaSO+q JQ0jz81cHBjFl3QlKdIkLJ7hR07DlS4kmaNNI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dgwPr3jWEXZiHeYJRBUfKrH3C5wLRAnP7Z6R5s1EJ5U=; b=yOPYyqZIIC1WD/0AOWm2UkZH/y6HP/VF4WBOZ9aUEulcnYS8aEO3dMX9zOXfrEWXB6 Y9luoIKUzCdF2J/O+5njXZNFsKO0tpOS/xUbd2JV/dZb7moaiP3EMn+wzD72WZXTnlMQ c3kRoDk0e5A49JUbshLXilnh89Xaqbzf8wPkXeCnuOHSrEzkj9978C/iS/ZIehuER271 HgC2hBuPOipqz1p2hOFBHrTULZjyzIVhvGnapJJq9lkoNx/HOk7BfV4hJuEN0Z1OKJIL Fg8rT2m3Cq3XzDPulYP26RbtfVa2X7ZVF7VP6/uGFuVygJYyHM3l0fjnoZm+7bYqow3b YIVA== X-Gm-Message-State: AOAM530llTgbHYkJAc3BzawN1RjFiXo6GZR7nSm/VoIRTp6hOJgk5Xkz JdJ2eP2lpkMqKHZO1mMokdPbJZFfzgmM0pflnjY= X-Google-Smtp-Source: ABdhPJx97f2pECVq2o5zEvbMmRn6Vs4DoYkGDnZD9cGtXYeJ0Jc9NCoYa785Kd4SQfYJs3n+4D4wBw== X-Received: by 2002:a50:9dca:: with SMTP id l10mr453944edk.311.1644869284082; Mon, 14 Feb 2022 12:08:04 -0800 (PST) Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com. [209.85.208.50]) by smtp.gmail.com with ESMTPSA id z3sm4041456edc.76.2022.02.14.12.08.03 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Feb 2022 12:08:03 -0800 (PST) Received: by mail-ed1-f50.google.com with SMTP id g7so12709284edb.5 for ; Mon, 14 Feb 2022 12:08:03 -0800 (PST) X-Received: by 2002:a2e:a231:: with SMTP id i17mr205093ljm.443.1644868881602; Mon, 14 Feb 2022 12:01:21 -0800 (PST) MIME-Version: 1.0 References: <20220214163452.1568807-1-arnd@kernel.org> <20220214163452.1568807-5-arnd@kernel.org> In-Reply-To: From: Linus Torvalds Date: Mon, 14 Feb 2022 12:01:05 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 04/14] x86: use more conventional access_ok() definition To: Arnd Bergmann 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 , Christoph Hellwig , Ingo Molnar , Geert Uytterhoeven , "open list:SYNOPSYS ARC ARCHITECTURE" , "open list:TENSILICA XTENSA PORT \(xtensa\)" , Arnd Bergmann , Heiko Carstens , linux-um , 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 , linuxppc-dev , 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 11:46 AM Arnd Bergmann wrote: > > 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. x86-64 has always(*) used TASK_SIZE_MAX for access_ok(), and the get_user() assembler implementation does the same. I think any __range_not_ok() users that use TASK_SIZE are entirely historical, and should be just fixed. Linus (*) And by "always" I mean "as far back as I bothered to go". In the 2.6.12 git import, we had #define USER_DS MAKE_MM_SEG(PAGE_OFFSET) so the user access limit was actually not really TASK_SIZE_MAX at all, but the beginning of the kernel mapping, which on x86-64 is much much higher.