s390/time: avoid races when updating tb_update_count
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>
Mon, 18 Jul 2016 15:10:17 +0000 (17:10 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 29 Aug 2016 09:04:58 +0000 (11:04 +0200)
The increment might not be atomic and we're not holding the
timekeeper_lock. Therefore we might lose an update to count, resulting in
VDSO being trapped in a loop. As other archs also simply update the
values and count doesn't seem to have an impact on reloading of these
values in VDSO code, let's just remove the update of tb_update_count.

Suggested-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/kernel/time.c

index 5b1a199667e276cbacf82e494fee37c94ca7ae66..0bfcc492987ebe7f87fba5d0f69c5faa346a8514 100644 (file)
@@ -278,13 +278,8 @@ extern struct timezone sys_tz;
 
 void update_vsyscall_tz(void)
 {
-       /* Make userspace gettimeofday spin until we're done. */
-       ++vdso_data->tb_update_count;
-       smp_wmb();
        vdso_data->tz_minuteswest = sys_tz.tz_minuteswest;
        vdso_data->tz_dsttime = sys_tz.tz_dsttime;
-       smp_wmb();
-       ++vdso_data->tb_update_count;
 }
 
 /*