From: Jinjie Ruan <ruanjinjie@huawei.com>
To: Thomas Gleixner <tglx@linutronix.de>,
Richard Cochran <richardcochran@gmail.com>
Cc: <bryan.whitehead@microchip.com>, <davem@davemloft.net>,
<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
<anna-maria@linutronix.de>, <frederic@kernel.org>,
<UNGLinuxDriver@microchip.com>, <mbenes@suse.cz>,
<jstultz@google.com>, <andrew@lunn.ch>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -next v3 1/2] posix-timers: Check timespec64 before call clock_set()
Date: Sat, 14 Sep 2024 17:00:45 +0800 [thread overview]
Message-ID: <315a63f5-712e-c6a0-c447-9dd70253e3aa@huawei.com> (raw)
In-Reply-To: <87v7yz96gr.ffs@tglx>
On 2024/9/13 18:46, Thomas Gleixner wrote:
> On Thu, Sep 12 2024 at 20:24, Jinjie Ruan wrote:
>> On 2024/9/12 20:04, Thomas Gleixner wrote:
>>> How does this code validate timespecs for clock_settime(clockid) where
>>> clockid != CLOCK_REALTIME?
>>
>> According to the man manual of clock_settime(), the other clockids are
>> not settable.
>>
>> And in Linux kernel code, except for CLOCK_REALTIME which is defined in
>> posix_clocks array, the clock_set() hooks are not defined and will
>> return -EINVAL in SYSCALL_DEFINE2(clock_settime), so the check is not
>> necessary.
>
> You clearly understand the code you are modifying:
>
> const struct k_clock clock_posix_dynamic = {
> .clock_getres = pc_clock_getres,
> .clock_set = pc_clock_settime,
>
> which is what PTP clocks use and that's what this is about, no?
Yes, it uses the dynamic one rather than the static ones.
>
> Thanks,
>
> tglx
next prev parent reply other threads:[~2024-09-14 9:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-09 7:41 [PATCH -next v3 0/2] " Jinjie Ruan
2024-09-09 7:41 ` [PATCH -next v3 1/2] " Jinjie Ruan
2024-09-09 15:19 ` Richard Cochran
2024-09-10 11:23 ` Jinjie Ruan
2024-09-10 12:05 ` Thomas Gleixner
2024-09-10 12:30 ` Jinjie Ruan
2024-09-10 15:48 ` Thomas Gleixner
2024-09-12 2:53 ` Jinjie Ruan
2024-09-12 12:04 ` Thomas Gleixner
2024-09-12 12:24 ` Jinjie Ruan
2024-09-13 10:46 ` Thomas Gleixner
2024-09-14 9:00 ` Jinjie Ruan [this message]
2024-09-09 7:41 ` [PATCH -next v3 2/2] net: lan743x: Remove duplicate check Jinjie Ruan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=315a63f5-712e-c6a0-c447-9dd70253e3aa@huawei.com \
--to=ruanjinjie@huawei.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew@lunn.ch \
--cc=anna-maria@linutronix.de \
--cc=bryan.whitehead@microchip.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=frederic@kernel.org \
--cc=jstultz@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mbenes@suse.cz \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®