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: <20191121202140.GA7573@duo.ucw.cz>
Date:   Thu, 21 Nov 2019 21:21:40 +0100
From:   Pavel Machek <pavel@...x.de>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     linux-kernel@...r.kernel.org, stable@...r.kernel.org,
        Jia-Ju Bai <baijiaju1990@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Sasha Levin <sashal@...nel.org>
Subject: Re: [PATCH 4.19 241/422] net: socionext: Fix two
 sleep-in-atomic-context bugs in ave_rxfifo_reset()

Hi!

> [ Upstream commit 0020f5c807ef67954d9210eea0ba17a6134cdf7d ]
> 
> The driver may sleep with holding a spinlock.
> The function call paths (from bottom to top) in Linux-4.17 are:
> 
> [FUNC] usleep_range
> drivers/net/ethernet/socionext/sni_ave.c, 892:
> 	usleep_range in ave_rxfifo_reset
> drivers/net/ethernet/socionext/sni_ave.c, 932:
> 	ave_rxfifo_reset in ave_irq_handler
> 
> [FUNC] usleep_range
> drivers/net/ethernet/socionext/sni_ave.c, 888:
> 	usleep_range in ave_rxfifo_reset
> drivers/net/ethernet/socionext/sni_ave.c, 932:
> 	ave_rxfifo_reset in ave_irq_handler
> 
> To fix these bugs, usleep_range() is replaced with udelay().

I don't believe this is serious enough for -stable, but more
importantly:

> +++ b/drivers/net/ethernet/socionext/sni_ave.c
> @@ -906,11 +906,11 @@ static void ave_rxfifo_reset(struct net_device *ndev)
>  
>  	/* assert reset */
>  	writel(AVE_GRR_RXFFR, priv->base + AVE_GRR);
> -	usleep_range(40, 50);
> +	udelay(50);
>  
>  	/* negate reset */
>  	writel(0, priv->base + AVE_GRR);
> -	usleep_range(10, 20);
> +	udelay(20);
>

udelay(40) / udelay(10) should be enough here.

Best regards,
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Download attachment "signature.asc" of type "application/pgp-signature" (196 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ