netfilter: nf_tables: elements with timeout below CONFIG_HZ never expire
BugLink: https://bugs.launchpad.net/bugs/2089340
[ Upstream commit e0c47281723f301894c14e6f5cd5884fdfb813f9 ]
Element timeout that is below CONFIG_HZ never expires because the
timeout extension is not allocated given that nf_msecs_to_jiffies64()
returns 0. Set timeout to the minimum value to honor timeout.
Fixes: 8e1102d5a1 ("netfilter: nf_tables: support timeouts larger than 23 days")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Portia Stephens <portia.stephens@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
This commit is contained in:
committed by
Mehmet Basaran
parent
2781b7d60d
commit
b975697515
@@ -4537,7 +4537,7 @@ int nf_msecs_to_jiffies64(const struct nlattr *nla, u64 *result)
|
||||
return -ERANGE;
|
||||
|
||||
ms *= NSEC_PER_MSEC;
|
||||
*result = nsecs_to_jiffies64(ms);
|
||||
*result = nsecs_to_jiffies64(ms) ? : !!ms;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user