Skip to content

Commit 08e42a0

Browse files
committed
netfilter: nf_tables: out-of-bound check in chain blob
Add current size of rule expressions to the boundary check. Fixes: 2c865a8 ("netfilter: nf_tables: add rule blob layout") Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 24e2278 commit 08e42a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9007,7 +9007,7 @@ static int nf_tables_commit_chain_prepare(struct net *net, struct nft_chain *cha
90079007
continue;
90089008
}
90099009

9010-
if (WARN_ON_ONCE(data + expr->ops->size > data_boundary))
9010+
if (WARN_ON_ONCE(data + size + expr->ops->size > data_boundary))
90119011
return -ENOMEM;
90129012

90139013
memcpy(data + size, expr, expr->ops->size);

0 commit comments

Comments
 (0)