mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Race Condition over sys_tz
@ 2006-09-30  0:53 Dong Feng
  0 siblings, 0 replies; only message in thread
From: Dong Feng @ 2006-09-30  0:53 UTC (permalink / raw)
  To: linux-kernel

The operations on sys_tz, so far known to me in sys_settimeofday and
sys_gettimeofday, is neither atomic nor protected by any lock. I
suspect it probably causes unpredictable behavior when multiple
processes try to set the system time zone simultaneously.

Following is the code fragment extracted from do_sys_settimeofday().
The function is invoked by sys_settimeofday() without locking. At
least two non-atomic operations:

1. struct copy between *tz and sys_tz.
2. The test-and-operate over firsttime.

if (tz) {
        /* SMP safe, global irq locking makes it work. */
        sys_tz = *tz;
        if (firsttime) {
                firsttime = 0;
                if (!tv)
                        warp_clock();
        }
}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-09-30  0:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-30  0:53 Race Condition over sys_tz Dong Feng

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

all inboxes | Powered by JetHome®