Return-Path: Received: from userp1040.oracle.com ([156.151.31.81]:34882 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756121AbcCBUYt (ORCPT ); Wed, 2 Mar 2016 15:24:49 -0500 From: Sasha Levin To: stable@vger.kernel.org, stable-commits@vger.kernel.org Cc: Anton Protopopov , "David S. Miller" , Sasha Levin Subject: [added to the 4.1 stable tree] rtnl: RTM_GETNETCONF: fix wrong return value Date: Wed, 2 Mar 2016 15:24:16 -0500 Message-Id: <1456950258-513-32-git-send-email-sasha.levin@oracle.com> In-Reply-To: <1456950258-513-1-git-send-email-sasha.levin@oracle.com> References: <1456950258-513-1-git-send-email-sasha.levin@oracle.com> Sender: stable-owner@vger.kernel.org List-ID: From: Anton Protopopov This patch has been added to the 4.1 stable tree. If you have any objections, please let us know. =============== [ Upstream commit a97eb33ff225f34a8124774b3373fd244f0e83ce ] An error response from a RTM_GETNETCONF request can return the positive error value EINVAL in the struct nlmsgerr that can mislead userspace. Signed-off-by: Anton Protopopov Acked-by: Cong Wang Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/ipv4/devinet.c | 2 +- net/ipv6/addrconf.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 419d23c..280d46f 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -1839,7 +1839,7 @@ static int inet_netconf_get_devconf(struct sk_buff *in_skb, if (err < 0) goto errout; - err = EINVAL; + err = -EINVAL; if (!tb[NETCONFA_IFINDEX]) goto errout; diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index fcfbd05..f555f4f 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -569,7 +569,7 @@ static int inet6_netconf_get_devconf(struct sk_buff *in_skb, if (err < 0) goto errout; - err = EINVAL; + err = -EINVAL; if (!tb[NETCONFA_IFINDEX]) goto errout; -- 2.5.0