Bug 207913
Summary: | Potential data races in `settimeofday` | ||
---|---|---|---|
Product: | Timers | Reporter: | Yanze (dr.funemy) |
Component: | Other | Assignee: | john stultz (john.stultz) |
Status: | NEW --- | ||
Severity: | normal | ||
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 5.7-rc7 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: |
race_report_firsttime
race_report_persistent_clock_is_local race_report_vdata |
Description
Yanze
2020-05-27 02:24:29 UTC
Created attachment 289323 [details]
race_report_firsttime
Created attachment 289325 [details]
race_report_persistent_clock_is_local
Created attachment 289327 [details]
race_report_vdata
*** Bug 207911 has been marked as a duplicate of this bug. *** Yea. The timezone setting logic is pretty old and grungy. Mostly its assuming we're only calling it early in boot so its not likely to race with anything. A possible solution might be in do_sys_settimeofday64() moving firsttime out to a static global, and adding a separate spinlock (say tz_lock) which is taken on line 185 before we set sys_tz and released after line 192. I think doing that would resolve all the races in this issue. Do you want to create and submit such a patch? |