Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp3080892pxb; Sun, 29 Aug 2021 12:51:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKGvNlOo2d9lWsv0K/1LjT8iSlbxBblB3D8qhYq+057Df4iEDKme2swGSLtpkxUqxmfL+z X-Received: by 2002:a17:906:2acc:: with SMTP id m12mr22325899eje.231.1630266704693; Sun, 29 Aug 2021 12:51:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630266704; cv=none; d=google.com; s=arc-20160816; b=DarSlTgLkUV5BbymFy1iGBP63x4cdwQorhTeTVG/fmXqvpyRVNUNHm1fe6TbSS1KDj GFF7ET8p5gIKyggmw12Bb6SFUMyYwuofqAx1zEHQ80yT7ExVXTN7KM/RaBQsHVH7rf8D J/3ayy3OwvFouBPN3EX1OxnQzCdGO1DjYwSQQP8ItkQIuED3TYpGWGAVuwJm+QuuQReE +MiaO3FC8KVwRlFSXFTlOC+evIhKLVN7UgasqEB3K69bNnqKwGuDN+F1C+4g4ILfaoNf uUK0oow9DzDQKSvURcEnZtQdyEjCQFPhu1fuiRisBe/PC8WmpeIzwqUjvVg4Ys/tpSNM 7yMw== 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=cIWVtod+g2kenwTEK56WqnfPoZ7hgcZq8S4Fac5Kajw=; b=cb1T2hYeUz/qFMZFQDUW5ICeT7sOzOSbUGhjjNgS/kQ4E0Bcrs4LmX1He3V1er9JCG WXI/GTnFaJTNwnjvd0pk5visGcIg7yrcAcSlN1uAeCyOvWCCzSj6dPy0VcYb1x3x5zN1 If7a7O3DrzoQDTovuPmw8Brdp0XesdGwQIxZfwcc3BBgB8ZR0i7RzBm1Ab+A9Ees8uRx bkOqEjNyrO3zbv6C3+qUCwWpi+6wAAmMlsAajA2XlmFfOHhmKuEWbk/Odxv5smu4i0MB uuoryaj99r8PHx1Ee8Tg8lQWuuuBPRWm18Puiywgna07eP1W/X43ngLj4yTYX87/IMuE mdyw== 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 n10si8216038edx.474.2021.08.29.12.51.20; Sun, 29 Aug 2021 12:51:44 -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 S235969AbhH2Tt1 (ORCPT + 99 others); Sun, 29 Aug 2021 15:49:27 -0400 Received: from zeniv-ca.linux.org.uk ([142.44.231.140]:53634 "EHLO zeniv-ca.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229451AbhH2Tt1 (ORCPT ); Sun, 29 Aug 2021 15:49:27 -0400 Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mKQkm-00H7LP-82; Sun, 29 Aug 2021 19:46:04 +0000 Date: Sun, 29 Aug 2021 19:46:04 +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> <87k0k4gkgb.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87k0k4gkgb.ffs@tglx> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 29, 2021 at 08:44:04PM +0200, Thomas Gleixner wrote: > On Sat, Aug 28 2021 at 22:51, Al Viro wrote: > > @@ -345,7 +346,7 @@ static inline int xsave_to_user_sigframe(struct xregs_state __user *buf) > > */ > > err = __clear_user(&buf->header, sizeof(buf->header)); > > if (unlikely(err)) > > - return -EFAULT; > > + return -X86_TRAP_PF; > > This clear_user can be lifted into copy_fpstate_to_sigframe(). Something > like the below. Hmm... This mixing of -X86_TRAP_... with -E... looks like it's asking for trouble in general. Might be worth making e.g. fpu__restore_sig() (and its callers) return bool, seeing that we only check for 0/non-zero in there.