linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] efivars write(2) races
@ 2013-01-25  0:25 Al Viro
       [not found] ` <20130125002552.GC4503-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
  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-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

	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:30 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
     [not found] ` <20130125002552.GC4503-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
2013-01-25  3:50   ` Lingzhu Xiang
     [not found]     ` <51020120.5000500-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-01-25 13:18       ` Matt Fleming
     [not found]         ` <1359119883.2496.156.camel-ZqTwcBeJ+wsBof6jY8KHXm7IUlhRatedral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2013-01-28  2:38           ` Lingzhu Xiang
     [not found]             ` <5105E4A3.9040102-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-01-28 12:38               ` Matt Fleming
     [not found]                 ` <1359376730.8282.20.camel-ZqTwcBeJ+wsBof6jY8KHXm7IUlhRatedral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
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;
as well as URLs for NNTP newsgroup(s).