Re: [PATCH v3 06/12] rtc: rzn1: Fix alarm range check truncation on 32-bit systems

Wolfram Sang <[email protected]>
Newsgroups org.kernel.vger.linux-renesas-soc,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel,org.kernel.vger.linux-rtc
Message-ID <aoQ0roC0n_mr3YjP@ninjato>
On Mon, Jul 06, 2026 at 06:51:32PM +0100, Prabhakar wrote:
> From: Lad Prabhakar <[email protected]>
> 
> alarm and farest were declared as unsigned long, but
> rtc_tm_to_time64() returns time64_t (s64). On 32-bit systems where
> unsigned long is 32 bits, the assignment silently truncates the upper
> 32 bits of the timestamp.
> 
> Fix by declaring alarm and farest as time64_t and replacing
> time_after() with a direct signed comparison, which is correct for
> time64_t values that will never realistically overflow.
> 
> Signed-off-by: Lad Prabhakar <[email protected]>
> Reviewed-by: Geert Uytterhoeven <[email protected]>

Reviewed-by: Wolfram Sang <[email protected]>
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmqENK4ACgkQFA3kzBSg
Kba16Q//UTO3o0EGiNEeLNBEgajaGR2ujmGMYbCx/dxLIejrn/mvjOwwcOP0BqkF
GzmF/R09RPuZzkmA8L4frDUWEe0oh+6EU+bcsJxB3QUXN4dHJoyc6c/Aq6fPA1y+
kCI2OKtuyAd/Kj+VT4M4utZIjayVWbGiEONBSuNBixV/StK/c2w+HBYz4r3bFBgp
XCAa7wL7JRESzE053svNbVz10j/e81PafUtzVimUF8C9/1gEpr0m95XAOEFsmVqB
b4Do3v/igUG9sU/t2ejudo0Z6OaPLfJHccOHeYOSMbZCFOpg86xgZNQIpGmDkXGR
EpFMjd7DZxboxoNVjcrGuA5Gy4jOAwtWcFfNYG6mhsfDJb5VJB/jQrLeL9bMlrue
9zSSgPR2wlpF+Ugkbfie2wD9Mr+WsV2Pugmb5uB0IFxjAye/c2qKPGARRPcA4CLw
aSc8J6hJTI1sCY1NLkcU+jFd4dk3eR//s7L6GM24q0r+yWn1TgyIOU8yaA88gyYl
8oB1j0lWJPQlUbUI+BStMNd30ZTyueALkLsHdLLLYhvpsJqX5nN6GOO8IpgHSDRJ
VkRX5B0zqVf/YfzRP4U4GglhnTLvS9i8mhjQ43Sk7hP/QKrUgNQA5pOw9hau0rjM
yids4VguztXl544I9qwN1oONUiEwC9WrW8algl65QkxxisyxYcg=
=bK/Z
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.