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 A3700C2D0DB for ; Wed, 22 Jan 2020 16:13:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4037921569 for ; Wed, 22 Jan 2020 16:13:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="WVzg/4mZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4037921569 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 85FF26B0003; Wed, 22 Jan 2020 11:13:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 811086B0005; Wed, 22 Jan 2020 11:13:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 726C86B0007; Wed, 22 Jan 2020 11:13:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0025.hostedemail.com [216.40.44.25]) by kanga.kvack.org (Postfix) with ESMTP id 5CED66B0003 for ; Wed, 22 Jan 2020 11:13:34 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id E75EC181AC9C6 for ; Wed, 22 Jan 2020 16:13:33 +0000 (UTC) X-FDA: 76405765506.25.sun96_59450d7a7cd2c X-HE-Tag: sun96_59450d7a7cd2c X-Filterd-Recvd-Size: 4165 Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by imf39.hostedemail.com (Postfix) with ESMTP for ; Wed, 22 Jan 2020 16:13:33 +0000 (UTC) Received: by mail-lj1-f195.google.com with SMTP id y4so7442259ljj.9 for ; Wed, 22 Jan 2020 08:13:33 -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=PxCSo2JcEGlTJhdmVOOHLpuyjFAWieC3FhzbX6ms3Bk=; b=WVzg/4mZaQ3ubctvikpmoB2+8YZnmRK2+VSYiWGQ33nJZL1OeIGMyFE3sBcuqoQVbi rwpNneTfpLB3RAwTWttAZsxz4mdwPNf2Y8+kgY4tYIeLbjPU7jrBtLrLWh4mnN0ddI2k Y06yr95wD8GFqmmXgcgeinrku41v7nODIWRxw= 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=PxCSo2JcEGlTJhdmVOOHLpuyjFAWieC3FhzbX6ms3Bk=; b=XeGh2fdyCniyfO8zoxEoJd5+bkXRDZtYrk/GPEH1TwwELRSrlBwyM8QEP0s5CkslIo Zu0D6Cg0arxKa15Iu/bXs+/DxLp4gcG6+EK/x9tKnzy/2iC9Nc3n+DQhwOcP+FQnMEnF zw2t06OQKDwcnwFxpDhw8wtptpiDY3m2XDzaajKd4/guxAmzIenZZf+lmkU9Mc9WBq7u JUu6odLRWlNUqnfeASxN0YEOiIJSyPoNjLHc41+1/TOpxVQ4dzacnnDnFLwdoXKk3DST Mmp93kp3i2spdQrNZP+2Oj9xk5h0uzhtc9NtZNeZL/ck2Oi2SdDi8JWGA7u5M8NuDZhM Vxxg== X-Gm-Message-State: APjAAAWuPW6QuNTRalbuYT8OMWz1CSe25gD+HOQ/p4+qCbr/Lxoq0ori IY4UkN5vOj2SZNecd98E6xVZVkM4IA4= X-Google-Smtp-Source: APXvYqyltUwat2BwLx9xURBZR0xGpHmtxWOGnP/pqeTry79wLCBUNNXTMCoy3sf/EgcrFssBk2QGKA== X-Received: by 2002:a2e:89ce:: with SMTP id c14mr17956381ljk.13.1579709610184; Wed, 22 Jan 2020 08:13:30 -0800 (PST) Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com. [209.85.208.180]) by smtp.gmail.com with ESMTPSA id i17sm20613730ljd.34.2020.01.22.08.13.28 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Jan 2020 08:13:29 -0800 (PST) Received: by mail-lj1-f180.google.com with SMTP id z22so7484139ljg.1 for ; Wed, 22 Jan 2020 08:13:28 -0800 (PST) X-Received: by 2002:a2e:9510:: with SMTP id f16mr19943444ljh.249.1579709608444; Wed, 22 Jan 2020 08:13:28 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Linus Torvalds Date: Wed, 22 Jan 2020 08:13:12 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v1 1/6] fs/readdir: Fix filldir() and filldir64() use of user_access_begin() To: Christophe Leroy Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , 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 Wed, Jan 22, 2020 at 5:00 AM Christophe Leroy wrote: > > Modify filldir() and filldir64() to request the real area they need > to get access to. Not like this. This makes the situation for architectures like x86 much worse, since you now use "put_user()" for the previous dirent filling. Which does that expensive user access setup/teardown twice again. So either you need to cover both the dirent's with one call, or you just need to cover the whole (original) user buffer passed in. But not this unholy mixing of both unsafe_put_user() and regular put_user(). Linus