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 X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62C67C2BA12 for ; Thu, 2 Apr 2020 17:38:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DF77A2078E for ; Thu, 2 Apr 2020 17:38:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="nZ1tW5cd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DF77A2078E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6C1098E0008; Thu, 2 Apr 2020 13:38:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 672808E0007; Thu, 2 Apr 2020 13:38:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 560708E0008; Thu, 2 Apr 2020 13:38:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0061.hostedemail.com [216.40.44.61]) by kanga.kvack.org (Postfix) with ESMTP id 3CE158E0007 for ; Thu, 2 Apr 2020 13:38:37 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 04E036137 for ; Thu, 2 Apr 2020 17:38:37 +0000 (UTC) X-FDA: 76663624674.19.egg11_10fb6440a0d0e X-HE-Tag: egg11_10fb6440a0d0e X-Filterd-Recvd-Size: 4178 Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Thu, 2 Apr 2020 17:38:36 +0000 (UTC) Received: by mail-pl1-f196.google.com with SMTP id h11so1599694plk.7 for ; Thu, 02 Apr 2020 10:38:36 -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=RFmh29f6b4RBzzdEqK+shU1sG1CQYZR2pnjNQ4GHtz4=; b=nZ1tW5cdLTnrJHaCLa8YsIRPpPlRPFpL0uEDPZq5C6IXi8B6PIPo0V44IWP7UdveOK n8a3uVYEAnP6svRPOtPbYL0aA5JwtdXCSFnOxGztaGHqGpIZK4nPVqLn4Y8SLax0u0Vu OIiaVcpyAYJwCEhpCFe9d5+dT+2UWC9a1H+y4= 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=RFmh29f6b4RBzzdEqK+shU1sG1CQYZR2pnjNQ4GHtz4=; b=LRl46zy/8vqZ93U03jTpvi2YpadLO+YV131twgs/Qr1t0WSCB+HfLCYTyCwHsNYnye s8sBWzGSbwY8RowYW4AevMk5IQ1Y16HL2jLxeS7pOsOTtYyWIr0XVngZbUYrAn/gKX1M pZKpMT5UDVh/HBo18Pjae5dgTEl+of5FZ+X2EnbtH6Xc7mfq47wXwq7jQRJPKEyzubN6 AruGEGT7KlGWKL7x5rTYXhwS79SWGAT0tnk2Od/s5h79OUae1tbyCj7rPkCbXc6osubF JS7pKa4XVYQmo/pAHJ5vptxlGi4viwp3ogYTHsbuzLp3Ie9A+BSAVQ5h4SkxTIVRTYVt eh+w== X-Gm-Message-State: AGi0PuZ39XGxvvmp3W/j/gM7F72+U5mZCKBNiLKBKaM7mR2079lSl5+Y iOvavBim2jhc4+tSvkOHdpKEaA== X-Google-Smtp-Source: APiQypLF9RC8sBLfTXy7MiRa5PFnHgJKJWkxNSBkHJjYskdTsqaZauwH5Q8uNxCHLFh5f+ETA6Q6wg== X-Received: by 2002:a17:90b:3653:: with SMTP id nh19mr5043955pjb.154.1585849115305; Thu, 02 Apr 2020 10:38:35 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id h71sm3711857pge.32.2020.04.02.10.38.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Apr 2020 10:38:33 -0700 (PDT) Date: Thu, 2 Apr 2020 10:38:32 -0700 From: Kees Cook To: Christophe Leroy Cc: Al Viro , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , airlied@linux.ie, daniel@ffwll.ch, torvalds@linux-foundation.org, akpm@linux-foundation.org, hpa@zytor.com, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, 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: <202004021035.573BBBE9AA@keescook> References: <27106d62fdbd4ffb47796236050e418131cb837f.1585811416.git.christophe.leroy@c-s.fr> <20200402162942.GG23230@ZenIV.linux.org.uk> <67e21b65-0e2d-7ca5-7518-cec1b7abc46c@c-s.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <67e21b65-0e2d-7ca5-7518-cec1b7abc46c@c-s.fr> 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 Thu, Apr 02, 2020 at 07:03:28PM +0200, Christophe Leroy wrote: > > What should we do about arm and s390? There we want a cookie passed > > from beginning of block to its end; should that be a return value? > > That was the way I implemented it in January, see > https://patchwork.ozlabs.org/patch/1227926/ > > There was some discussion around that and most noticeable was: > > H. Peter (hpa) said about it: "I have *deep* concern with carrying state in > a "key" variable: it's a direct attack vector for a crowbar attack, > especially since it is by definition live inside a user access region." I share this concern -- we want to keep user/kernel access as static as possible. It should be provable with static analysis, etc (e.g. objtool does this already for x86). Since this doesn't disrupt existing R+W access, I'd prefer the design of this series as-is. -- Kees Cook