From: Anton Protopopov Date: Wed, 17 Feb 2016 02:43:16 +0000 (-0500) Subject: rtnl: RTM_GETNETCONF: fix wrong return value X-Git-Tag: v4.1.12-92~150^2~166 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=7b74c923e78608af64f6bcf5dfaecd2fe9ca218a;p=users%2Fjedix%2Flinux-maple.git rtnl: RTM_GETNETCONF: fix wrong return value Orabug: 23330960 [ 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 (cherry picked from commit 3aa450dcb11d582aab3a6aaf19b67380ab4322bc) Signed-off-by: Dan Duval --- diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 419d23c53ec75..280d46f947ea8 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 19b259556b115..c208845040165 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -560,7 +560,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;