Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1336020 > unrolled thread

[PATCH] rtnl: RTM_GETNETCONF: fix wrong return value

Started byAnton Protopopov <a.s.protopopov@gmail.com>
First post2016-02-17 03:50 +0100
Last post2016-02-19 21:40 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] rtnl: RTM_GETNETCONF: fix wrong return value Anton Protopopov <a.s.protopopov@gmail.com> - 2016-02-17 03:50 +0100
    Re: [PATCH] rtnl: RTM_GETNETCONF: fix wrong return value Cong Wang <xiyou.wangcong@gmail.com> - 2016-02-18 00:00 +0100
    Re: [PATCH] rtnl: RTM_GETNETCONF: fix wrong return value David Miller <davem@davemloft.net> - 2016-02-19 21:40 +0100

#1336020 — [PATCH] rtnl: RTM_GETNETCONF: fix wrong return value

FromAnton Protopopov <a.s.protopopov@gmail.com>
Date2016-02-17 03:50 +0100
Subject[PATCH] rtnl: RTM_GETNETCONF: fix wrong return value
Message-ID<r30lI-8gb-5@gated-at.bofh.it>
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>
---
 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

[toc] | [next] | [standalone]


#1336854

FromCong Wang <xiyou.wangcong@gmail.com>
Date2016-02-18 00:00 +0100
Message-ID<r3jeG-4Do-3@gated-at.bofh.it>
In reply to#1336020
On Tue, Feb 16, 2016 at 6:43 PM, Anton Protopopov
<a.s.protopopov@gmail.com> 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 <a.s.protopopov@gmail.com>

LGTM,

Acked-by: Cong Wang <xiyou.wangcong@gmail.com>

[toc] | [prev] | [next] | [standalone]


#1338443

FromDavid Miller <davem@davemloft.net>
Date2016-02-19 21:40 +0100
Message-ID<r400h-2qQ-5@gated-at.bofh.it>
In reply to#1336020
From: Anton Protopopov <a.s.protopopov@gmail.com>
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 <a.s.protopopov@gmail.com>

Applied and queued up for -stable, thanks.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web