Skip to content

Commit

Permalink
rtnl: RTM_GETNETCONF: fix wrong return value
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Anton Protopopov authored and David S. Miller committed Feb 19, 2016
1 parent cfdd28b commit a97eb33
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion net/ipv4/devinet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1847,7 +1847,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;

Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,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;

Expand Down

0 comments on commit a97eb33

Please sign in to comment.