]> www.infradead.org Git - users/jedix/linux-maple.git/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)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 26 May 2016 22:45:24 +0000 (15:45 -0700)
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 <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>
(cherry picked from commit 3aa450dcb11d582aab3a6aaf19b67380ab4322bc)

Signed-off-by: Dan Duval <dan.duval@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 19b259556b1156fb07d18f1e0a98c4df7b33513e..c208845040165abb5019d43a61558110cddbb708 100644 (file)
@@ -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;