Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9039889pxu; Mon, 28 Dec 2020 05:09:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQ/AZi0/1vgW6c16gPjRI/HsCh29zbO1q/5pVxtQp9hlpMO9W3zQWk8mavJdBZwjfuoNuG X-Received: by 2002:a17:906:351a:: with SMTP id r26mr40034183eja.409.1609160981673; Mon, 28 Dec 2020 05:09:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609160981; cv=none; d=google.com; s=arc-20160816; b=hqiTOHgDp6TbNsvmjKRUGYtecu3yFtOzW+3eHtNkdzBLwDtXI4RtohVhsC5oNmUvg0 oNT30lQRxB77KrV8s7A8vTm9tflA+k/xOSdkiBP6C1Ro+ZPjZEf4f0ZlE78C2vS7jzLG +Cu9Y5DlwIS4Ginj6Pkc+9//uNm0gcHFSvgPMAYxVaeW6bLRA0J77STFAzRI2SzeYJRW H9/1NyjqkOLZR/WolNmSHC1Oys2RUA1+DlsAmosoaO0YMvuoFuYaPVaAJxMzHuYMyIxm 5mwN8JW74J9+060l5Ylfp5iiR2OpfL5Tnim5xYQfxBi5xPYMX+lbmKZz43WV2C/HcYdq 7dZA== 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=c4mYvM6ZE2TYsL9s0q8E3RWmekjRP99ssawxF+oY1HM=; b=tmgo6jJ8h2Zj+Van71S0zR9XG+JH0q8GLibf5D7UjmWdxFri//Ng/3WFx0FHSXB7Et a0vOnbH6Rbb6Sh8q+Eez4D8nnabk/NotrmrtyF+HECQQtsHr4zPUuLdJajKn0F2ezgve +Qd9NERLaGDI//0sfkiucKdwztoPHEuRplwKkDoz8t4O9uB0EqIytfuSEUGFzrnaqeQ/ YQ7fqBNPN+vlKOIPrgMoe27UCDsfvXahEeIybp1Oy0IpAV93qft3in9fnG2pap6UVJuo ZsX4R/vu1ZsrzLIEC+GUUOiCGajKSM+tpQcf50cU3P6g4P06EILFimir+ogafpPPGD2J Kfjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FkpHp8ob; 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 c22si18136632ejx.290.2020.12.28.05.09.17; Mon, 28 Dec 2020 05:09:41 -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=FkpHp8ob; 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 S1730329AbgL1NEA (ORCPT + 99 others); Mon, 28 Dec 2020 08:04:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:59646 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730225AbgL1NDa (ORCPT ); Mon, 28 Dec 2020 08:03:30 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id AFDF222582; Mon, 28 Dec 2020 13:02:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609160570; bh=wXBaScD4/w/XArzcbfOiAv5YV72PALyJRo9O6USkGNA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FkpHp8ob+85qdot2jEYH311ky2T9PD8ROQBfdjJ6eHmbAdnGB9ROdkX22j/T5QZx/ 7H2kyZPEHu3m041oVhRgYO0zMSrvoX6XMGhsz9AwMwU+VAOeGHiKpjyPPHImpPUUA9 jSfCqb0zCEnpqiq5WXncgZ4WeLFSm7RUWMl5GXZk= 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 4.9 096/175] dm ioctl: fix error return code in target_message Date: Mon, 28 Dec 2020 13:49:09 +0100 Message-Id: <20201228124857.897615525@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124853.216621466@linuxfoundation.org> References: <20201228124853.216621466@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 6964b252952a4..836a2808c0c71 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -1549,6 +1549,7 @@ static int target_message(struct dm_ioctl *param, size_t param_size) if (!argc) { DMWARN("Empty message received."); + r = -EINVAL; goto out_argv; } -- 2.27.0