Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp950817ybl; Thu, 23 Jan 2020 10:41:46 -0800 (PST) X-Google-Smtp-Source: APXvYqyIcc72oT7ECnmVzk0jIO1VeCtXRBjuOUI5LultIHysR4UebqBcRZdmWg5i0Ydbs3UqsiFR X-Received: by 2002:a9d:21f4:: with SMTP id s107mr12840064otb.102.1579804905997; Thu, 23 Jan 2020 10:41:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579804905; cv=none; d=google.com; s=arc-20160816; b=X844tU7akkIom8moS9e9rRZPo6r59HmrJxByEYDZKyEHhce8ckjK+gCU/sLO0bLEL/ BuwaR1DjqPILwzzYGX9WlZuJt7y7Yf/ms7w/d5/Wi7P3qFPgLp2pAyJke/Q2cyAajuII 5anq67O6X/Kc6JcH/JbCPhG6s/vn7zuYCY14DVqpy7L8yozTld0o9kZr5a2ZoCGnZ+7D fZW1tYgM6RN8F1OywFwYAN2CCD0yK0fCkUCTOf/Mw0xuyYRitkdO2cboNRvbQ4uiNNCd XJwK6E0NkFEw8uGA3Up/avgmViMfWEvqGcagI/e03IzF0Zftgq2eQsvHIdg5wzjkiA3J dnbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=dQ25OTOBjFwniHXaIhyRIPei9koK1Vea3aQMS9ddWaY=; b=IGXIxih6Qmfq3HZOD2+2UoGF7hfm62IumaxidEHby6x94AiUL1BKTZHHmvqqgxZGIf kt+EwEOISHbuXKWcaRGgR0ccP1rdXhU6XE9tv7uX5a7OuRI0G6lk3rpoMKI0K8JMvXPF 5vX7OOlg99VymTz97vj9sXY6+zG8tHQ+DiKiwlN++AZ7J8jMDi0ZKf7w+UmYDQxL/AwO VeTztzuN3SrBKoJiszTjwas1hxXCQajHXTgg5R16XpFLPRQf1VPHqcKjBxst9JhGf+EC D77tkpZMeyPPTR3YPNzozmQeiWZr4P3qj87Q9P5JzrBUXTJtVLua2Ay6JNQ+CjG+akiX tvKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="CO5Rx/d/"; 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 a22si209945oia.15.2020.01.23.10.41.33; Thu, 23 Jan 2020 10:41:45 -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=@linux-foundation.org header.s=google header.b="CO5Rx/d/"; 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 S1728899AbgAWSiu (ORCPT + 99 others); Thu, 23 Jan 2020 13:38:50 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:40477 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727022AbgAWSit (ORCPT ); Thu, 23 Jan 2020 13:38:49 -0500 Received: by mail-lj1-f195.google.com with SMTP id n18so4720300ljo.7 for ; Thu, 23 Jan 2020 10:38:48 -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=dQ25OTOBjFwniHXaIhyRIPei9koK1Vea3aQMS9ddWaY=; b=CO5Rx/d/+juGBR+FFLJo0Qdw3RYFgTLIf+Mnl29p0mNIytugs2NcVQlE2/w2WUc19a r7ybFhTMI9YigwXFyviyqQt0NfnDBfayvOxgRYe2KBPKF1sYRQ5QUo2wzCyUmR6GFB8N XlNGtwTb4WQwbGi39oResI6dOVY+bDpk8CA2Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dQ25OTOBjFwniHXaIhyRIPei9koK1Vea3aQMS9ddWaY=; b=tb2FtbHICy1RZ1CLpBYEKhCww41uGqvcfVqoZ2E0E4MilNHMYGFde9V0bN63wQsvUp HvYL6XmLuX2/zwDdEHp8Bjg5N0I3UyRmTywvssya+3HEoS2iBFI1iIc398mrbt3DPY0N 30+gr7R9P41vRAiQ2QK0jFjKaRir+5IfbDQjleVAyV4dV+5OVpSZqVIcTpVMgxASWqnE E2G/xgf0Jwkx3UFhWr1scdqW9SsJNT8verKzoX+iFTSD1bTYO9KUSpeDYvi/yTtta+Zu m5iuDQPhHmD6yVurA67+JD3MnMu2bNgFvIQeJ1+klN2GZionuDKoDww8GkikKuKUHOpI 76AA== X-Gm-Message-State: APjAAAXFdmN1nOKNODw84lmxoT7wpObR1uKAVDnd/Ncwlc9+YJ+i0Fng Px+sfdwC7pVF54OD13VfEMvB5RyzZgk= X-Received: by 2002:a2e:6f19:: with SMTP id k25mr23902146ljc.84.1579804727262; Thu, 23 Jan 2020 10:38:47 -0800 (PST) Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com. [209.85.208.175]) by smtp.gmail.com with ESMTPSA id q17sm1741654ljg.23.2020.01.23.10.38.46 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Jan 2020 10:38:46 -0800 (PST) Received: by mail-lj1-f175.google.com with SMTP id z22so4773809ljg.1 for ; Thu, 23 Jan 2020 10:38:46 -0800 (PST) X-Received: by 2002:a2e:990e:: with SMTP id v14mr22668549lji.23.1579804725767; Thu, 23 Jan 2020 10:38:45 -0800 (PST) MIME-Version: 1.0 References: <12a4be679e43de1eca6e5e2173163f27e2f25236.1579715466.git.christophe.leroy@c-s.fr> <87muaeidyc.fsf@mpe.ellerman.id.au> <87k15iidrq.fsf@mpe.ellerman.id.au> In-Reply-To: <87k15iidrq.fsf@mpe.ellerman.id.au> From: Linus Torvalds Date: Thu, 23 Jan 2020 10:38:29 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 1/6] fs/readdir: Fix filldir() and filldir64() use of user_access_begin() To: Michael Ellerman Cc: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , Alexander Viro , Andrew Morton , Linux Kernel Mailing List , linuxppc-dev , linux-fsdevel , Linux-MM Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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). 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. Linus