All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] efivars write(2) races
@ 2013-01-25  0:25 ` Al Viro
  0 siblings, 0 replies; 13+ 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] 13+ messages in thread

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

Thread overview: 13+ 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  0:25 ` Al Viro
     [not found] ` <20130125002552.GC4503-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
2013-01-25  3:50   ` Lingzhu Xiang
2013-01-25  3:50     ` Lingzhu Xiang
     [not found]     ` <51020120.5000500-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-01-25 13:18       ` Matt Fleming
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
2013-01-28  2:38             ` Lingzhu Xiang
     [not found]             ` <5105E4A3.9040102-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-01-28 12:38               ` Matt Fleming
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-29  2:30                     ` Lingzhu Xiang
2013-01-25 12:50 ` Matt Fleming

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.