Message ID | 20250213101658.1349753-1-dmantipov@yandex.ru (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next] net: skb: do not assume that ktime_t is equal to s64 | expand |
On Thu, 13 Feb 2025 13:16:58 +0300 Dmitry Antipov wrote: > In 'skb_get_timestamp()', do not assume that 'tstamp' of 'struct > sk_buff' (which is 'ktime_t') may be implicitly converted to 's64' > (which is expected by 'ns_to_kernel_old_timeval()') but use > the convenient 'ktime_to_ns()' instead. Compile tested only. Is there a real bug here or you just run a scanner which checks if types match? As is the commit message doesn't really explain what the potential problem is. Also please run get_maintainer.pl on the patch, you missed two people.
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index bb2b751d274a..200b1dc48b27 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -4307,7 +4307,7 @@ static inline ktime_t skb_get_ktime(const struct sk_buff *skb) static inline void skb_get_timestamp(const struct sk_buff *skb, struct __kernel_old_timeval *stamp) { - *stamp = ns_to_kernel_old_timeval(skb->tstamp); + *stamp = ns_to_kernel_old_timeval(ktime_to_ns(skb->tstamp)); } static inline void skb_get_new_timestamp(const struct sk_buff *skb,
In 'skb_get_timestamp()', do not assume that 'tstamp' of 'struct sk_buff' (which is 'ktime_t') may be implicitly converted to 's64' (which is expected by 'ns_to_kernel_old_timeval()') but use the convenient 'ktime_to_ns()' instead. Compile tested only. Fixes: 13c6ee2a9216 ("socket: Use old_timeval types for socket timestamps") Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> --- include/linux/skbuff.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)