Commit 7b715d92 authored by Anton Protopopov's avatar Anton Protopopov Committed by Jiri Slaby

rtnl: RTM_GETNETCONF: fix wrong return value

[ Upstream commit a97eb33f ]

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: default avatarAnton Protopopov <a.s.protopopov@gmail.com>
Acked-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent 27b6d267
...@@ -1785,7 +1785,7 @@ static int inet_netconf_get_devconf(struct sk_buff *in_skb, ...@@ -1785,7 +1785,7 @@ static int inet_netconf_get_devconf(struct sk_buff *in_skb,
if (err < 0) if (err < 0)
goto errout; goto errout;
err = EINVAL; err = -EINVAL;
if (!tb[NETCONFA_IFINDEX]) if (!tb[NETCONFA_IFINDEX])
goto errout; goto errout;
......
...@@ -528,7 +528,7 @@ static int inet6_netconf_get_devconf(struct sk_buff *in_skb, ...@@ -528,7 +528,7 @@ static int inet6_netconf_get_devconf(struct sk_buff *in_skb,
if (err < 0) if (err < 0)
goto errout; goto errout;
err = EINVAL; err = -EINVAL;
if (!tb[NETCONFA_IFINDEX]) if (!tb[NETCONFA_IFINDEX])
goto errout; goto errout;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment