]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
net: igmp: increase size of mr_ifc_count
authorEric Dumazet <edumazet@google.com>
Wed, 11 Aug 2021 19:57:15 +0000 (12:57 -0700)
committerSasha Levin <sashal@kernel.org>
Thu, 26 Aug 2021 12:36:39 +0000 (08:36 -0400)
[ Upstream commit b69dd5b3780a7298bd893816a09da751bc0636f7 ]

Some arches support cmpxchg() on 4-byte and 8-byte only.
Increase mr_ifc_count width to 32bit to fix this problem.

Fixes: 4a2b285e7e10 ("net: igmp: fix data-race in igmp_ifc_timer_expire()")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210811195715.3684218-1-eric.dumazet@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/inetdevice.h
net/ipv4/igmp.c

index a64f21a97369a5a7f8eb35c5a5040d359ffd6681..131f93f8d58727bea801c6771a3b546fa15d47cc 100644 (file)
@@ -41,7 +41,7 @@ struct in_device {
        unsigned long           mr_qri;         /* Query Response Interval */
        unsigned char           mr_qrv;         /* Query Robustness Variable */
        unsigned char           mr_gq_running;
-       unsigned char           mr_ifc_count;
+       u32                     mr_ifc_count;
        struct timer_list       mr_gq_timer;    /* general query timer */
        struct timer_list       mr_ifc_timer;   /* interface change timer */
 
index 95ec3923083f46c833853787a22ef2cd549d23db..dca7fe0ae24ad4e34c125be7fad9951ae79265be 100644 (file)
@@ -807,7 +807,7 @@ static void igmp_gq_timer_expire(struct timer_list *t)
 static void igmp_ifc_timer_expire(struct timer_list *t)
 {
        struct in_device *in_dev = from_timer(in_dev, t, mr_ifc_timer);
-       u8 mr_ifc_count;
+       u32 mr_ifc_count;
 
        igmpv3_send_cr(in_dev);
 restart: