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: <a95dbe8d-507c-616d-3509-8e38c9500df8@mellanox.com>
Date:   Mon, 21 Jan 2019 11:28:34 +0000
From:   Eran Ben Elisha <eranbe@...lanox.com>
To:     Wei Yongjun <weiyongjun1@...wei.com>,
        Jiri Pirko <jiri@...lanox.com>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>
Subject: Re: [PATCH net-next] devlink: Fix error return code in
 devlink_health_buffer_prepare_skb()



On 1/21/2019 10:21 AM, Wei Yongjun wrote:
> Fix to return a negative error code -EMSGSIZE from the error handling
> case, otherwise 0 or uninitialized value may be returned.
> 
> Fixes: cb5ccfbe73b3 ("devlink: Add health buffer support")
> Signed-off-by: Wei Yongjun <weiyongjun1@...wei.com>

Thanks for the fix!
However, I am working to replace this entire code section, will squash 
your patch to the new code.

> ---
>   net/core/devlink.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/net/core/devlink.c b/net/core/devlink.c
> index 60248a5..0d4c774 100644
> --- a/net/core/devlink.c
> +++ b/net/core/devlink.c
> @@ -4008,8 +4008,10 @@ void devlink_health_buffer_nest_cancel(struct devlink_health_buffer *buffer)
>   		case DEVLINK_ATTR_HEALTH_BUFFER_OBJECT_VALUE:
>   		case DEVLINK_ATTR_HEALTH_BUFFER_OBJECT_VALUE_ARRAY:
>   			buffer_nlattr[i] = nla_nest_start(skb, desc->attrtype);
> -			if (!buffer_nlattr[i])
> +			if (!buffer_nlattr[i]) {
> +				err = -EMSGSIZE;
>   				goto nla_put_failure;
> +			}
>   			i++;
>   			break;
>   		case DEVLINK_ATTR_HEALTH_BUFFER_OBJECT_VALUE_DATA:
> 
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ