Re: [PATCH v3 net-next] net: use get_random_u{16,32,64}() where appropriate

Matthieu Baerts
2026-04-06T14:13:25Z

Hi David,

On 05/04/2026 17:48, David Carlier wrote:
> Use the typed random integer helpers instead of
> get_random_bytes() when filling a single integer variable.
> The helpers return the value directly, require no pointer
> or size argument, and better express intent.

Regarding the modifications in net/mptcp, it looks good to me:

Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> # net/mptcp

> Skipped sites writing into __be16 fields (netdevsim) where
> a direct assignment would trigger sparse endianness warnings.

Note that the AI reviews are mentioning that auth->client_challenge from
net/ceph/auth_x.c is declared as __le64, and it might then also cause
sparse warnings:

https://sashiko.dev/#/patchset/20260405154816.4774-1-devnexen%40gmail.com

It looks like they are right:

$ make C=1 net/ceph/auth_x.o
net/ceph/auth_x.c:574:40: warning: incorrect type in assignment (different base types)
net/ceph/auth_x.c:574:40: expected restricted __le64 [usertype] client_challenge
net/ceph/auth_x.c:574:40: got unsigned long long

Note that the Netdev CI currently doesn't check sparse warnings:

https://github.com/linux-netdev/nipa/issues/76

Cheers,
Matt
--