From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7A7FC4320E for ; Sat, 28 Aug 2021 22:23:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B900260EAF for ; Sat, 28 Aug 2021 22:23:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232902AbhH1WYl (ORCPT ); Sat, 28 Aug 2021 18:24:41 -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. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E5F5C433FE for ; Mon, 13 Sep 2021 14:32:07 +0000 (UTC) Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4B13E60F9B for ; Mon, 13 Sep 2021 14:32:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4B13E60F9B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linutronix.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=oss.oracle.com Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 18DESxH3019340; Mon, 13 Sep 2021 14:32:06 GMT Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3b1jkjavqv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Sep 2021 14:32:05 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 18DEV60u008016; Mon, 13 Sep 2021 14:31:59 GMT Received: from oss.oracle.com (oss-old-reserved.oracle.com [137.254.22.2]) by userp3030.oracle.com with ESMTP id 3b0hjtk1md-1; Mon, 13 Sep 2021 14:31:59 +0000 Received: from localhost ([127.0.0.1] helo=lb-oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1mPmwy-0004e8-SH; Mon, 13 Sep 2021 07:28:48 -0700 Received: from aserp3020.oracle.com ([141.146.126.70]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1mK6jv-0003t0-80 for ocfs2-devel@oss.oracle.com; Sat, 28 Aug 2021 15:23:51 -0700 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 17SMFSdG138407 for ; Sat, 28 Aug 2021 22:23:51 GMT Received: from mx0b-00069f01.pphosted.com (mx0b-00069f01.pphosted.com [205.220.177.26]) by aserp3020.oracle.com with ESMTP id 3aqcy0qtxc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sat, 28 Aug 2021 22:23:50 +0000 Received: from pps.filterd (m0246580.ppops.net [127.0.0.1]) by mx0b-00069f01.pphosted.com (8.16.1.2/8.16.0.43) with SMTP id 17SHfQxX018312 for ; Sat, 28 Aug 2021 22:23:50 GMT Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by mx0b-00069f01.pphosted.com with ESMTP id 3aqsrv9fbs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sat, 28 Aug 2021 22:23:49 +0000 From: Thomas Gleixner To: Al Viro 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 X-Source-IP: 193.142.43.55 X-ServerName: galois.linutronix.de X-Proofpoint-SPF-Result: pass X-Proofpoint-SPF-Record: v=spf1 mx -all X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10090 signatures=668682 X-Proofpoint-Spam-Details: rule=tap_notspam policy=tap score=0 clxscore=337 spamscore=0 lowpriorityscore=0 mlxlogscore=581 mlxscore=0 malwarescore=0 phishscore=0 impostorscore=0 priorityscore=259 bulkscore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108280157 X-Spam: Clean X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10090 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 suspectscore=0 phishscore=0 mlxscore=0 malwarescore=0 mlxlogscore=625 bulkscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108280156 X-Mailman-Approved-At: Mon, 13 Sep 2021 07:28:45 -0700 Cc: cluster-devel , "Luck, Tony" , Jan Kara , Andreas Gruenbacher , x86@kernel.org, Linux Kernel Mailing List , Christoph Hellwig , Borislav Petkov , linux-fsdevel , Linus Torvalds , ocfs2-devel@oss.oracle.com Subject: Re: [Ocfs2-devel] [PATCH v7 05/19] iov_iter: Introduce fault_in_iov_iter_writeable X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ocfs2-devel-bounces@oss.oracle.com Errors-To: ocfs2-devel-bounces@oss.oracle.com X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10105 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 adultscore=0 phishscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109030001 definitions=main-2109130096 X-Proofpoint-GUID: vN-Y4x-_Xp--BemBe4fptKqO3U3czwqS X-Proofpoint-ORIG-GUID: vN-Y4x-_Xp--BemBe4fptKqO3U3czwqS 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. _______________________________________________ Ocfs2-devel mailing list Ocfs2-devel@oss.oracle.com https://oss.oracle.com/mailman/listinfo/ocfs2-devel From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Gleixner Date: Sun, 29 Aug 2021 00:23:45 +0200 Subject: [Cluster-devel] [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> Message-ID: <87o89hgqdq.ffs@tglx> 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 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.