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: <20171215.125749.1752831437819486183.davem@davemloft.net>
Date:   Fri, 15 Dec 2017 12:57:49 -0500 (EST)
From:   David Miller <davem@...emloft.net>
To:     hayashi.kunihiko@...ionext.com
Cc:     netdev@...r.kernel.org, andrew@...n.ch, f.fainelli@...il.com,
        robh+dt@...nel.org, mark.rutland@....com,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        devicetree@...r.kernel.org, yamada.masahiro@...ionext.com,
        masami.hiramatsu@...aro.org, jaswinder.singh@...aro.org
Subject: Re: [PATCH net-next v6 2/2] net: ethernet: socionext: add AVE
 ethernet driver

From: Kunihiko Hayashi <hayashi.kunihiko@...ionext.com>
Date: Thu, 14 Dec 2017 19:05:10 +0900

> +static void ave_desc_write(struct net_device *ndev, enum desc_id id,
> +			   int entry, int offset, u32 val)
> +{
> +	struct ave_private *priv = netdev_priv(ndev);
> +	u32 addr = (id == AVE_DESCID_TX) ? priv->tx.daddr : priv->rx.daddr;

Please always order local variables from longest to shortest line.

Audit your entire submission for this issue, thank you.

> +	ret = register_netdev(ndev);
> +	if (ret) {
> +		dev_err(dev, "failed to register netdevice\n");
> +		goto out_del_napi;
> +	}
> +
> +	platform_set_drvdata(pdev, ndev);

You must make all software state settings before reigster_netdev() is
invoked.

At the exact moment you call register_netdev(), your device can be
brought up, interrupts processed, PHY state changes made, etc.

So you must put this platform_set_drvdata() before the
register_netdev() call.

Generally speaking, register_netdev() must always be the last state
modification done by your probe routine.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ