فهرست منبع

[NETFILTER]: xt_hashlimit should use time_after_eq()

In order to avoid jiffies wraparound and its effect, special care must
be taken
when doing comparisons ...

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Eric Dumazet 17 سال پیش
والد
کامیت
cbebc51f7b
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      net/netfilter/xt_hashlimit.c

+ 1 - 1
net/netfilter/xt_hashlimit.c

@@ -240,7 +240,7 @@ static bool select_all(const struct xt_hashlimit_htable *ht,
 static bool select_gc(const struct xt_hashlimit_htable *ht,
 static bool select_gc(const struct xt_hashlimit_htable *ht,
 		      const struct dsthash_ent *he)
 		      const struct dsthash_ent *he)
 {
 {
-	return jiffies >= he->expires;
+	return time_after_eq(jiffies, he->expires);
 }
 }
 
 
 static void htable_selective_cleanup(struct xt_hashlimit_htable *ht,
 static void htable_selective_cleanup(struct xt_hashlimit_htable *ht,