Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2453314pxb; Sat, 28 Aug 2021 15:25:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyVdlfo/CRI5WEmjwOuoPl92Z4UFyU4bNj81S/u6OYzRINDaTpzgC19DvXz1c9eRFJQZx9 X-Received: by 2002:a05:6402:14d6:: with SMTP id f22mr16754253edx.274.1630189539920; Sat, 28 Aug 2021 15:25:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630189539; cv=none; d=google.com; s=arc-20160816; b=stF0ppAaHvQTLVrDVVDRvJgIDUXIkULhScadavx33AGc0dYcjVovpHnrthvbGVMkfb /D9lsY0PLEsB6HPatAb2iCWMnTIa0syPwXY8kA/KNWLlxXh38rbTs5x7YifJADsdo5/C jL8Z9pp6qhjRbgQ7P95bGi8tZW+zeylIZunvFEzt96cLh3JLei1mBtShN6Og9yVkUBnv fe0E7183gtNS052+dFf5nLyrMXsJ2WhsKiOPM8ig0Qj8QUBN88qk8VsuV6AkU2E3oZ3d o+E2VLTunSsqTMAcpIXDeTFMefby/Txbds7NGkOOi71sQkSt5Gbl4bzLqGkAYXVsBjCM l64A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=j5baxkRt6FRyNR9NaORfg0w1u2EC3Afc4IwvC+mzssI=; b=kdYFeFWH4e3sDdB0gIgoOIKvC4LQGQA0GUHPi91jpXoy4n8f1wskfGyjKrm0ST8QDe XxMDYY7PSxxJJup4Ytv4z4aNfh/Lfb3K8uU2GzYMMd5HHZr+zY9bjv8gGSk8tlMm7bv9 JReK47P0DK82sVHmuwCKqtUSn+sFRbVAptf3HxL/FFLWEsMGXwNYkImldO6QveTyETSr eaH1c69VZ9lScQ6bWiaAGBvJxhpgHH3Qsn8g4Q6IoqciE1YaolS5VdEZCeAnEZfRpj0Z zGDkamwSoaUx99INEDtHmzcxfM+VGHzBtkgMtsvVO4hv9jzvEcwsmnLR1a4rTaJ01qVB G9BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ya9EcwyY; dkim=neutral (no key) header.i=@linutronix.de header.b="qq8/oe9X"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ho39si10111371ejc.235.2021.08.28.15.25.15; Sat, 28 Aug 2021 15:25:39 -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; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ya9EcwyY; dkim=neutral (no key) header.i=@linutronix.de header.b="qq8/oe9X"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232580AbhH1WYk (ORCPT + 99 others); Sat, 28 Aug 2021 18:24:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230253AbhH1WYj (ORCPT ); Sat, 28 Aug 2021 18:24:39 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF473C061756; Sat, 28 Aug 2021 15:23:48 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1630189426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=j5baxkRt6FRyNR9NaORfg0w1u2EC3Afc4IwvC+mzssI=; b=ya9EcwyYkE0CPACg9mqhH69MrCoxvtcfYUqNOVM5q3ehhgRT3td05EBy3ZMp+PuTVhWJ40 rpBKMkXq8TOmt8hAhbT9I474UC9yxt8ZXBNTulUXkY6MMAI7yUNjYmhVDjm4x4n3Gkc92H RPnf0SXPrlkAATkwqwysNabdzj4SD4bb/xR63ZXeenc4qyrxnoX2V4GXGpoja2q879+xvc gxD4bhWix+AZYVS0Bc450GsWtEJckAKsZphfE5giSRbgSlSXT6d5+ZeeDC8rw+pVAbfunX zmjdEFurBUUmQDqirdvPzSCKutMacgLTmoJpBeKM/YYOAxUUOvw9ApnnnSMzKg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1630189426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=j5baxkRt6FRyNR9NaORfg0w1u2EC3Afc4IwvC+mzssI=; b=qq8/oe9XX24Pwfmj4Nd8xIS/Zne8QvcBxBVYjviiFrqkveI5UkPagjOqx75vs02MlVC/pz L1isaALRXnikNZAA== To: Al Viro 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 In-Reply-To: References: <20210827164926.1726765-6-agruenba@redhat.com> <20210827232246.GA1668365@agluck-desk2.amr.corp.intel.com> <87r1edgs2w.ffs@tglx> Date: Sun, 29 Aug 2021 00:23:45 +0200 Message-ID: <87o89hgqdq.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 28 2021 at 22:04, 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... Yes, that makes a lot of sense.