Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2443955pxb; Sat, 28 Aug 2021 15:09:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzq3FtTt7nIK3ri6fIJUlfrKW+hG1VjrVihw9v6nmu0DJUJlIuxAPMrUdl53FpYvY484UoY X-Received: by 2002:a05:6402:34d5:: with SMTP id w21mr8147483edc.235.1630188552296; Sat, 28 Aug 2021 15:09:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630188552; cv=none; d=google.com; s=arc-20160816; b=BHE8KkO2TlKOThBQZzdbRnodhMnUCwUQ3FxuK2G0qdgKunF4BRuj0hl1dN0VjKlOz3 7RPAT4X9Awat2WzoSS7A267DztjOVSYmRf7cKvBe0/6Ls1BAEV8pU1gRhejkdTTXvlJH 2r7kjivyc9j1Dk6UJUiDIASkAwQFSn0mATBdeM3N5bqbIoLl9GmmalMg357E5Hrue5Iw gw/VFYLeyk0jmzIHp4OugW1kWOepoZJc7Oi4qNDojTxIv6Dpy64WeEfLrZmw+0TchpyH 9j9hVVQBJClOSI2F+cQH9FIUa+HjvD2HXfF4jXL3REAXJQv/kSD7rKNrarqWKUbUbO5Y fZQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=LMuDOo4sshEcXzpIgnwRj6u1S2U3oRoyQj10MZpT3kQ=; b=E/2mK+Q4PlPX+A5ShuLaROWHgsQrKVBOlJV71iv1OLyADUcnlRR2d9Who1pAhrOzNW DZHzVbpnsVzBwrgc20kYli5oDiitcEN6a/P14CBzLwFLsQKmmbR/tXxmDQgOcS0R7wsF Qf6Ux02QwhZQeLWuFy7jb8CR70zhYMzU89qnyey5NZCkYuNCUHE0rxGjJ9H4l2uWLEK+ oB+/FaJH69593j9wgKW1FmCLqPyjM6onQNKbG7u2wJPCoiMUdZG6PZhBk45mqsNYTr/U jILFcADDGxfEXsKpHIGKmSInlDxbiOrO0scWkvusvGD/GGcptO0vkpxuk7FljkSTgO7h UipA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z1si1558991edl.531.2021.08.28.15.08.47; Sat, 28 Aug 2021 15:09:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232563AbhH1WH5 (ORCPT + 99 others); Sat, 28 Aug 2021 18:07:57 -0400 Received: from zeniv-ca.linux.org.uk ([142.44.231.140]:35682 "EHLO zeniv-ca.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230253AbhH1WH5 (ORCPT ); Sat, 28 Aug 2021 18:07:57 -0400 Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mK6RN-00Gtr9-F8; Sat, 28 Aug 2021 22:04:41 +0000 Date: Sat, 28 Aug 2021 22:04:41 +0000 From: Al Viro To: Thomas Gleixner Cc: "Luck, Tony" , Linus Torvalds , Andreas Gruenbacher , Christoph Hellwig , "Darrick J. Wong" , Jan Kara , Matthew Wilcox , cluster-devel , linux-fsdevel , Linux Kernel Mailing List , ocfs2-devel@oss.oracle.com, Borislav Petkov , x86@kernel.org Subject: Re: [PATCH v7 05/19] iov_iter: Introduce fault_in_iov_iter_writeable Message-ID: References: <20210827164926.1726765-6-agruenba@redhat.com> <20210827232246.GA1668365@agluck-desk2.amr.corp.intel.com> <87r1edgs2w.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87r1edgs2w.ffs@tglx> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 28, 2021 at 11:47:03PM +0200, Thomas Gleixner wrote: > /* Try to handle #PF, but anything else is fatal. */ > if (ret != -EFAULT) > return -EINVAL; > which all end up in user_insn(). user_insn() returns 0 or the negated > trap number, which results in -EFAULT for #PF, but for #MC the negated > trap number is -18 i.e. != -EFAULT. IOW, there is no endless loop. > > This used to be a problem before commit: > > aee8c67a4faa ("x86/fpu: Return proper error codes from user access functions") > > and as the changelog says the initial reason for this was #GP going into > the fault path, but I'm pretty sure that I also discussed the #MC angle with > Borislav back then. Should have added some more comments there > obviously. ... or at least have that check spelled if (ret != -X86_TRAP_PF) return -EINVAL; Unless I'm misreading your explanation, that is...