[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f2c219c8-0765-6942-8495-b5acf3756fb1@huawei.com>
Date: Tue, 10 Sep 2024 19:23:38 +0800
From: Jinjie Ruan <ruanjinjie@...wei.com>
To: Richard Cochran <richardcochran@...il.com>
CC: <bryan.whitehead@...rochip.com>, <davem@...emloft.net>,
<edumazet@...gle.com>, <kuba@...nel.org>, <pabeni@...hat.com>,
<anna-maria@...utronix.de>, <frederic@...nel.org>, <tglx@...utronix.de>,
<UNGLinuxDriver@...rochip.com>, <mbenes@...e.cz>, <jstultz@...gle.com>,
<andrew@...n.ch>, <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next v3 1/2] posix-timers: Check timespec64 before call
clock_set()
On 2024/9/9 23:19, Richard Cochran wrote:
> On Mon, Sep 09, 2024 at 03:41:23PM +0800, Jinjie Ruan wrote:
>> diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
>> index 1cc830ef93a7..34deec619e17 100644
>> --- a/kernel/time/posix-timers.c
>> +++ b/kernel/time/posix-timers.c
>> @@ -1137,6 +1137,9 @@ SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock,
>> if (get_timespec64(&new_tp, tp))
>> return -EFAULT;
>>
>> + if (!timespec64_valid(&new_tp))
>> + return -ERANGE;
>
> Why not use timespec64_valid_settod()?
It seems more limited and is only used in timekeeping or
do_sys_settimeofday64().
And the timespec64_valid() is looser and wider used, which I think is
more appropriate here.
>
> Thanks,
> Richard
Powered by blists - more mailing lists