[PATCH] rtnl: RTM_GETNETCONF: fix wrong return value

Subsystems: networking [general], networking [ipv4/ipv6], the rest

STALE3841d

3 messages, 3 authors, 2016-02-19 · open the first message on its own page

[PATCH] rtnl: RTM_GETNETCONF: fix wrong return value

From: Anton Protopopov <hidden>
Date: 2016-02-17 02:47:28

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 <redacted>
---
 net/ipv4/devinet.c  | 2 +-
 net/ipv6/addrconf.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index cebd9d3..f6303b1 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -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;
 
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 9efd9ff..bdd7eac 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -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;
 
-- 
2.6.5

Re: [PATCH] rtnl: RTM_GETNETCONF: fix wrong return value

From: Cong Wang <hidden>
Date: 2016-02-17 22:57:43

On Tue, Feb 16, 2016 at 6:43 PM, Anton Protopopov
[off-list ref] wrote:
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 <redacted>
LGTM,

Acked-by: Cong Wang <redacted>

Re: [PATCH] rtnl: RTM_GETNETCONF: fix wrong return value

From: David Miller <davem@davemloft.net>
Date: 2016-02-19 20:34:31

From: Anton Protopopov <redacted>
Date: Tue, 16 Feb 2016 21:43:16 -0500
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 <redacted>
Applied and queued up for -stable, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help