linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* cfi_intelext_is_locked() misses get_chip()/put_chip() calls
@ 2014-08-21 18:13 Ronald Wahl
  2014-08-21 18:43 ` Ronald Wahl
  0 siblings, 1 reply; 2+ messages in thread
From: Ronald Wahl @ 2014-08-21 18:13 UTC (permalink / raw)
  To: linux-mtd

Hi,

cfi_intelext_is_locked() in cfi_cmdset_0001.c calls 
do_getlockstatus_oneblock() withou calling get_chip() before and 
put_chip() afterwards. So chip state is changed without protection.
This may lead to hanging processes.

Is this analysis correct?

If someone can fix this quickly - fine - but I can also provide a patch.

greets,
ron

-- 
Ronald Wahl - ronald.wahl@raritan.com - Phone +49 375271349-0 Fax -99
Raritan Deutschland GmbH, Kornmarkt 7, 08056 Zwickau, Germany
USt-IdNr. DE813094160, Steuer-Nr. 227/117/01749
Amtsgericht Chemnitz HRB 23605
Geschäftsführung: Stuart Hopper, Ralf Ploenes

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

* Re: cfi_intelext_is_locked() misses get_chip()/put_chip() calls
  2014-08-21 18:13 cfi_intelext_is_locked() misses get_chip()/put_chip() calls Ronald Wahl
@ 2014-08-21 18:43 ` Ronald Wahl
  0 siblings, 0 replies; 2+ messages in thread
From: Ronald Wahl @ 2014-08-21 18:43 UTC (permalink / raw)
  To: linux-mtd

Hi,

a possible fix is renaming the current do_getlockstatus_oneblock() 
function to do_getlockstatus_oneblock_unlocked() and write a new
do_getlockstatus_oneblock() which wraps the *_unlocked function into 
get_chip/put_chip. Additional we need to call the *_unlock function from 
do_xxlock_oneblock because it already helds the chip lock.

- ron

On 21.08.2014 20:13, Ronald Wahl wrote:
> Hi,
>
> cfi_intelext_is_locked() in cfi_cmdset_0001.c calls
> do_getlockstatus_oneblock() withou calling get_chip() before and
> put_chip() afterwards. So chip state is changed without protection.
> This may lead to hanging processes.
>
> Is this analysis correct?
>
> If someone can fix this quickly - fine - but I can also provide a patch.
>
> greets,
> ron
>

-- 
Ronald Wahl - ronald.wahl@raritan.com - Phone +49 375271349-0 Fax -99
Raritan Deutschland GmbH, Kornmarkt 7, 08056 Zwickau, Germany
USt-IdNr. DE813094160, Steuer-Nr. 227/117/01749
Amtsgericht Chemnitz HRB 23605
Geschäftsführung: Stuart Hopper, Ralf Ploenes

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

end of thread, other threads:[~2014-08-21 18:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-21 18:13 cfi_intelext_is_locked() misses get_chip()/put_chip() calls Ronald Wahl
2014-08-21 18:43 ` Ronald Wahl

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