All of lore.kernel.org
 help / color / mirror / Atom feed
* alpha: potential race around hae_cache in RESTORE_ALL
@ 2010-09-25 18:13 Al Viro
  2010-09-25 18:42 ` Linus Torvalds
  0 siblings, 1 reply; 15+ messages in thread
From: Al Viro @ 2010-09-25 18:13 UTC (permalink / raw)
  To: rth; +Cc: linux-kernel, Linus Torvalds

	What happens if we get to RESTORE_ALL with interrupts enabled,
find that we want to restore HAE, get to
        stq     $21, HAE_CACHE($19);    \
and get hit by an interrupt right after that assignment?  Note that
*alpha_mv->hae_register is still not updated, but alpha_mv->hae_cache
already is, so if the interrupt calls set_hae() it would get seriously
confused if the value it wants is equal to the value we've put into
->hae_cache.

	Until ~2002 it used to have a couple of swpipl around these
assignments and __set_hae() is still doing those.  I agree that on
many exits we *will* have interrupts disabled when we get to RESTORE_ALL,
but not on all of them.  E.g. any interrupt taken in kernel mode will
happily go to restore_all without bothering with swpipl at all.

	AFAICS, it looks like a race; the change in question had been
introduced in "Update Alpha UP for thread_info and scheduler changes"
(Feb 10 2002, commit 374eeee8a8a50e12278dfa37021df7b6efe506c3 in historical
git tree).

	Comments?

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

end of thread, other threads:[~2010-09-27 21:21 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-25 18:13 alpha: potential race around hae_cache in RESTORE_ALL Al Viro
2010-09-25 18:42 ` Linus Torvalds
2010-09-25 19:18   ` Al Viro
2010-09-25 19:25     ` Al Viro
     [not found]       ` <AANLkTikEVr6wA6D_f2Z6OEFu6SCP_-89u0-k-K-wKgb=@mail.gmail.com>
2010-09-25 21:33         ` Linus Torvalds
2010-09-27  7:58       ` Ivan Kokshaysky
2010-09-27 12:12         ` Al Viro
2010-09-27 12:46           ` Al Viro
2010-09-27 16:26             ` Ivan Kokshaysky
2010-09-27 17:10               ` Linus Torvalds
2010-09-27 18:05                 ` Richard Henderson
2010-09-27 19:01                 ` Al Viro
2010-09-27 21:21                   ` Ivan Kokshaysky
2010-09-25 20:07   ` [PATCH] alpha: fix hae_cache race " Al Viro
2010-09-25 20:07   ` [PATCH] alpha: fix usp value in multithreaded coredumps Al Viro

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.