Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9272144pxu; Mon, 28 Dec 2020 11:02:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJxLOL3JhTpwZSnUEE3eYRKhXeMNHL0IvKAU4zDk4dZTjhnWZ0LkqOGkNLgmYM+6s4dHR8qo X-Received: by 2002:a17:907:11ca:: with SMTP id va10mr41043804ejb.78.1609182145042; Mon, 28 Dec 2020 11:02:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609182145; cv=none; d=google.com; s=arc-20160816; b=m0rUPVTeniWbqq8YTu74REWkjTqJ/zjsKe+qfoIvdSCliJbc0s4pjKdP6iy5aDl8ff o69S3aR9bbjTkkmaTLnTngtg6bYV3kkvdEvLPrPcZxeHARJes/8wGL0S9GnhBSHzGcvU sy7npaP/uu+ffAkmas8f4Bj1aGSccjq00isWCPtsj8CcXmcW0PsSAynl+NIzVSv7jbwM WW51gopRMS9iKkVgn5cRaK9KPXs3vkqQUWKV83P/UcUysEDlYCc6Xoj7QZsZIpkXyZQo 4Te0I4UW/0Dn8CJ53afkSFIYgg+P7luQ82cu6g76tsgtMUitr4OAHcIYb5si7wTmijt8 ZxMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VyPDdBOxlVp4pcB0fLeEsN/NCXv3jsoZ7v5hLye0qxY=; b=E/GBr8BtE8QmpVJzR8mZRVvGVnld0vq2MGK67Vd0LD0zrzPrAR3nlBUNa5juBRDdJP rO7KafITTWoLb7247RODxbeL2GcjMxTZP5p299VWxIpd3y6/nyao7ju0Wy0v8lQ/Qw2f DGhMfo5aRE5uT0Ij+wH5jJHtqBYEtPMn0nYowOQyK7KYKGaCCW7eXBDl5/Nc6PoVaDk1 RmlnVwpju+kqizKUlQ1lMWMoPvu1kvlTj9O7GW5TSEga/EDeaSnYiiH43LrfD6z6PyhJ zpP+b07NDBcQ4EdSFFrhr2jw8P3UauyokdR0GsWjtRhRuvPSIT7ZZFSk9P8RgxZW6GF1 TS3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HfWGWA+n; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t23si17504947edw.381.2020.12.28.11.02.02; Mon, 28 Dec 2020 11:02:25 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=HfWGWA+n; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405881AbgL1Nsa (ORCPT + 99 others); Mon, 28 Dec 2020 08:48:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:49620 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405848AbgL1NsW (ORCPT ); Mon, 28 Dec 2020 08:48:22 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6F7572063A; Mon, 28 Dec 2020 13:47:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609163256; bh=DUlG3BMwoXm2Aeu2oI04bS28BlZs6eKXCWDhxWlwD4U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HfWGWA+nU6RngS1/NsqPZJ14T6HAycyDS1XeZMCz4N7sPY3xBInIbkvzqMMVyriXa nPXBxyayAyPrzg6+rg1xHNs4M1nhxL4FGG/aSka2Y5f1oLKfAFTynDiQZrd1ddfuFu RMXAwTpWTlbPZ0359JL65cRmUJavBfCAlJGNNNAM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Qinglang Miao , Mike Snitzer , Sasha Levin Subject: [PATCH 5.4 223/453] dm ioctl: fix error return code in target_message Date: Mon, 28 Dec 2020 13:47:39 +0100 Message-Id: <20201228124947.950548514@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124937.240114599@linuxfoundation.org> References: <20201228124937.240114599@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Qinglang Miao [ Upstream commit 4d7659bfbe277a43399a4a2d90fca141e70f29e1 ] Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 2ca4c92f58f9 ("dm ioctl: prevent empty message") Reported-by: Hulk Robot Signed-off-by: Qinglang Miao Signed-off-by: Mike Snitzer Signed-off-by: Sasha Levin --- drivers/md/dm-ioctl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index ac83f5002ce5f..1c5133f71af39 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -1600,6 +1600,7 @@ static int target_message(struct file *filp, struct dm_ioctl *param, size_t para if (!argc) { DMWARN("Empty message received."); + r = -EINVAL; goto out_argv; } -- 2.27.0