Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2445616pxb; Sat, 28 Aug 2021 15:12:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgP73hN4CBkFKpz4x1CkJ7NjVU8+8aOn6FAT7LKCdV+JTlVfe9evwzjIs9DSVyWm9jb0Hg X-Received: by 2002:a5d:818b:: with SMTP id u11mr12476335ion.43.1630188757844; Sat, 28 Aug 2021 15:12:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630188757; cv=none; d=google.com; s=arc-20160816; b=vkARgV9frc6FpDiJYt1H2rx/WAGrvYwI2EvNIS294hR8ozec/IsLIyD//OhRPZiDVd UAZt/mgsnSYQtKK0HwH0zcYpbquXCGaNKYRk6Mzr2d6vxA+AeNpLIANcahCxFloxjj2m sYDnlyuVh6bXiMgE+7+9zRLll0pdFwzLfv3V5ONHZ3P7/qZgTS7sF66mEQ6PrC/3a5tD 8Sjld4aCWd5n5y6JkBqI8WB+C47dRxfY4tJ5TcY36wZlECkK5WaQ2Sb/a4+0+K8YCxiA u5Q/cX3velpTg3UAF5Ee8ao0s3DvwgrA43oqQdJoKSnG+PTpS3BduetcJauSJkmu4i2R Eu5A== 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=vaMjbyP8RxfD7lgxH46AISKt78RBcGl4OPnoJ1Uw1Tc=; b=IFm/VWJP7wWfGpw2QMWvEx8CKr6uwuBzqyYmN2kb45W8jS/rMp1YZM9o019vR81s3y duu7g2FsMQNCDp/q2B78dJIqMeazxm3bdaAMVUMnBM93J9/6g4TyjajyRQfAlE69+98T yULTwahT3aBz9JDoL7Kwpfqhjk8Thai2le2s82iVD+fQahKWGKl2OZ+rHbzUS+frG2e/ xNww6Lgvtr3xTLKuYe1lqlstn2K9k6cvFTpwjeQuKL0B9O0fmuUZfJW7w01GtZ3QJKOf wUmzV5d/1qqzYeH+S1mgGwKg/VCs0dLrpHkXCJkzkylHtFiABk+CSXgXwppJz0xZfMu+ gANQ== 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 b9si10138169ion.34.2021.08.28.15.12.25; Sat, 28 Aug 2021 15:12:37 -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 S232305AbhH1WMe (ORCPT + 99 others); Sat, 28 Aug 2021 18:12:34 -0400 Received: from zeniv-ca.linux.org.uk ([142.44.231.140]:35788 "EHLO zeniv-ca.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230253AbhH1WMe (ORCPT ); Sat, 28 Aug 2021 18:12:34 -0400 Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mK6Y4-00GtwB-63; Sat, 28 Aug 2021 22:11:36 +0000 Date: Sat, 28 Aug 2021 22:11:36 +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: <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: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 28, 2021 at 10:04:41PM +0000, Al Viro wrote: > 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... BTW, is #MC triggered on stored to a poisoned cacheline? Existence of CLZERO would seem to argue against that...