Andreas Kling
11456ebc00
Kernel: Close race window in timestamp update mechanism
...
As pointed out by 8infy, this mechanism is racy:
WRITER:
1. ++update1;
2. write_data();
3. ++update2;
READER:
1. do { auto saved = update1;
2. read_data();
3. } while (saved != update2);
The following sequence can lead to a bogus/partial read:
R1 R2 R3
W1 W2 W3
We close this race by incrementing the second update counter first:
WRITER:
1. ++update2;
2. write_data();
3. ++update1;
2021-08-10 21:51:05 +02:00
..
2021-08-07 11:48:00 +02:00
2021-08-10 19:21:16 +02:00
2021-08-10 02:49:37 +02:00
2021-08-09 22:52:09 +02:00
2021-08-08 00:03:45 +02:00
2021-08-08 00:28:10 +02:00
2021-08-08 14:24:54 +02:00
2021-08-10 02:49:37 +02:00
2021-08-08 00:03:45 +02:00
2021-08-10 02:49:37 +02:00
2021-08-09 11:46:31 +02:00
2021-08-10 20:59:53 +02:00
2021-08-08 10:55:36 +02:00
2021-08-08 00:08:24 +02:00
2021-08-10 19:21:16 +02:00
2021-08-10 21:51:05 +02:00
2021-08-09 11:46:30 +02:00
2021-08-07 11:48:00 +02:00
2021-08-04 11:01:16 +02:00
2021-07-27 13:15:16 +02:00
2021-08-09 21:05:25 +02:00
2021-08-09 21:05:25 +02:00
2021-08-09 21:05:25 +02:00
2021-08-08 00:03:45 +02:00
2021-08-10 02:49:37 +02:00
2021-08-07 15:21:58 +02:00
2021-08-06 22:25:00 +02:00
2021-08-07 11:48:00 +02:00
2021-08-08 14:24:54 +02:00
2021-08-07 11:48:00 +02:00
2021-08-07 11:48:00 +02:00
2021-08-09 21:05:25 +02:00
2021-08-06 22:25:00 +02:00
2021-08-06 22:25:00 +02:00
2021-08-07 11:48:00 +02:00
2021-08-04 20:14:54 +02:00
2021-08-04 20:14:54 +02:00
2021-07-27 13:15:16 +02:00
2021-07-29 10:38:31 +02:00
2021-07-27 13:15:16 +02:00
2021-08-04 20:14:54 +02:00
2021-08-06 22:25:00 +02:00
2021-08-06 14:05:58 +02:00
2021-08-08 14:24:55 +02:00
2021-08-10 19:21:16 +02:00
2021-07-28 18:59:53 +02:00
2021-08-08 00:03:45 +02:00
2021-08-07 13:30:59 +02:00
2021-08-06 14:05:58 +02:00
2021-08-08 00:03:45 +02:00
2021-08-07 11:48:00 +02:00
2021-08-04 19:53:04 +02:00
2021-08-04 19:53:04 +02:00
2021-08-01 08:10:16 +02:00
2021-08-10 02:49:37 +02:00
2021-08-08 14:24:55 +02:00
2021-07-27 13:15:16 +02:00
2021-08-06 14:05:58 +02:00
2021-08-06 14:05:58 +02:00
2021-08-10 02:49:37 +02:00
2021-08-10 02:49:37 +02:00
2021-08-06 00:37:47 +02:00
2021-08-08 00:03:45 +02:00
2021-08-03 18:44:01 +02:00
2021-08-10 13:01:39 +02:00
2021-08-06 14:05:58 +02:00
2021-08-06 14:05:58 +02:00
2021-08-07 11:48:00 +02:00
2021-08-07 11:48:00 +02:00