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]
Message-ID: <20210206111918.36a528e5@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date:   Sat, 6 Feb 2021 11:19:18 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     Zheng Yongjun <zhengyongjun3@...wei.com>
Cc:     <davem@...emloft.net>, <kuznet@....inr.ac.ru>,
        <yoshfuji@...ux-ipv6.org>, <netdev@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next] net: ipv4: Return the correct errno code

On Thu, 4 Feb 2021 15:26:57 +0800 Zheng Yongjun wrote:
> When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF.
> 
> Signed-off-by: Zheng Yongjun <zhengyongjun3@...wei.com>
> ---
>  net/ipv4/devinet.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
> index 123a6d39438f..fa586e915621 100644
> --- a/net/ipv4/devinet.c
> +++ b/net/ipv4/devinet.c
> @@ -2582,7 +2582,7 @@ static int __devinet_sysctl_register(struct net *net, char *dev_name,
>  free:
>  	kfree(t);
>  out:
> -	return -ENOBUFS;
> +	return -ENOMEM;

But this path also gets hit when registration fails.
Are you sure registration also only fails when there is no memory?

>  }
>  
>  static void __devinet_sysctl_unregister(struct net *net,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ