public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] efivars write(2) races
@ 2013-01-25  0:25 Al Viro
  2013-01-25  3:50 ` Lingzhu Xiang
  2013-01-25 12:50 ` Matt Fleming
  0 siblings, 2 replies; 7+ messages in thread
From: Al Viro @ 2013-01-25  0:25 UTC (permalink / raw)
  To: Matt Fleming; +Cc: linux-efi, linux-kernel

	1) process A does write() on efivars file, reaches ->get_variable(),
gets newdatasize set, drops efivars->lock and loses CPU before an attempt to
grab ->i_mutex.  process B comes and does the same thing, replacing the
variable contents.  Then it grabs ->i_mutex, updates size, drops ->i_mutex
and buggers off.  At which point A gets CPU back and proceeds to set size
to whatever would be valid for its write.  Only the value is bogus now...

	2) what's to prevent EFI_NOT_FOUND being hit twice?  Bad things
will obviously happen in that case...


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

end of thread, other threads:[~2013-01-29  2:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-25  0:25 [RFC] efivars write(2) races Al Viro
2013-01-25  3:50 ` Lingzhu Xiang
2013-01-25 13:18   ` Matt Fleming
2013-01-28  2:38     ` Lingzhu Xiang
2013-01-28 12:38       ` Matt Fleming
2013-01-29  2:30         ` Lingzhu Xiang
2013-01-25 12:50 ` Matt Fleming

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