kern_clock_gettime(CLOCK_TAI) can fail with EINVAL.
Reported by: syzbot+e17e46b1f0b65027b005@syzkaller.appspotmail.com
Fixes: 7b7ba7857ce8 ("Implement CLOCK_TAI")
Differential D51744
time: Handle kern_clock_gettime() failures in kern_clock_nanosleep() markj on Tue, Aug 5, 4:16 PM. Authored by Tags None Referenced Files
Subscribers
Details kern_clock_gettime(CLOCK_TAI) can fail with EINVAL. Reported by: syzbot+e17e46b1f0b65027b005@syzkaller.appspotmail.com
Diff Detail
Event TimelineComment Actions That looks good to me. This routine can return errors for other conditions. Thanks for catching this dropped ball.
Comment Actions Sorry, I figured it out. I think that the initial version was right, and the reset needs to be restored. It is not assumed to leak from the wrappers of sleepers that sleep using wall time values. See the sleeping_on_old_rtc() code and its use in tc_setclock(). Not resetting td_rtcgen would cause spurious wakeups for later sleeps on non-wall clock timeouts if the wall clock changes. From this principle, I believe timerfd_read() is buggy. Comment Actions This change fixes the panic, but there are some other places where kern_clock_gettime()'s return value is not checked. I will fix those up. |