Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7366897rwr; Tue, 25 Apr 2023 11:52:15 -0700 (PDT) X-Google-Smtp-Source: AKy350atDCTpFQVXvVmEVnqe7bqLVRupIqt2B2Bm3i5kN2kJNzXzmuFhcuU4U7jaj6E+BKIAMfLY X-Received: by 2002:a05:6a00:1396:b0:63d:24d0:2c32 with SMTP id t22-20020a056a00139600b0063d24d02c32mr26249331pfg.33.1682448734679; Tue, 25 Apr 2023 11:52:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682448734; cv=none; d=google.com; s=arc-20160816; b=uOUeR6S/HdJS7IqIG7y0sLVP/bcQlbvdXM5TOWFDQrJVDsngQFTWaU5pUTfhyvHwzW 7VVf9v1mIqkipGfFU4Akg5zxOx6r2R+K3KQYUgSAykHyBfKV9WOISW/Mp5hi2jzeNyI8 IhmJtqJdowzttYUpS49jTX2OMXS9/rveFIT81+ZMqGdACogXyzdfOXJLIUePj8JLhfqX PFciPZt1TX85Yz6iXiGkJd1t4hgoXIPUGXx5EKThRj/ariw/PSVfcMGO7sTkkTjhoH9x BI624mP0sv2C9ovEKBklMfEq7X0aNu1L6t5neRqoxpjJLiZvODb6g2eVyqKDrQdsxzCB pV6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:mime-version:references:subject:cc:to:from :dkim-signature:dkim-signature:message-id; bh=lgf6JYOTW6euMxMOYjqPPRc1RJSaBkir9GoWtN7e358=; b=JK3UWVbmbcKcdetFC+Xnnlp5aylIHvKhVVqZlrAa+CfvTTuuK/9W6Bj6HJvkk2j++J LfzoCaBud0HKx8Ttbi5sm4fFnDnzWcuFhms5tnCuVaOpWpJjvLReVdOdHD+Dv0rraP9V 0MYOQeDD4+/2FhGZSmXl41+qizDbJn69seJPbB8SHPswnZk+BgYZ3OmZtxQ7oQmBwSCj zJoqqP9MzSv64gkBCTGv+WFMvXG/BgaW/4/Mpeo/QgCm1NzIrAmto0yN2F9UsPRrUi9I +tI3oG2NBPTB34LeQX3CBD8haQz7tw+5ffq4MVzWITc0Qgt8pwDFIiCQa6x+Qm7Btkbv PnxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=NjeG5dGI; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y83-20020a626456000000b0063b872934a4si14389510pfb.340.2023.04.25.11.52.00; Tue, 25 Apr 2023 11:52:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=NjeG5dGI; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234869AbjDYSt7 (ORCPT + 99 others); Tue, 25 Apr 2023 14:49:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234835AbjDYSte (ORCPT ); Tue, 25 Apr 2023 14:49:34 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62BBA18E8C for ; Tue, 25 Apr 2023 11:49:18 -0700 (PDT) Message-ID: <20230425183313.514700292@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1682448556; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=lgf6JYOTW6euMxMOYjqPPRc1RJSaBkir9GoWtN7e358=; b=NjeG5dGI+QXoQmwE0IVWJtdyZ1z2UxBAv2ePE70Sk9iqt0kU0RJCZYS+vfL+ULvVlgDSck p1fAQ5WvkVJVBoh5OdjoVBoz0qzKHxhoStFxbT2toucywWRQA47dq3DFrCHUvgl8szjEft VVaBbFOl2pCOy/kk9DrzAZmhQDlFNgJtPDogDZhyiERmao1ATKhgSdJfklNsRE9ws8Zt2d KQVWeS6WpkrbrUegZWJBrFNRRHPpFnM6fALs6Q0N4sFZ2b05whfBMwhgdhyc15H4s3OQ2w vhZ8pHSmSk9GFhpsP+9WmBX3h1h0btLQbcOU+q5W6kYoK5wOqBWbsNBp3cd6yA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1682448556; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=lgf6JYOTW6euMxMOYjqPPRc1RJSaBkir9GoWtN7e358=; b=zEkOlMO31FtCg9YakYE1jAgV2nRKOugoFvn2GddGck+moiFgeXzJkcBt67RYqcI3+iDC3G 29o4RZBVzi+/J7Aw== From: Thomas Gleixner To: LKML Cc: Frederic Weisbecker , Anna-Maria Behnsen , Peter Zijlstra , Sebastian Siewior , syzbot+5c54bd3eb218bb595aa9@syzkaller.appspotmail.com, Dmitry Vyukov , Michael Kerrisk Subject: [patch 13/20] posix-timers: Document sys_clock_settime() permissions in place References: <20230425181827.219128101@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Tue, 25 Apr 2023 20:49:16 +0200 (CEST) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- kernel/time/posix-timers.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c @@ -74,13 +74,6 @@ static const struct k_clock clock_realti * following: 1.) The k_itimer struct (sched.h) is used for * the timer. 2.) The list, it_lock, it_clock, it_id and * 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); @@ -1165,6 +1158,10 @@ SYSCALL_DEFINE2(clock_settime, const clo if (get_timespec64(&new_tp, tp)) return -EFAULT; + /* + * Permission checks have to be done inside the clock specific + * setter callback. + */ return kc->clock_set(which_clock, &new_tp); }