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=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 18605C4360C for ; Mon, 7 Oct 2019 01:24:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D859B20862 for ; Mon, 7 Oct 2019 01:24:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726918AbfJGBYk (ORCPT ); Sun, 6 Oct 2019 21:24:40 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:60000 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726661AbfJGBYk (ORCPT ); Sun, 6 Oct 2019 21:24:40 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.2 #3 (Red Hat Linux)) id 1iHHlN-0004Sd-Dd; Mon, 07 Oct 2019 01:24:37 +0000 Date: Mon, 7 Oct 2019 02:24:37 +0100 From: Al Viro To: Linus Torvalds Cc: Guenter Roeck , Linux Kernel Mailing List , linux-fsdevel Subject: Re: [PATCH] Convert filldir[64]() from __put_user() to unsafe_put_user() Message-ID: <20191007012437.GK26530@ZenIV.linux.org.uk> References: <20191006222046.GA18027@roeck-us.net> <5f06c138-d59a-d811-c886-9e73ce51924c@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 06, 2019 at 06:17:02PM -0700, Linus Torvalds wrote: > On Sun, Oct 6, 2019 at 5:04 PM Guenter Roeck wrote: > > > > All my alpha, sparc64, and xtensa tests pass with the attached patch > > applied on top of v5.4-rc2. I didn't test any others. > > Okay... I really wish my guess had been wrong. > > Because fixing filldir64 isn't the problem. I can come up with > multiple ways to avoid the unaligned issues if that was the problem. > > But it does look to me like the fundamental problem is that unaligned > __put_user() calls might just be broken on alpha (and likely sparc > too). Because that looks to be the only difference between the > __copy_to_user() approach and using unsafe_put_user() in a loop. > > Now, I should have handled unaligned things differently in the first > place, and in that sense I think commit 9f79b78ef744 ("Convert > filldir[64]() from __put_user() to unsafe_put_user()") really is > non-optimal on architectures with alignment issues. > > And I'll fix it. Ugh... I wonder if it would be better to lift STAC/CLAC out of raw_copy_to_user(), rather than trying to reinvent its guts in readdir.c...