RE: [PATCH 1/4] netfilter: ipset: fix timeout value overflow bug

From
David Laight <hidden>
Date
2012-05-14 14:20:22
Also in
netfilter-devel
Reply to
pablo@netfilter.org, 2012-05-14
 
quoted hunk ↗ jump to hunk
--- a/include/linux/netfilter/ipset/ip_set_timeout.h
+++ b/include/linux/netfilter/ipset/ip_set_timeout.h
@@ -30,6 +30,10 @@ ip_set_timeout_uget(struct nlattr *tb)
 {
 	unsigned int timeout = ip_set_get_h32(tb);
 
+	/* Normalize to fit into jiffies */
+	if (timeout > UINT_MAX/1000)
+		timeout = UINT_MAX/1000;
+
Doesn't that rather assume that HZ is 1000 ?

	David
 
Thread (20 messages) 20 messages, 5 authors, last reply 2012-05-16
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help