Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759322AbcCVLII (ORCPT ); Tue, 22 Mar 2016 07:08:08 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56684 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758770AbcCVKmX (ORCPT ); Tue, 22 Mar 2016 06:42:23 -0400 From: Luis Henriques To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: Anton Protopopov , "David S. Miller" , Luis Henriques Subject: [PATCH 3.16.y-ckt 069/142] rtnl: RTM_GETNETCONF: fix wrong return value Date: Tue, 22 Mar 2016 10:39:58 +0000 Message-Id: <1458643271-4227-70-git-send-email-luis.henriques@canonical.com> In-Reply-To: <1458643271-4227-1-git-send-email-luis.henriques@canonical.com> References: <1458643271-4227-1-git-send-email-luis.henriques@canonical.com> X-Extended-Stable: 3.16 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1417 Lines: 46 3.16.7-ckt26 -stable review patch. If anyone has any objections, please let me know. ---8<------------------------------------------------------------ From: Anton Protopopov commit a97eb33ff225f34a8124774b3373fd244f0e83ce upstream. 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: Luis Henriques --- 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 e9449376b58e..aa4b9990dd7a 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -1798,7 +1798,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 405575f9ae77..c844b31c767e 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -535,7 +535,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;