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.8 required=3.0 tests=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 D95A1C2D0DB for ; Thu, 23 Jan 2020 18:38:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 99FB221D7E for ; Thu, 23 Jan 2020 18:38:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="CO5Rx/d/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 99FB221D7E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 14A046B0007; Thu, 23 Jan 2020 13:38:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0D3CC6B0008; Thu, 23 Jan 2020 13:38:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F049D6B000A; Thu, 23 Jan 2020 13:38:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0202.hostedemail.com [216.40.44.202]) by kanga.kvack.org (Postfix) with ESMTP id D89066B0007 for ; Thu, 23 Jan 2020 13:38:49 -0500 (EST) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id 85B36180AD806 for ; Thu, 23 Jan 2020 18:38:49 +0000 (UTC) X-FDA: 76409760378.02.bait43_6a17408dbd950 X-HE-Tag: bait43_6a17408dbd950 X-Filterd-Recvd-Size: 4465 Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Thu, 23 Jan 2020 18:38:48 +0000 (UTC) Received: by mail-lj1-f195.google.com with SMTP id z22so4773972ljg.1 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=SP07mi6j0Scd6hWFR3LQ1WVUzjX9sQV7/nuaKHHULJx6rPEEDpVpE3sgQO+aWVsJ3e hvow78pqPjKfubMJ1mSY2uo/x/xhyN5q1OdRak5hkMb+kyb+tz0vRkDiNqBIIx800WSc QMbyHYgv/kqVGdl/PQySG+RJkvuG25JymTEH3T6snV+cEOU/lqJpVtXFnWg0fKSBRa79 SkVoGwvajIfwqstwUi2l2REsua+eHgg/Otwitei0srRaSmlJ9l6z8xNHZ7UHRQ3Cx9OS hmaPCMaQ4LvVydcY30So2TuONDHyE/tL8plqydn5VF53kZ6uPDKzpxZNSrLTPkSAugNw nc0A== X-Gm-Message-State: APjAAAWissCAMmkOrgQssLAR37Sos72hm3FnQ9JcrfjggT0nin3fJiQ0 A6Pin0ozB6gyUzdmra97dYC5HIoa8Jk= X-Google-Smtp-Source: APXvYqzs+yobKEESZSBLfjYALf9L5Dgz/WeOBctYgzTq4OWuu9GwQcVaM0vd8YO2CXzxsGsxgC0U+Q== X-Received: by 2002:a2e:a408:: with SMTP id p8mr23701128ljn.145.1579804727190; Thu, 23 Jan 2020 10:38:47 -0800 (PST) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com. [209.85.208.170]) by smtp.gmail.com with ESMTPSA id v8sm1782774lji.16.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-f170.google.com with SMTP id j1so4776600lja.2 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" 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, 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