mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-04 04:06:26 +00:00
posix-timers: Document sys_clock_settime() permissions in place
The documentation of sys_clock_settime() permissions is at a random place and mostly word salad. Remove it and add a concise comment into sys_clock_settime(). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Frederic Weisbecker <frederic@kernel.org> Link: https://lore.kernel.org/r/20230425183313.514700292@linutronix.de
This commit is contained in:
parent
65cade468d
commit
3561fcb402
@ -74,13 +74,6 @@ static const struct k_clock clock_realtime, clock_monotonic;
|
|||||||
* following: 1.) The k_itimer struct (sched.h) is used for
|
* following: 1.) The k_itimer struct (sched.h) is used for
|
||||||
* the timer. 2.) The list, it_lock, it_clock, it_id and
|
* the timer. 2.) The list, it_lock, it_clock, it_id and
|
||||||
* it_pid fields are not modified by timer code.
|
* it_pid fields are not modified by timer code.
|
||||||
*
|
|
||||||
* Permissions: It is assumed that the clock_settime() function defined
|
|
||||||
* for each clock will take care of permission checks. Some
|
|
||||||
* clocks may be set able by any user (i.e. local process
|
|
||||||
* clocks) others not. Currently the only set able clock we
|
|
||||||
* have is CLOCK_REALTIME and its high res counter part, both of
|
|
||||||
* which we beg off on and pass to do_sys_settimeofday().
|
|
||||||
*/
|
*/
|
||||||
static struct k_itimer *__lock_timer(timer_t timer_id, unsigned long *flags);
|
static struct k_itimer *__lock_timer(timer_t timer_id, unsigned long *flags);
|
||||||
|
|
||||||
@ -1159,6 +1152,10 @@ SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock,
|
|||||||
if (get_timespec64(&new_tp, tp))
|
if (get_timespec64(&new_tp, tp))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Permission checks have to be done inside the clock specific
|
||||||
|
* setter callback.
|
||||||
|
*/
|
||||||
return kc->clock_set(which_clock, &new_tp);
|
return kc->clock_set(which_clock, &new_tp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user