Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9113807pxu; Mon, 28 Dec 2020 07:01:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQOy5ML6aAYedKSjF7isUZm34rkqZ6DExA7ATYa3xia7Id1Tbh2hm8GMrLBUnGkudqAxaJ X-Received: by 2002:a05:6402:b57:: with SMTP id bx23mr41876237edb.191.1609167664847; Mon, 28 Dec 2020 07:01:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609167664; cv=none; d=google.com; s=arc-20160816; b=zcafbh+h2IlPBB/BQyGhSYyuxpRUm/sD8TgvCr6xFBjK/oaYgcJTwN02JjmQJUPFjn FdAiLp/g4JuiY21qx83RaJa2Ai1XUAsxEChFA6YaMF6smF/tjW16+nd4YGdqV5//1HOZ lhi8DbfC8gB6CQBbQHZyiwhZF2ifrJ+2jr5qKiAp57PkxvWMD5mL0p9gV5WYloYWd7RS H16ZgIKOy81t9gx91sm5rfnqNI+O5BMGLQfPNLyw8qX+e9X9/3+RLrTlPEUKldnbHR2u QpCm/UE1O0+12fQAVdNKuTh96keOyHgiaTBRdnQlTait2vB3Y/h8jIPb2vZPr4lYkGzW v5dg== 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=JxceUcNHP10uA77V+FqrvS303aGoD9maepp5eU0gfdk=; b=GrQ13xmOVhl99TmERfn/BddXDiXBExKJtK1iQeVizuFeysIpKihMqj6/k+OnftWqIK Y+fM/P3wlEg67yk1ZAE3CbZeJvrWgH20s4EWu8/sTCMea23bReYRQlqqar47i//iSZYp 8W4R4vv6jieMhL9EmbOx0olQLNrA+LS7UiHt/Bm3gqeQV0OB0VFc8wkuOGcwG067LcLM LtNtJgOzgaCMOa0eR5S5FQeiwjLUdeAT1VZySa99WnFQWvwjkS60nzLv4CHX7/Ht3gPo TmUxQ/FSckQ6p8MXF8UG42MhjG3rVfqb8BL6P1Z+7e/GCzsExF1yZ3zvXel6HEw937cl t+Ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SlHoPu0h; 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 h14si18367555ejt.198.2020.12.28.07.00.41; Mon, 28 Dec 2020 07:01:04 -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=SlHoPu0h; 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 S2440632AbgL1OPU (ORCPT + 99 others); Mon, 28 Dec 2020 09:15:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:49528 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2440604AbgL1OPO (ORCPT ); Mon, 28 Dec 2020 09:15:14 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1345420715; Mon, 28 Dec 2020 14:14:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164898; bh=NkagdxxcvO1g4JXa7ZRHHwva3mUjePEJtr4sE2tp+oM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SlHoPu0hDl1SWxuH3roxUpFgPiibw+4Om0Qnj/6kY501tDTEGjHLtMIaHtedr/8Dq cgMQFuarWXnCN20fgV1+B/gAz0cpWJy6Y+lLHO2xaonKCMaCqnxjiHXW2udhrnx+VX 2hOI7JHVmIzyCU2IimWkduYGfC7hHjqXTM5JYTqw= 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.10 311/717] dm ioctl: fix error return code in target_message Date: Mon, 28 Dec 2020 13:45:09 +0100 Message-Id: <20201228125035.928754333@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@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 cd0478d44058b..5e306bba43751 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