Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp131158ybp; Thu, 10 Oct 2019 15:13:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqxc8dpINFAyfaLKnGL9G3ocZgZVdSoSfEoHZK9YsUT6nsmf7QbcQ6PN4QRn0iwhnouNwSN/ X-Received: by 2002:aa7:de12:: with SMTP id h18mr10313340edv.226.1570745625295; Thu, 10 Oct 2019 15:13:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570745625; cv=none; d=google.com; s=arc-20160816; b=O3cs+gek8CqfGvzUpduu+Cm39Mj/Uw6YQIpq0H3o1UCpIXJw4EJQq3Tgx8TeWlVcsq O7yWU2Mu1GXH3+90YrvVH+WhUOu4AjoHmO/ObhVSb3MS49H+FSyoI2Yibw1BuBZ7zyLB KTh5j37nv7B2NcLPjHmrISDkGxSyIskJhmRDLjv78tc0N80bv3GJoID3FXiMJtrYkD7o Q+NdPb2JGJCnZQEGOFj4ov4g5e68kbEFKmCWfFJgEN8C65kEPRg8QaBjS3KzuiRfGbzL UvtiNVT7oS8boF9v1v3Mj4ligm6hq+tv1RnMLHCPMQAN6J1+MmKjhhazjltVNayYVTe9 T8jg== 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=vF7vVvcx7X2Y4bkz6NSFslpoAQ3GnfhWGvkOzcDGukk=; b=Wk9wjH+qlHLH/ToPQe+JaagkPJF5Y55FaymdwKv9NGtjWJXHqhLoyno4ykNkardp5w 0eLEY7Xd6ZH4JQm+ZAYV78Wj91Em65rS2lcBWv0+flXCveB0nm/GhAT979Ne5AR1MkC7 Y7sqjCiPv3w+hBzKdrKcndV48ye2Vn5tRxTEF4wqrv3MDMZ2dGtuOr48uXyIuL5tXEvD FYIqrFCmobLFwz7azulWzpEaPcPr405QbJNWQZejfKBUmxCmvSOqJ2KUO7jg9sN9YJho dsfGNTD/113+0GjzwKog89WgmaK3amyDEXz6lKg5Hmvea2xXkx391yXhIdsnqNJI04mr KPXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=AePMDpuh; 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 w26si4396630edd.305.2019.10.10.15.13.21; Thu, 10 Oct 2019 15:13:45 -0700 (PDT) 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=AePMDpuh; 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 S1726814AbfJJWNJ (ORCPT + 99 others); Thu, 10 Oct 2019 18:13:09 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:44887 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725978AbfJJWNJ (ORCPT ); Thu, 10 Oct 2019 18:13:09 -0400 Received: by mail-lj1-f196.google.com with SMTP id m13so7761223ljj.11 for ; Thu, 10 Oct 2019 15:13:07 -0700 (PDT) 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=vF7vVvcx7X2Y4bkz6NSFslpoAQ3GnfhWGvkOzcDGukk=; b=AePMDpuhTnjZhuA+/iTNCIk2Byoun7PsLjybqrf7awqwwp3sOrG6tM3PCboDKAch+d EhWYtOGQhvAGMcekGIWbotORBzlbwuFZcc8XQPO39gh+OplKN3UleWxt/iI7gTOIQILP MeBm7+0MuhDlPPspHH3U9j73Xa9+HDEGQFOEY= 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=vF7vVvcx7X2Y4bkz6NSFslpoAQ3GnfhWGvkOzcDGukk=; b=UkMvkdJ/kagus37wVI4Kym6iFpFIbyxBFGaYNW8ZBtzzhgLROMjgA23VK2l6HPp76E TlZNKVbTZdnJ2mWy3rIwQflWaxvmTGCXKsydN+SGYpfeCpc+a9g4Gh09AFRGiVuYDS/3 DIfHQnVkp30cSPH8YtpWn/uBuTRc2MnNsKJPCyvhF4WXRdIF8p4eIgbzd7ngFd+jwHbG WR7y8onzhnUpbKnLnpfwl5/DPRu0G6yqAJzrOCqsu9T50XfogijWhVNCMED0zhh8JGEi 1vcm0Q3nqaLQslZxsVZci9FNyrfgKc/kOGnUP5NvVjn0jIR0ZGrwIrN4t71VVPA90970 UY8Q== X-Gm-Message-State: APjAAAUAC7zwO/SDRRbPS5JaYi9VaSy3B2+MJuuhrj4iFOhu1zwLG62C tKDBsty6OJuKeJm9xCcd0eAhuYQ+fUQ= X-Received: by 2002:a2e:89c9:: with SMTP id c9mr7351202ljk.108.1570745586871; Thu, 10 Oct 2019 15:13:06 -0700 (PDT) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com. [209.85.208.170]) by smtp.gmail.com with ESMTPSA id g5sm1509467ljk.22.2019.10.10.15.13.05 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Oct 2019 15:13:05 -0700 (PDT) Received: by mail-lj1-f170.google.com with SMTP id v24so7814501ljj.3 for ; Thu, 10 Oct 2019 15:13:05 -0700 (PDT) X-Received: by 2002:a2e:8315:: with SMTP id a21mr7522218ljh.133.1570745585422; Thu, 10 Oct 2019 15:13:05 -0700 (PDT) MIME-Version: 1.0 References: <5f06c138-d59a-d811-c886-9e73ce51924c@roeck-us.net> <20191007012437.GK26530@ZenIV.linux.org.uk> <20191007025046.GL26530@ZenIV.linux.org.uk> <20191008032912.GQ26530@ZenIV.linux.org.uk> <20191010195504.GI26530@ZenIV.linux.org.uk> In-Reply-To: <20191010195504.GI26530@ZenIV.linux.org.uk> From: Linus Torvalds Date: Thu, 10 Oct 2019 15:12:49 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] Convert filldir[64]() from __put_user() to unsafe_put_user() To: Al Viro Cc: Guenter Roeck , Linux Kernel Mailing List , linux-fsdevel 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, Oct 10, 2019 at 12:55 PM Al Viro wrote: > > Anyway, another question you way: what do you think of try/catch approaches > to __get_user() blocks, like e.g. restore_sigcontext() is doing? I'd rather have them converted to our unsafe_get/put_user() instead. We don't generate great code for the "get" case (because of how gcc doesn't allow us to mix "asm goto" and outputs), but I really despise the x86-specific "{get,put}_user_ex()" machinery. It's not actually doing a real try/catch at all, and will just keep taking faults if one happens. But I've not gotten around to rewriting those disgusting sequences to the unsafe_get/put_user() model. I did look at it, and it requires some changes exactly *because* the _ex() functions are broken and continue, but also because the current code ends up also doing other things inside the try/catch region that you're not supposed to do in a user_access_begin/end() region . > Should that be available outside of arch/*? For that matter, would > it be a good idea to convert get_user_ex() users in arch/x86 to > unsafe_get_user()? See above: yes, it would be a good idea to convert to unsafe_get/put_user(), and no, we don't want to expose the horrid *_ex() model to other architectures. Linus