From patchwork Mon Jun 5 15:08:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 103324 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2753209vqr; Mon, 5 Jun 2023 08:10:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4hlmmWzq0TDk9ZB1fd5XaOd9VEOXCWhNRVxQKCXaayHTeDt+fXtcJ2PCkWUzp/4YO76xiO X-Received: by 2002:a17:902:d712:b0:1af:d724:63ed with SMTP id w18-20020a170902d71200b001afd72463edmr6996445ply.42.1685977800447; Mon, 05 Jun 2023 08:10:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685977800; cv=none; d=google.com; s=arc-20160816; b=AfYx8n7PbYIwjSJjg7TnB/SSl/DqmlduBLZKqUYBBCz9PwdRzh4e7We+y7sZ2Rj3n0 g0ZevVyDenoFwBRGPTCk5J9NiNXA1DdC97zJaZcYj1Iu0DKwGGs4d14BeMm4RzwCPgVg fi5FUd/Aac0u/Nr60sG4DSqXobCGA79LwE92QEBA1wzg/2H6Ei95G/yhyVU0s2QAIoTb Q5rl9reVJ3zR/UB1yxx2GQ1A3a5wnfdoI9v2g611NYsbASW6mBnvaJXzzNcXEyFQLt4C 1Lg9y47L7TCTQliLEhpMj+4U37WcsSBhBoXaQaw/r41jniUVW/QydjJTco4SjwFQbabI VaVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=hXQRYqtlpQDTr+SKUec6AAcG5d95nzBgx1vMPLRNdJQ=; b=kTIWbO3zq/HFIfUM0saJDwZAD11z5M56djb+WsJ6Glh26+xKB4aDBzlGV3qhWKES1s 567TG1d0xH7o240KPBv5r1VaKKgOENI9IS5tadMinbi5VjXdoVHDP1z7cyoGEGIXhNw8 q3Gl+rAzcYHG5yqqPFnp8HMPp8C1b9BsFuttdm/XjnUYLVULwgRTgV47RsLzY7VE32Up xH7RtdsaYMoHLzLTxsA3HcyY87ZfdnDcXybf8dJnWegvUwqNmBmrwFzE2kQd/eoSy1d2 f88LNTYZ10aWJoU3V+gDve9boZ0+86K1YjWUsuX+mL950bC4xOStRuWKrzvphA6IzAoP iTQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="0C8QW2+/"; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f4-20020a170902860400b001ac75cbde64si5402152plo.622.2023.06.05.08.09.46; Mon, 05 Jun 2023 08:10:00 -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="0C8QW2+/"; 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 S234504AbjFEPIw (ORCPT + 99 others); Mon, 5 Jun 2023 11:08:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234060AbjFEPIa (ORCPT ); Mon, 5 Jun 2023 11:08:30 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD030E8; Mon, 5 Jun 2023 08:08:29 -0700 (PDT) Date: Mon, 05 Jun 2023 15:08:28 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1685977708; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hXQRYqtlpQDTr+SKUec6AAcG5d95nzBgx1vMPLRNdJQ=; b=0C8QW2+/Zywgl/pf53SipFLPMiPLxVkfGL8QNfvhXgIkTRdGPqSWqrrkQ42g990+I89HSc UsEd3hzhf0gPXDsoZwRHYouiTTFtQLyZIQ+TEZuy3K+hk2EpykIa7I59cPQrRtS+/WxhBe wyzegNICBYNeYiGFZgos7mAxF3eTtqixUxSkDoakUk4EDI1cza7MEwl3Nch0kXC6OTi763 og6l+AoWOvbw5uTWyw5exs7JEjKc7vLc9O/mW/j6rGaK3VpyixfS/xFKvsh2WMEhiOHcHW wQwwepYQMaaLwCToFnF6b0v+9Aa697YrCVov0I6maqCHBMwG2xAjTSeLsweLbw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1685977708; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hXQRYqtlpQDTr+SKUec6AAcG5d95nzBgx1vMPLRNdJQ=; b=K3LMWL28exF4Rx49bkKmLK3BhaAHtMm0kQ8CE5gKXv7f6gSZ5/sPHSbBMjrBCBxKtlNCz/ PEzE9SNHkXwYuTBg== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/core] posix-timers: Document sys_clock_settime() permissions in place Cc: Thomas Gleixner , Frederic Weisbecker , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230425183313.514700292@linutronix.de> References: <20230425183313.514700292@linutronix.de> MIME-Version: 1.0 Message-ID: <168597770811.404.16869702165621785153.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764175313224640723?= X-GMAIL-MSGID: =?utf-8?q?1767875858309196214?= The following commit has been merged into the timers/core branch of tip: Commit-ID: 6a0fc851449cdcad42f96e00854af4ac36a4b357 Gitweb: https://git.kernel.org/tip/6a0fc851449cdcad42f96e00854af4ac36a4b357 Author: Thomas Gleixner AuthorDate: Tue, 25 Apr 2023 20:49:16 +02:00 Committer: Thomas Gleixner CommitterDate: Mon, 05 Jun 2023 17:03:38 +02: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 Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20230425183313.514700292@linutronix.de --- kernel/time/posix-timers.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c index 67c1d4d..9d99d4b 100644 --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c @@ -74,13 +74,6 @@ static const struct k_clock clock_realtime, clock_monotonic; * 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); @@ -1159,6 +1152,10 @@ SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock, 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); }