Skip to content

Commit 3561fcb

Browse files
committed
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
1 parent 65cade4 commit 3561fcb

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

kernel/time/posix-timers.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,6 @@ static const struct k_clock clock_realtime, clock_monotonic;
7474
* following: 1.) The k_itimer struct (sched.h) is used for
7575
* the timer. 2.) The list, it_lock, it_clock, it_id and
7676
* it_pid fields are not modified by timer code.
77-
*
78-
* Permissions: It is assumed that the clock_settime() function defined
79-
* for each clock will take care of permission checks. Some
80-
* clocks may be set able by any user (i.e. local process
81-
* clocks) others not. Currently the only set able clock we
82-
* have is CLOCK_REALTIME and its high res counter part, both of
83-
* which we beg off on and pass to do_sys_settimeofday().
8477
*/
8578
static struct k_itimer *__lock_timer(timer_t timer_id, unsigned long *flags);
8679

@@ -1159,6 +1152,10 @@ SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock,
11591152
if (get_timespec64(&new_tp, tp))
11601153
return -EFAULT;
11611154

1155+
/*
1156+
* Permission checks have to be done inside the clock specific
1157+
* setter callback.
1158+
*/
11621159
return kc->clock_set(which_clock, &new_tp);
11631160
}
11641161

0 commit comments

Comments
 (0)