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:	Wed, 23 Nov 2011 16:30:34 +0530
From:	Vinod Koul <vinod.koul@...el.com>
To:	H Hartley Sweeten <hartleys@...ionengravers.com>
Cc:	Mika Westerberg <mika.westerberg@....fi>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"dan.j.williams@...el.com" <dan.j.williams@...el.com>,
	"rmallon@...il.com" <rmallon@...il.com>,
	Rafal Prylowski <prylowski@...asoft.pl>
Subject: RE: [PATCH 2/2] dma/ep93xx_dma: prevent ep93xx_dma_tasklet() to
 access empty list

On Tue, 2011-11-22 at 14:26 -0600, H Hartley Sweeten wrote:
> On Tuesday, November 22, 2011 12:46 PM, Mika Westerberg wrote:
> > From: Rafal Prylowski <prylowski@...asoft.pl>
> >
> > If dma_terminate_all() is called before the ep93xx_dma_tasklet()
> gets to run,
> > it tries to access an empty ->active list causing following OOPS:
> 
> [snip]
> 
> > As we expect that the ->active list is never empty when the
> ep93xx_dma_tasklet()
> > is called, we fix this by adding a new flag per channel
> EP93XX_DMA_IS_RUNNING
> > which determines whether the channel is running or not.
> > 
> > We also add BUG_ON() to ep93xx_dma_get_active() to make sure that
> similar
> > problems will be caught early. 
My $0.02

will you still hit the problem if you do a proper check in tasklet for 
a) if list is empty
b) if _get_active_desc() returns valid desc
and the _get_active_desc() returns NULL on not finding active desc

The point is by adding a flag you are avoiding the condition hence it is
working for you whereas on other approach you exit gracefully without
crashing in all the cases (including potentially uncovered ones)


-- 
~Vinod

--
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