linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* A potential race in drivers/scsi/megaraid.ko
@ 2016-08-12 10:44 Pavel Andrianov
  0 siblings, 0 replies; only message in thread
From: Pavel Andrianov @ 2016-08-12 10:44 UTC (permalink / raw)
  To: Kashyap Desai
  Cc: Sumit Saxena, Uday Lingala, James E.J. Bottomley,
	Martin K. Petersen, megaraidlinux.pdl, linux-scsi, linux-kernel,
	Vaishali Thakkar, ldv-project

Hi!

There is a potential data race in drivers/scsi/megaraid.ko
Regards such case:

Thread 1					Thread 2
...						...
-> megaraid_probe_one				
    -> request_irq    - now an interrupt may arise
    -> mega_query_adapter
      -> issue_scb_block
			interrupt comes 	
						-> megaraid_isr_iomapped
						  -> mega_runpendq
						    -> __mega_runpendq
						      -> issue_skb

In this case the structure 'mbox' is modified from two threads 
simultaneously. Or, more correct, the first modification is interrupted 
by the second one. Likely, the first thread should acquire the same 
spinlock adapter->lock as the second one.

-- 
Pavel Andrianov
Linux Verification Center, ISPRAS
web: http://linuxtesting.org
e-mail: andrianov@ispras.ru

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-08-12 10:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-12 10:44 A potential race in drivers/scsi/megaraid.ko Pavel Andrianov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).