inet: fix inet_fill_ifaddr() flags truncation
authorEric Dumazet <edumazet@google.com>
Fri, 10 May 2024 07:29:32 +0000 (07:29 +0000)
committerJakub Kicinski <kuba@kernel.org>
Mon, 13 May 2024 20:53:01 +0000 (13:53 -0700)
commit1af7f88af269c4e06a4dc3bc920ff6cdf7471124
treee1512b0d3b87964022d45e950827eca7c631ee3b
parentc9f9df3f6347b33ae770747c40bae38836e3658c
inet: fix inet_fill_ifaddr() flags truncation

I missed that (struct ifaddrmsg)->ifa_flags was only 8bits,
while (struct in_ifaddr)->ifa_flags is 32bits.

Use a temporary 32bit variable as I did in set_ifa_lifetime()
and check_lifetime().

Fixes: 3ddc2231c810 ("inet: annotate data-races around ifa->ifa_flags")
Reported-by: Yu Watanabe <watanabe.yu@gmail.com>
Dianosed-by: Yu Watanabe <watanabe.yu@gmail.com>
Closes: https://github.com/systemd/systemd/pull/32666#issuecomment-2103977928
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Larysa Zaremba <larysa.zaremba@intel.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20240510072932.2678952-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/devinet.c