Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp4592270pja; Thu, 21 Nov 2019 22:28:10 -0800 (PST) X-Google-Smtp-Source: APXvYqzNcSRYk+RWYhPXnEUJzJfBH0r+r/3o6Mh6+Z0mbYNsetaexBE8MeQ4IZGPfPgJSQ38f05+ X-Received: by 2002:a17:906:12d3:: with SMTP id l19mr19059574ejb.165.1574404089965; Thu, 21 Nov 2019 22:28:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574404089; cv=none; d=google.com; s=arc-20160816; b=adjb3jsA/sSYdHCKjdqRFjHb+9HVWb1B6I/w3Ak7Ismn3hwN6XS7qufYe/wnbeA3Zq k8l6Zf6TsZr6TX5rXkId910qKUveM5se5iyqa6ZfRS2B4cNHjGMXzL/X/CXAMIV/1S3Q IS43uJyWjl7q209hhVNftld1Ep0bsTNk+94YPC2cmHoc11bi3jkc7kEoIBbBP5nyyg8+ xmvw9uqLmv1IleUkgZvtMc1g42lelLG43pLcuFDFBxAOq0DaqTNPpiG5RZxRkReS0d0V nU3EwjjbIOjn6U82VOs9ZDNdrH7SSGIXb5xz+xTB8MpW8yBao8CQ5oZDcEvDwadvDxcU UjJw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=q8MtVICcaT+WO7HJZndfgrz8kzMtqhRW0kJ5znQic20=; b=F7wj2yohMVuLUM4o+GUKPtmU3NaIPtd7MDmrUzGREoMQt0OqBaqQ1zJlkBIc5ZbaQh EpwtBw1Kib635Nv6LlVXuK4TqsRO1FuZVaX+zNRuz4noV4CrIGhgtqm5pY/u7lDHl/g4 Q6RDS/jZC63XKXTl1aySIJ1hm60cc6oQGjStL8ESPysErFjX/rcFGRLXHZqbZNv2WJqn BYeOmRpvOY1na+N9tqwa+ZjrLo1ErDfxslLABw78U2URDXku7qIQoCakw9ifcv3WS1Wu tsvLjFqBnnN8Ii46t47XXy3VuvwAAiRRMxzG4rtkOjT8qq7Iu60soA2jql4xlaiIXp8p X//g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DvgdHLDl; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d22si3523349edr.370.2019.11.21.22.27.46; Thu, 21 Nov 2019 22:28:09 -0800 (PST) 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=DvgdHLDl; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728876AbfKVGXS (ORCPT + 99 others); Fri, 22 Nov 2019 01:23:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:57084 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726921AbfKVFvr (ORCPT ); Fri, 22 Nov 2019 00:51:47 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B0A0020840; Fri, 22 Nov 2019 05:51:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574401907; bh=L7kOZ2DuuxrBOah1HpwY0bLme+c1Dzk3lN0xbxhInE8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DvgdHLDlEM56ZKNnAZ29/MmnsMW9I1Vxukv4gan0Y3gqQ6lRyGsVFX79FqnTWyLul yllQGyv39KqpO9zACx257UUrX/T7G+D1yQnafokLg/vuCiP8emScmrYNwufTWiIGrm 55PQgtEBtnBk475fMK/rX9ol3jnSFzHswI/HKjqw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Aditya Pakki , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org, tipc-discussion@lists.sourceforge.net Subject: [PATCH AUTOSEL 4.19 138/219] net/netlink_compat: Fix a missing check of nla_parse_nested Date: Fri, 22 Nov 2019 00:47:50 -0500 Message-Id: <20191122054911.1750-131-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191122054911.1750-1-sashal@kernel.org> References: <20191122054911.1750-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aditya Pakki [ Upstream commit 89dfd0083751d00d5d7ead36f6d8b045bf89c5e1 ] In tipc_nl_compat_sk_dump(), if nla_parse_nested() fails, it could return an error. To be consistent with other invocations of the function call, on error, the fix passes the return value upstream. Signed-off-by: Aditya Pakki Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/tipc/netlink_compat.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c index 318c541970ecd..6494d6b5e1b24 100644 --- a/net/tipc/netlink_compat.c +++ b/net/tipc/netlink_compat.c @@ -1030,8 +1030,11 @@ static int tipc_nl_compat_sk_dump(struct tipc_nl_compat_msg *msg, u32 node; struct nlattr *con[TIPC_NLA_CON_MAX + 1]; - nla_parse_nested(con, TIPC_NLA_CON_MAX, - sock[TIPC_NLA_SOCK_CON], NULL, NULL); + err = nla_parse_nested(con, TIPC_NLA_CON_MAX, + sock[TIPC_NLA_SOCK_CON], NULL, NULL); + + if (err) + return err; node = nla_get_u32(con[TIPC_NLA_CON_NODE]); tipc_tlv_sprintf(msg->rep, " connected to <%u.%u.%u:%u>", -- 2.20.1