netfilter: nf_tables: reject expiration higher than timeout
[ Upstream commit c0f38a8c60174368aed1d0f9965d733195f15033 ]
Report ERANGE to userspace if user specifies an expiration larger than
the 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>
This commit is contained in:
parent
bd6b2e3a01
commit
05f6631614
1 changed files with 3 additions and 0 deletions
|
|
@ -4894,6 +4894,9 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
|
|||
&expiration);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
if (expiration > timeout)
|
||||
return -ERANGE;
|
||||
}
|
||||
|
||||
err = nft_setelem_parse_key(ctx, set, &elem.key.val,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue