]> git.hungrycats.org Git - linux/commitdiff
rtnl: RTM_GETNETCONF: fix wrong return value
authorAnton Protopopov <a.s.protopopov@gmail.com>
Wed, 17 Feb 2016 02:43:16 +0000 (21:43 -0500)
committerJiri Slaby <jslaby@suse.cz>
Wed, 2 Mar 2016 15:29:14 +0000 (16:29 +0100)
[ 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 <a.s.protopopov@gmail.com>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
net/ipv4/devinet.c
net/ipv6/addrconf.c

index f4b34d8f92fe6a2708f8b17835ea45bd46c23adb..68447109000f896e72385b52edcf45289586718a 100644 (file)
@@ -1785,7 +1785,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;
 
index 6c629ffb87564527266f83a81eb37ad23730bda4..bbf35875e4efc4aae5305d853d506f4d9de22095 100644 (file)
@@ -528,7 +528,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;