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] [thread-next>] [day] [month] [year] [list]
Message-ID: <dcd9b51a-1916-a947-7384-aa24f3d25cf3@gmail.com>
Date:   Fri, 8 Feb 2019 09:30:09 -0800
From:   David Ahern <dsahern@...il.com>
To:     Parav Pandit <parav@...lanox.com>, netdev@...r.kernel.org,
        davem@...emloft.net
Subject: Re: [PATCH net-next] devlink: Add WARN_ON to catch errors of not
 cleaning devlink objects

On 2/8/19 8:22 AM, Parav Pandit wrote:
> Add WARN_ON to make sure that all sub objects of a devlink device are
> cleanedup before freeing the devlink device.
> This helps to catch any driver bugs.
> 
> Signed-off-by: Parav Pandit <parav@...lanox.com>
> Acked-by: Jiri Pirko <jiri@...lanox.com>
> ---
>  net/core/devlink.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/net/core/devlink.c b/net/core/devlink.c
> index cd0d393..5e2ef5a 100644
> --- a/net/core/devlink.c
> +++ b/net/core/devlink.c
> @@ -4229,6 +4229,13 @@ void devlink_unregister(struct devlink *devlink)
>   */
>  void devlink_free(struct devlink *devlink)
>  {
> +	WARN_ON(!list_empty(&devlink->port_list));
> +	WARN_ON(!list_empty(&devlink->sb_list));
> +	WARN_ON(!list_empty(&devlink->dpipe_table_list));
> +	WARN_ON(!list_empty(&devlink->resource_list));
> +	WARN_ON(!list_empty(&devlink->param_list));
> +	WARN_ON(!list_empty(&devlink->region_list));
> +
>  	kfree(devlink);
>  }
>  EXPORT_SYMBOL_GPL(devlink_free);
> 

reporter_list was just added which brings up the maintenance question:
If you are going to do this you might want a comment in
include/net/devlink.h to remind folks to update this function as relevant.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ