Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp434061ybl; Fri, 24 Jan 2020 03:09:22 -0800 (PST) X-Google-Smtp-Source: APXvYqzh137TYA0jspDK1qqOSSNqeLG+vO0mJX6Y4grvzBQpLRn0+CsV81d1jjY1KxqXl26rXZUU X-Received: by 2002:a9d:1ca3:: with SMTP id l35mr2236325ota.271.1579864161935; Fri, 24 Jan 2020 03:09:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579864161; cv=none; d=google.com; s=arc-20160816; b=l3AZmyXBuYzDGMHNWZciU8TFaVTK0H5ag3fMOrS2oVU8sMDxO4zhi/vLNOMzF2vzZW SjDLpqy199oC3i7OAUkbs7a0xp3Mthu/Rg0+LAwk8O8Wgful1DWa0N6ptjhWD5eurfK1 VKarOCrWebIaR6RbaqER3bZ9sgCzTbyU5A9T2nXBGwiGsBxGPjlGFsxQi6m0DtlqZgDM X7cv+1dUdu+sWwM5S2UxyCLujloetz0isPF+C9+1FfGSxjxYgbLQlpUu4iegQ8yKY9+C GA5Tai14bTKlOurgJ17ckd/WDK+q14/RudIsK5GS0BPjdz1SeFtAPP+oIByRJsCsN8P2 GgpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=H4j0Futj5uqyyAbpgglurPALtZHLyOVkkBYQKpFq/88=; b=KBtCpkz3WdblbSab+u/CtjySh0dnQnTqWBjebuKJSBn1dKW+h86lZ6jUAoUOxI7Bfh VxQLg7vwl4yLI4BGCp0bWmJZCuOFWJcilm/wS6UGfMITsiOau+MjHmqvSVpEGnSV7Eeh e9BhkOra3HA1o9+Ys3kANpNGihQqfFikNn9C6YqFWdRW/xYeIRo7c8gVz9Kp2Ug038+j iIJVGqe1ST3dIXJPXY+zcADeuLhRQjepUPhchSDenI+jzDk/VSnDcQld1YDqg+TRU92E /qA4oHxN1xckEveMAV8h7Kvrc81yQTeGx0aiqd7olSGg9oGuKbu0aC1F8UD6wall50Nr GZqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=MmR6teA2; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l17si2713689otk.218.2020.01.24.03.09.09; Fri, 24 Jan 2020 03:09:21 -0800 (PST) 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=@ellerman.id.au header.s=201909 header.b=MmR6teA2; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731350AbgAXKmn (ORCPT + 99 others); Fri, 24 Jan 2020 05:42:43 -0500 Received: from ozlabs.org ([203.11.71.1]:55913 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725843AbgAXKmn (ORCPT ); Fri, 24 Jan 2020 05:42:43 -0500 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 483whD6FWGz9s1x; Fri, 24 Jan 2020 21:42:36 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1579862561; bh=H4j0Futj5uqyyAbpgglurPALtZHLyOVkkBYQKpFq/88=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=MmR6teA231c1fXQY1+vLqi0yz+Vc/SdGtcRyQ5HHkVx+BNa3Psa5ILkQxN57JPZ+l QIDQJ6babRxL+JNOJ1Ihqnztvi+zDQ0ClPcWniXnyA9m5CrYol7du1yr6gvZgrSqj9 Sm2JIYeF0VfZ0LNwzGOk02j//mTV+bi0mJJXC3wPwjd0kXnV/egJmn1DK/vMu2Ze/H PEy7abr1N9fN1d18XYZwK4cyAbdcoaYAt+wPy0l8aEU5uIJ2g2Gc0DLfd86fF20aOj IDGhhd9mt4ij7rNrL1OTDb6LldjgXtBTveq+DlS/1iY4HEmLNb4b5jrGYiOtxTLgBD 84Co0BMAqYRew== From: Michael Ellerman To: Linus Torvalds Cc: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , Alexander Viro , Andrew Morton , Linux Kernel Mailing List , linuxppc-dev , linux-fsdevel , Linux-MM Subject: Re: [PATCH v2 1/6] fs/readdir: Fix filldir() and filldir64() use of user_access_begin() In-Reply-To: References: <12a4be679e43de1eca6e5e2173163f27e2f25236.1579715466.git.christophe.leroy@c-s.fr> <87muaeidyc.fsf@mpe.ellerman.id.au> <87k15iidrq.fsf@mpe.ellerman.id.au> Date: Fri, 24 Jan 2020 21:42:30 +1100 Message-ID: <878slxi19l.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Linus Torvalds writes: > On Thu, Jan 23, 2020 at 4:00 AM Michael Ellerman wrote: >> >> So I guess I'll wait and see what happens with patch 1. > > I've committed my fixes to filldir[64]() directly - they really were > fixing me being lazy about the range, and the name length checking > really is a theoretical "access wrong user space pointer" issue with > corrupted filesystems regardless (even though I suspect it's entirely > theoretical - even a corrupt filesystem hopefully won't be passing in > negative directory entry lengths or something like that). Great, thanks. > The "pass in read/write" part I'm not entirely convinced about. > Honestly, if this is just for ppc32 and nobody else really needs it, > make the ppc32s thing always just enable both user space reads and > writes. That's the semantics for x86 and arm as is, I'm not convinced > that we should complicate this for a legacy platform. We can use the read/write info on Power9 too. That's a niche platform but hopefully not legacy status yet :P But it's entirely optional, as you say we can just enable read/write if we aren't passed the read/write info from the upper-level API. I think our priority should be getting objtool going on powerpc to check our user access regions are well contained. Once we have that working maybe then we can look at plumbing the direction through user_access_begin() etc. cheers