]> 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)
committerSasha Levin <sasha.levin@oracle.com>
Fri, 4 Mar 2016 15:25:51 +0000 (10:25 -0500)
[ 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: Sasha Levin <sasha.levin@oracle.com>
net/ipv4/devinet.c
net/ipv6/addrconf.c

index 419d23c53ec756327178f9101ea8287d671c9a47..280d46f947ea85d65b5dcdce1d70c23e94e10158 100644 (file)
@@ -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;
 
index fcfbd05a8e0b49a476837ba6b1bd098f21f1a1a6..f555f4fc1d628994a932fb5fa2cda6ccabee7f45 100644 (file)
@@ -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;