Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'timers_urgent_for_v6.13_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull timer fixes from Borislav Petkov:

- Fix a case where posix timers with a thread-group-wide target would
miss signals if some of the group's threads are exiting

- Fix a hang caused by ndelay() calling the wrong delay function
__udelay()

- Fix a wrong offset calculation in adjtimex(2) when using ADJ_MICRO
(microsecond resolution) and a negative offset

* tag 'timers_urgent_for_v6.13_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
posix-timers: Target group sigqueue to current task only if not exiting
delay: Fix ndelay() spuriously treated as udelay()
ntp: Remove invalid cast in time offset math

+7 -6
+2 -2
include/asm-generic/delay.h
··· 75 75 { 76 76 if (__builtin_constant_p(nsec)) { 77 77 if (nsec >= DELAY_CONST_MAX) 78 - __bad_udelay(); 78 + __bad_ndelay(); 79 79 else 80 80 __const_udelay(nsec * NDELAY_CONST_MULT); 81 81 } else { 82 - __udelay(nsec); 82 + __ndelay(nsec); 83 83 } 84 84 } 85 85 #define ndelay(x) ndelay(x)
+4 -3
kernel/signal.c
··· 1959 1959 * 1960 1960 * Where type is not PIDTYPE_PID, signals must be delivered to the 1961 1961 * process. In this case, prefer to deliver to current if it is in 1962 - * the same thread group as the target process, which avoids 1963 - * unnecessarily waking up a potentially idle task. 1962 + * the same thread group as the target process and its sighand is 1963 + * stable, which avoids unnecessarily waking up a potentially idle task. 1964 1964 */ 1965 1965 static inline struct task_struct *posixtimer_get_target(struct k_itimer *tmr) 1966 1966 { 1967 1967 struct task_struct *t = pid_task(tmr->it_pid, tmr->it_pid_type); 1968 1968 1969 - if (t && tmr->it_pid_type != PIDTYPE_PID && same_thread_group(t, current)) 1969 + if (t && tmr->it_pid_type != PIDTYPE_PID && 1970 + same_thread_group(t, current) && !current->exit_state) 1970 1971 t = current; 1971 1972 return t; 1972 1973 }
+1 -1
kernel/time/ntp.c
··· 798 798 799 799 txc->offset = shift_right(ntpdata->time_offset * NTP_INTERVAL_FREQ, NTP_SCALE_SHIFT); 800 800 if (!(ntpdata->time_status & STA_NANO)) 801 - txc->offset = (u32)txc->offset / NSEC_PER_USEC; 801 + txc->offset = div_s64(txc->offset, NSEC_PER_USEC); 802 802 } 803 803 804 804 result = ntpdata->time_state;