From: Al Viro Date: Sat, 28 Aug 2021 22:04:41 +0000 Subject: [Cluster-devel] [PATCH v7 05/19] iov_iter: Introduce fault_in_iov_iter_writeable In-Reply-To: <87r1edgs2w.ffs@tglx> References: <20210827164926.1726765-6-agruenba@redhat.com> <20210827232246.GA1668365@agluck-desk2.amr.corp.intel.com> <87r1edgs2w.ffs@tglx> Message-ID: List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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...