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: <20221101092542.26c66235@kernel.org>
Date:   Tue, 1 Nov 2022 09:25:42 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Jiri Pirko <jiri@...nulli.us>
Cc:     netdev@...r.kernel.org, davem@...emloft.net, pabeni@...hat.com,
        edumazet@...gle.com, tariqt@...dia.com, moshe@...dia.com,
        saeedm@...dia.com, linux-rdma@...r.kernel.org
Subject: Re: [patch net-next v3 05/13] net: devlink: track netdev with
 devlink_port assigned

On Mon, 31 Oct 2022 13:42:40 +0100 Jiri Pirko wrote:
> +/*
> + * Driver should use this to assign devlink port instance to a netdevice
> + * before it registers the netdevice. Therefore devlink_port is static
> + * during the netdev lifetime after it is registered.
> + */
> +#define SET_NETDEV_DEVLINK_PORT(dev, _devlink_port)		\
> +({								\
> +	WARN_ON(dev->reg_state != NETREG_UNINITIALIZED);	\
> +	((dev)->devlink_port = (_devlink_port));		\
> +})

The argument wrapping is inconsistent here - dev is in brackets
on the second line but not on the first. _devlink_port is prefixed 
with underscore and dev is not. Let's make this properly secure
and define a local var for dev.

> @@ -10107,6 +10107,7 @@ int register_netdevice(struct net_device *dev)
>  	return ret;
>  
>  err_uninit:
> +	call_netdevice_notifiers(NETDEV_PRE_UNINIT, dev);

I think we should make this symmetric with POST_INIT.
IOW PRE_UNINIT should only be called if POST_INIT was called.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ