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]
Date:	Mon, 03 Aug 2015 08:01:24 -0700
From:	Guenter Roeck <linux@...ck-us.net>
To:	Vivien Didelot <vivien.didelot@...oirfairelinux.com>,
	netdev@...r.kernel.org
CC:	linux-kernel@...r.kernel.org, kernel@...oirfairelinux.com,
	"David S. Miller" <davem@...emloft.net>,
	Andrew Lunn <andrew@...n.ch>,
	Florian Fainelli <f.fainelli@...il.com>
Subject: Re: [PATCH] net: dsa: mv88e6xxx: call _mv88e6xxx_stats_wait with
 SMI lock held

On 08/03/2015 06:17 AM, Vivien Didelot wrote:
> At switch setup, _mv88e6xxx_stats_wait was called without holding the
> SMI mutex. Fix this by requesting the lock for this call.
>
> Also, return the _mv88e6xxx_stats_wait code, since it may fail.
>
> Signed-off-by: Vivien Didelot <vivien.didelot@...oirfairelinux.com>

Not strictly needed because the mutex is initialized in the same call
sequence, but it doesn't hurt and is technically ok (and may prevent others
from submitting the same patch again ;-)

Reviewed-by: Guenter Roeck <linux@...ck-us.net>

> ---
>   drivers/net/dsa/mv88e6xxx.c | 7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
> index 5e1dce1..8966cf2 100644
> --- a/drivers/net/dsa/mv88e6xxx.c
> +++ b/drivers/net/dsa/mv88e6xxx.c
> @@ -1938,6 +1938,7 @@ int mv88e6xxx_setup_common(struct dsa_switch *ds)
>   int mv88e6xxx_setup_global(struct dsa_switch *ds)
>   {
>   	struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
> +	int ret;
>   	int i;
>
>   	/* Set the default address aging time to 5 minutes, and
> @@ -2036,9 +2037,11 @@ int mv88e6xxx_setup_global(struct dsa_switch *ds)
>   	REG_WRITE(REG_GLOBAL, GLOBAL_STATS_OP, GLOBAL_STATS_OP_FLUSH_ALL);
>
>   	/* Wait for the flush to complete. */
> -	_mv88e6xxx_stats_wait(ds);
> +	mutex_lock(&ps->smi_mutex);
> +	ret = _mv88e6xxx_stats_wait(ds);
> +	mutex_unlock(&ps->smi_mutex);
>
> -	return 0;
> +	return ret;
>   }
>
>   int mv88e6xxx_switch_reset(struct dsa_switch *ds, bool ppu_active)
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ