public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* a suspected data race in /driver/mtd/ubi/build.c
@ 2009-05-19 11:34 홍신 shin hong
  2009-05-23  8:58 ` Artem Bityutskiy
  0 siblings, 1 reply; 2+ messages in thread
From: 홍신 shin hong @ 2009-05-19 11:34 UTC (permalink / raw)
  To: linux-mtd

Hi. I am reporting a susptected data race bug at
ubi_attach_mtd_dev() in /driver/mtd/ubi/build.c .

This function creates a kernel thread by calling
kthread_create(ubi_thread, ubi .. ). and then
it assigns ubi->thread_enabled = 1.

However, ubi_thread() also reads ubi->thread_enabled.
This may cause data race since the execution results
would be differ depending on the scheduling.

I think, ubi_attach_mtd_dev() should be modified to protect
the writing aceess to ubi->thread_enabled
by spin_lock(&ubi->wl_lock).

But I do not have much background on the code.
So please check this code and let me know your opinions.
Thanks.

Sincerely
Shin Hong

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-05-23  8:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-19 11:34 a suspected data race in /driver/mtd/ubi/build.c 홍신 shin hong
2009-05-23  8:58 ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox