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 6B464C433EF for ; Mon, 14 Feb 2022 20:01:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E57C86B0071; Mon, 14 Feb 2022 15:01:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DE09D6B007B; Mon, 14 Feb 2022 15:01:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C5A566B007D; Mon, 14 Feb 2022 15:01:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0066.hostedemail.com [216.40.44.66]) by kanga.kvack.org (Postfix) with ESMTP id B030D6B0071 for ; Mon, 14 Feb 2022 15:01:49 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 6E400828B638 for ; Mon, 14 Feb 2022 20:01:49 +0000 (UTC) X-FDA: 79142455938.29.97EF338 Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) by imf18.hostedemail.com (Postfix) with ESMTP id 336921C001F for ; Mon, 14 Feb 2022 20:01:34 +0000 (UTC) Received: by mail-lj1-f177.google.com with SMTP id a42so8428940ljq.13 for ; Mon, 14 Feb 2022 12:01:33 -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=k9H4idcWpVz/MoKMqAhYZJkunhmXKcfNlYiDG4JCht6bnb+k40ickidxoVnqU9S2UP zwCH5MCT8+Khy1T/gPzTUO204+/+I2OlQ5SEjFKEKmuQOEGYVlhRPGwdjB44BehSYDol im6khY4p/isUcmar1kqV7yWRvncVjUJZ0lp/jSlR1M2h/QjBvbO4p00qTP5WLRRBs75j i1f0rWYCkCvKw7fjkqyCJPtAmOPqzr0VzxYrHQeK8LxC+tZEGcIEOypXQV+BgvFmJ8hJ 65ocgTdFiVIc9hiPQ97iivaiTufANr6pHRsxVm0pFKaCWnVtQLFEl4HNjfflhsNGlBOL IbRw== X-Gm-Message-State: AOAM530pWTIVtIMvUT5YqsrnLLDY9tFaaRspcSbsmqdAOt57YUbrE4Yp VpSjskXaP6TVYeGwE91/byIZrv6KffL/Ar7Hh/k= X-Google-Smtp-Source: ABdhPJxbZ0ctSs+PkfKrj+quQaSbPr9q0Niq4UVhC0+8XxuGTADiUZzi5vnxL/c9N680o/kCtntVHA== X-Received: by 2002:a2e:5810:: with SMTP id m16mr210296ljb.261.1644868892378; Mon, 14 Feb 2022 12:01:32 -0800 (PST) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com. [209.85.208.177]) by smtp.gmail.com with ESMTPSA id q2sm2837123lfu.104.2022.02.14.12.01.21 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Feb 2022 12:01:32 -0800 (PST) Received: by mail-lj1-f177.google.com with SMTP id n24so21104994ljj.10 for ; Mon, 14 Feb 2022 12:01:21 -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 Cc: Christoph Hellwig , 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" , Dinh Nguyen , "Eric W . Biederman" , Richard Weinberger , Andrew Morton , linuxppc-dev , David Miller , Al Viro Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 336921C001F X-Rspam-User: Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=ZcumWtnh; spf=pass (imf18.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.208.177 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org; dmarc=none X-Stat-Signature: 6fic3rjjsbf5h7mxs5jy8pzpctchdrf6 X-Rspamd-Server: rspam11 X-HE-Tag: 1644868894-807333 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 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.