Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2235252ybi; Thu, 20 Jun 2019 11:20:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqxB9ZOOs9bQ1S0aiPIXvBSl0Fld5xEiJZPblD/Xi2zj513ErGrYvENNoEvLqWyqlBxJceGG X-Received: by 2002:a65:484d:: with SMTP id i13mr13746514pgs.27.1561054831692; Thu, 20 Jun 2019 11:20:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561054831; cv=none; d=google.com; s=arc-20160816; b=BoJRywq9m/r2yNIGu7e1Lf+tY/qKIhb2HtlEq1C8xUM1B4OKqfdZ3IBGxmertLEL+b kX2Jg1Dovd/RnJ2rD9G+dOvxQX+RunlJVUdxUdwyrMGuTs3uGlrW40I+naxeSnqYsis+ hppMYiU6J5pDXJ2vx3rrzq33/WLIm13LS+mYuerALLsic1GLoHc4ZaA2Ry+W1P58RpXe NCvI1LscApURHKr6RTCqgNtag+GKcmqj3V8COo9mYhMPIqYjgPcZ1UeUTiK27gUmTjNr RHheKtXLRj+ThRqQPLT2kAnsnJD8qnHQpn1WIPl4QHi/U+/tlv7oNeXXzNwfJUCUc9IT Lj7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=B9/n/RaEZ8A0M8CD9z7he5oERLudKuSRPOoUQa9EqvY=; b=c0AZbXrNrAtSq5AlNkws1wvLYDJnDahrgwoiIQMfElnh7SGrasLURyUE3zpxHgrhvA /r+jg/FFCDqHDoB9g4CyH6Rt5Ay0rW04lPij98h/+KomWtoaFGZtHJBolNQveMvi1+mM //69Jns/NwlVOqWZIgUC+6erd2e//dSMTvZomQLyonlYzTEFgMhh2hSaa30s9M4JA+V8 Y/z4vEbxmbur3EUsteA2zZ9Y7SFRmBwBxKeDtBlfxj/rbreYJdohteIKhfpBl9yhDYv+ XyAOsS+ROykojEOmlHb28DMH3wShso7b0szpxCUKD3XdRl+2aQ7uhoVX/k4RdSmvnB3T J8oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MN1RxeVf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s37si383593pjb.16.2019.06.20.11.20.16; Thu, 20 Jun 2019 11:20:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MN1RxeVf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729088AbfFTSPP (ORCPT + 99 others); Thu, 20 Jun 2019 14:15:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:43926 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726859AbfFTSPN (ORCPT ); Thu, 20 Jun 2019 14:15:13 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DA4872089C; Thu, 20 Jun 2019 18:15:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561054513; bh=1vfw/5YDOBpYEgT8fnTZuuzqDh13TDwAsSxwqD/sPoI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MN1RxeVfeUsjdCP3Pjr5ha7jyWFkh68vxpbN3NH99odZ1r5Pwyifug4gykqM6Ht0T RCr7DaOxoIBNv7EZG1RknkGkPieXa8U5agxdqs4LWKuOquM0B7OP5H864xK5GFtUFj ah/+AX7slVo5qEa1L1A4BFk/+uB+orhLbp5i0pp4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavel Begunkov , Jens Axboe , Sasha Levin Subject: [PATCH 5.1 55/98] io_uring: Fix __io_uring_register() false success Date: Thu, 20 Jun 2019 19:57:22 +0200 Message-Id: <20190620174351.820212114@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190620174349.443386789@linuxfoundation.org> References: <20190620174349.443386789@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit a278682dad37fd2f8d2f30d8e84e376a856ab472 ] If io_copy_iov() fails, it will break the loop and report success, albeit partially completed operation. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- fs/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index 4e32a033394c..e82adbf8adc1 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -2506,7 +2506,7 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, void __user *arg, ret = io_copy_iov(ctx, &iov, arg, i); if (ret) - break; + goto err; /* * Don't impose further limits on the size and buffer -- 2.20.1