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:	Tue, 26 Apr 2011 21:30:44 +0100
From:	Russell King - ARM Linux <linux@....linux.org.uk>
To:	Viresh Kumar <viresh.kumar@...com>
Cc:	linux-kernel@...r.kernel.org, vinod.koul@...el.com,
	dan.j.williams@...el.com, linux-arm-kernel@...ts.infradead.org,
	armando.visconti@...com, shiraz.hashim@...com, amit.goel@...com,
	viresh.linux@...il.com, jamie@...ieiles.com
Subject: Re: [PATCH 1/6] dmaengine/dw_dmac: Replace spin_lock_bh with
	irqsave variants

On Mon, Apr 18, 2011 at 04:19:59PM +0530, Viresh Kumar wrote:
>  static struct dw_desc *dwc_desc_get(struct dw_dma_chan *dwc)
>  {
> +	struct dw_dma *dw = to_dw_dma(dwc->chan.device);
>  	struct dw_desc *desc, *_desc;
>  	struct dw_desc *ret = NULL;
>  	unsigned int i = 0;
>  
> -	spin_lock_bh(&dwc->lock);
> +	spin_lock_irqsave(&dwc->lock, dw->flags);

It's a very bad idea to store the IRQ flags like this - it means that
another thread operating on this corrupts this threads interrupt flag
settings.

It should be a local variable.
--
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