Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp3081750pxb; Sun, 29 Aug 2021 12:53:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmZT0AfDlT4foh/yrPlimUkh1ujPsmhtjZry/pC/2pD3nvWLOY2ycMMrK3AFZOdSm05VCx X-Received: by 2002:a05:6402:1913:: with SMTP id e19mr20157995edz.9.1630266826329; Sun, 29 Aug 2021 12:53:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630266826; cv=none; d=google.com; s=arc-20160816; b=SND/RqrfyVsbig4yYB2dSKdq4a6PlbNtL9kEVWJcwGRyRZ7NgZpUrx/7zg75O3WypP MLZH14zD0VQQfuX/JEJcgZmu5eW7afmAQAftZ7iL5DskKeTk57rLoM9jXU0TPsdQ4unZ xY87bn6JzVXv6oVSaWMnstXWWyC6NHlys9znDa3f6gWtgBLWVqBqSc6k1G8KiGmpMZkW V5n2TdIWtV9OIxb9+KIKyzYf8yWYygi1KRdCTvjstb01UoRHSc20XN6CBPQHW1gNAEhc dvXSYnJIaubyNAnfW2kFILju8GGry7wQQtgYpMNhAJ+vq98wfM1sR69tUMBKh/EYZKVb GgTw== 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=1e3nSsPm9vFxQ5jfIvm1uHispKQgTIcx2dzb6BILhtM=; b=X8Sk+XPUloOQdFxpG11i7N+YMvCVGlhVVgotHORi1u/0W38TQUnVoH6HM207lr6AWU xHZ6EXFU87llyoFskjSE/fVZDGzT2qnx+mPIQFm5Hapai6Ea1oqrzlZcftlWyP5iHEsf JLtViyuPwtUvta+QNMhwkBuY73w7bP+hoP9y5iq1saN276pBmu6AEcvNu+tvbNqqF5ZW 0sur75RCH7mSMJkhL3hKb6N2ppP/VuRDuUXobZCWskyg2mEdvCzcxX+i7ZeLa4XljnJp nxs6L1PlQXBQ95ivgTCWb19KuP7bQ8uYv/qo3xFtyuiuNPKdh1pBNmkKfq5/JACMFWE2 uSFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=DPvfzjwG; dkim=neutral (no key) header.i=@linutronix.de; 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 n10si8216038edx.474.2021.08.29.12.53.22; Sun, 29 Aug 2021 12:53:46 -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=DPvfzjwG; dkim=neutral (no key) header.i=@linutronix.de; 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 S235892AbhH2TwZ (ORCPT + 99 others); Sun, 29 Aug 2021 15:52:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234379AbhH2TwY (ORCPT ); Sun, 29 Aug 2021 15:52:24 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA36BC061575; Sun, 29 Aug 2021 12:51:31 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1630266690; 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=1e3nSsPm9vFxQ5jfIvm1uHispKQgTIcx2dzb6BILhtM=; b=DPvfzjwGONXER0jR9xvjUbua8zjtnfilBJrSOw3hJyC72q0HDjMiEs94sqjPs2Mh/Nk3lt DznVBOlT9hejmPxH2DGciXBSVfTnsJR5AgcwhFjepGmRCNNjUJg9ViVoOreRiI4NskCkF2 AFz1h2fA8xzF70oV+o0oSIGhaRyx7jmM2lH1KzedfL63YxJqcy+ztdzWaTswpMvhGwrSwE 9VEJ41mievNUgl2ATSDruWvcYyl25fOXDWwwSX3qGKOouB+zNeiDJ3bDrnXMB/5DO7EHWP zL+yTNbRQh0uidm3WQO5hz+kptyviqN7X8Rz1sZQl/nQbc9ob9sUw4qGqSyRxg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1630266690; 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=1e3nSsPm9vFxQ5jfIvm1uHispKQgTIcx2dzb6BILhtM=; b=veVifLK6jQGM6KFk3te2gOXCaon93yGE0+oJ1TfamLRvAu4RlVrmGT9c6EaedlKLBxdsak qFEYMcWO6kYE29DQ== 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: <20210827232246.GA1668365@agluck-desk2.amr.corp.intel.com> <87r1edgs2w.ffs@tglx> <87k0k4gkgb.ffs@tglx> Date: Sun, 29 Aug 2021 21:51:29 +0200 Message-ID: <87h7f8ghby.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 29 2021 at 19:46, Al Viro wrote: > 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. Let me fix that.