Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9046389pxu; Mon, 28 Dec 2020 05:19:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJwDPLcwoPuRQpRCAWTzWPTKw+OtbLLRxYnAefulDpqYlsJj1coSv/5KxKVAgwMev43gKY0/ X-Received: by 2002:a17:906:52d9:: with SMTP id w25mr40527355ejn.504.1609161583335; Mon, 28 Dec 2020 05:19:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609161583; cv=none; d=google.com; s=arc-20160816; b=yPLqyzpgKCwicTtL8jawwLZJp0oLJ5P6/rMX7Zr6QWtAzm0wvIzBG69nrOk1Ti9sOJ rJ/N5BtsLaiT3anfaWyqdferxHJrcMbDzB5PvyVTd0m06vWSeXLlQWR5kPqm51tLhhO+ Z7JGOwyIDPX0adM3OzCUTwO3Fs7CobgxmXcdPL+fKXKUQBkwZs02l1m9xP94GbWLgYWM lpgLnCkwLw6mxGcpejy4z4oTBAIAri0XccN6cbLpiLpS8orKm9L+m9DuogFyHuWHwZTp 74jcj3wn+moMtHh2/gNm9Lf6dEmrZY4LXA9y2cpwUJ1LoJAEgxYLbsuKpXOkr55XqFUE XHlQ== 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=bCT1qcS0/KLTNvHcj2t8K/PEhtRJlw5HddGO2Hbugyw=; b=H2pa4EILnooXJWK0/uuyYYCAyw2k0EywDWSJRtDOy0dzDQQa/C5KxhlCIXbcJ24kj3 wcsGILUdKK5/At7TVJZrorn84uVxwa9/COYuclXmLidvTudDiG11gRqdClisdpXG8PhO Ckh1QY7wzMDQ9AU3TynHDi9uzMJ97gSHLvswYVpFoVUZzc0aycBmTb8lxPfK/uYy0kkn 60FSR4nCe1uSLovDcqkY8Vy5aog8qd0MOAnzZW+Itu2UIu7DgTvcdExEcW138Bp/Y+Tn rmiexQ/Lu6FyluYzotuZD19ok40qhG41kh8t/wYg8xbQ20sKSBGrdTh//VlXA3YBeHn+ TBeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="t9p/pJVP"; 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 i8si20359137edr.271.2020.12.28.05.19.19; Mon, 28 Dec 2020 05:19:43 -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="t9p/pJVP"; 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 S1732401AbgL1NOH (ORCPT + 99 others); Mon, 28 Dec 2020 08:14:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:41908 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732369AbgL1NOC (ORCPT ); Mon, 28 Dec 2020 08:14:02 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 60127206ED; Mon, 28 Dec 2020 13:13:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609161227; bh=1CtIWeQZtjeYx/Ib0qH12yADYI9cX/yHqJu1k+mDgnE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t9p/pJVPM1JxyaiQLIKQS8LMfjUJ3C0LXobTV4PahQBr9T0gVZ7VqeY8chlcxALxz 7RM1N4rpa/kijVRYFOB6DVS9y9ar5VQ4IV7v/FHNOAWimC/o+5UDDfVBOxOH4gkX// Q0zJBojtvLY7ddM540eMNK7jwVOjqBJQa0bUYcKg= 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.14 137/242] dm ioctl: fix error return code in target_message Date: Mon, 28 Dec 2020 13:49:02 +0100 Message-Id: <20201228124911.451473001@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124904.654293249@linuxfoundation.org> References: <20201228124904.654293249@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 ca948155191ac..469453e106d14 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -1574,6 +1574,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