lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 12 Feb 2014 22:33:32 +0000
From:	Ben Hutchings <ben@...adent.org.uk>
To:	Florian Westphal <fw@...len.de>
Cc:	netdev@...r.kernel.org
Subject: Re: [PATCH -next] gre: return more precise errno value when adding
 tunnel fails

On Wed, 2014-02-12 at 10:28 +0100, Florian Westphal wrote:
> Currently this always returns ENOBUFS, because the return value of
> __ip_tunnel_create is discarded.
> 
> A more common failure is a duplicate name (EEXIST).  Propagate the real
> error code so userspace can display a more meaningful error message.
> 
> Signed-off-by: Florian Westphal <fw@...len.de>
> ---
>  net/ipv4/ip_tunnel.c | 15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
> index 90ff957..ef43356 100644
> --- a/net/ipv4/ip_tunnel.c
> +++ b/net/ipv4/ip_tunnel.c
> @@ -393,7 +393,7 @@ static struct ip_tunnel *ip_tunnel_create(struct net *net,
>  	fbt = netdev_priv(itn->fb_tunnel_dev);
>  	dev = __ip_tunnel_create(net, itn->fb_tunnel_dev->rtnl_link_ops, parms);
>  	if (IS_ERR(dev))
> -		return NULL;
> +		return (void *) dev;
[...]

This should be written as ERR_CAST(dev).

Ben.

-- 
Ben Hutchings
If more than one person is responsible for a bug, no one is at fault.

Download attachment "signature.asc" of type "application/pgp-signature" (812 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ