[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e78f815a-9aba-4542-bfa7-3d73d1b684f3@lunn.ch>
Date: Fri, 6 Sep 2024 13:51:26 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Jinjie Ruan <ruanjinjie@...wei.com>
Cc: bryan.whitehead@...rochip.com, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, richardcochran@...il.com,
UNGLinuxDriver@...rochip.com, netdev@...r.kernel.org
Subject: Re: [PATCH -next v2 1/2] ptp: Check timespec64 before call
settime64()
On Fri, Sep 06, 2024 at 11:48:05AM +0800, Jinjie Ruan wrote:
> As Andrew pointed out, it will make sence that the PTP core
> checked timespec64 struct's tv_sec and tv_nsec range before calling
> ptp->info->settime64(), so check it ahead.
>
> There are some drivers that use tp->tv_sec and tp->tv_nsec directly to
> write registers without validity checks and assume that the PTP core has
> been checked, which is dangerous and will benefit from this, such as
> hclge_ptp_settime(), igb_ptp_settime_i210(), _rcar_gen4_ptp_settime(),
> and some drivers can remove the checks of itself.
>
> Signed-off-by: Jinjie Ruan <ruanjinjie@...wei.com>
> Suggested-by: Andrew Lunn <andrew@...n.ch>
FYI: Your Signed-off-by: should be last. Please fix this when you
respin as requested by Richard.
Andrew
---
pw-bot: cr
Powered by blists - more mailing lists