Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2117426ybb; Thu, 2 Apr 2020 13:29:48 -0700 (PDT) X-Google-Smtp-Source: APiQypJqdpFrbafQPiEPAWMA/VaJm9wJr9hLhwIryzGIB3e3z/EigUtwEaLz41m6gr9fj0U259Cz X-Received: by 2002:a4a:3b50:: with SMTP id s77mr4269919oos.53.1585859388367; Thu, 02 Apr 2020 13:29:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585859388; cv=none; d=google.com; s=arc-20160816; b=IPOnjQX/4Owu+EpZL+uolDRPi/Zn6OrdEHpnjYV2lDS2PBYccPC/w90zP1WM8M8p3J UWK4QOWwUyLx3neecUX8xBFA4KqzvWzK/Ck4RxGTFx99uVmB1YL3uAlOwes5JkrOhe1N FZF78ynbJ1ElgukZ7iR3963AknyvtuXQKkS9h2jHhbRGi9cIMN8/bXA3aPnoZuUGtx4r fO6Z0IPXm8odQ11SQDSU7RFJHENxYr44fi7x4VLZ7gDhnnOOQkSUERwnsivEl+dsYC8K +mO2hl9552ugL3yZHb06s0JBUi9/QLwgHs5QVdf2JXwNmuig1XVtEPFqOq4dSMmqhKkc Cjjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Tm9Yr3bqmuNGExiY7vVKsPwnaHo60Po4ISz6K0cbNJM=; b=Gvxw+nKOSgfxBKuEv+nac/Yw0Se2wAnBbMWfip3tV2Glfs4CzERxdZ4IqhWnEewjUJ DKCmi13Im/DuUib7e9H2L9/ejpsDghYogLOlmVscJqAkgSBnkcPjGuLDIP3E5d+G9mnR fIutOSoZoA5U81D1HbwkiP4xtkn0G+TwHKONpOPkZf1zWlpqgbQnuZsHfO4+Ce89gEq1 Tym+xaMudqNfexq+p7Jb3E+bKXDZZO1s1p3hwpcOucXz4ZYrTj9kuvF5753js46fat3B X/EFZhL+n4TEJ4aOY/Bju3Xos+4K+f5Pm/QOkF/D7iqv9yQsiPFuCWeFK8Bp67/Jn58u h/1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Smm1q5CY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h1si2859965otr.127.2020.04.02.13.29.34; Thu, 02 Apr 2020 13:29:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Smm1q5CY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389651AbgDBU1v (ORCPT + 99 others); Thu, 2 Apr 2020 16:27:51 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:40075 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730837AbgDBU1v (ORCPT ); Thu, 2 Apr 2020 16:27:51 -0400 Received: by mail-pg1-f195.google.com with SMTP id t24so2370386pgj.7 for ; Thu, 02 Apr 2020 13:27:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Tm9Yr3bqmuNGExiY7vVKsPwnaHo60Po4ISz6K0cbNJM=; b=Smm1q5CY/oX1a5RB+6/rg0OMMpkQQEyasTzFJrBTMrH/9ggcr/BfvbpYsLykFyjKyj 2PwhzKCTjNwbauICju6+DoHPLTmOfE26sbu8gKPAF0JNysrFbBXJP1k99H1Y81ZGotjF HBEOphcciEgjXYH2LvUC0i9QCTEJqTA6uBORk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Tm9Yr3bqmuNGExiY7vVKsPwnaHo60Po4ISz6K0cbNJM=; b=b632y/MP+4nmTwFaq9gIpD//rvU45D3JhGRhMxZksiKICYQsv4I2C8WDSuQq+EW7Ae p9oSfowMRgwN/meTLngI6FhyMHxYYXZjYkoRwCXrBiDxNIIpRrC7ghAjgkpSfmZwwvbF nxeLOXKZ+vaTovkZwkIavfgluunDlO/Z6eliTQ3t7IHibxE9HzXCMiKUiy9XfTfpdMLn WFlfx8rgys5WQaIRLqukuuwOdhMEvxRUkR+a7K0idN02Otr5JFkfIpcCSJkR2qXp0O/Z edmGyHPaenWbnzwdmIjtLmNgjKArjqhb1vvr3+AO71HMqwbtsfTPwDzqDaYkrUhMY8Zq V+Og== X-Gm-Message-State: AGi0PuaMkxqZnCQbCvQbWg7cTrgzfOXCkGh3sxhIZVNvrK244hNjcIYs G4yV7rHhHjJY0mba8+GFwRacsQ== X-Received: by 2002:a63:b80a:: with SMTP id p10mr4870517pge.306.1585859268304; Thu, 02 Apr 2020 13:27:48 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id i187sm4325945pfg.33.2020.04.02.13.27.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Apr 2020 13:27:47 -0700 (PDT) Date: Thu, 2 Apr 2020 13:27:46 -0700 From: Kees Cook To: Linus Torvalds Cc: Al Viro , Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Dave Airlie , Daniel Vetter , Andrew Morton , Peter Anvin , Linux Kernel Mailing List , linuxppc-dev , Linux-MM , linux-arch , Russell King , Christian Borntraeger Subject: Re: [PATCH RESEND 1/4] uaccess: Add user_read_access_begin/end and user_write_access_begin/end Message-ID: <202004021322.5F80467@keescook> References: <27106d62fdbd4ffb47796236050e418131cb837f.1585811416.git.christophe.leroy@c-s.fr> <20200402162942.GG23230@ZenIV.linux.org.uk> <67e21b65-0e2d-7ca5-7518-cec1b7abc46c@c-s.fr> <20200402175032.GH23230@ZenIV.linux.org.uk> <202004021132.813F8E88@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 02, 2020 at 12:26:52PM -0700, Linus Torvalds wrote: > On Thu, Apr 2, 2020 at 11:36 AM Kees Cook wrote: > > > > Yup, I think it's a weakness of the ARM implementation and I'd like to > > not extend it further. AFAIK we should never nest, but I would not be > > surprised at all if we did. > > Wel, at least the user_access_begin/end() sections can't nest. objtool > verifies and warns about that on x86. Right, yes, I mentioned that earlier in the thread. I meant I wasn't 100% sure about ARM's corner cases. I would _hope_ it doesn't. > > If we were looking at a design goal for all architectures, I'd like > > to be doing what the public PaX patchset > > We already do better than PaX ever did. Seriously. Mainline has long > since passed their hacky garbage. I was just speaking to design principles in this area: if the "enable" is called when already enabled, Something Is Wrong. :) (And one thing still missing in this general subject is that x86 still lacks SMAP emulation. And yes, I understand it's just not been a priority for anyone that can work on it, but it is still a gap.) -- Kees Cook