projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
24e2278
)
netfilter: nf_tables: out-of-bound check in chain blob
author
Pablo Neira Ayuso
<pablo@netfilter.org>
Tue, 6 Jun 2023 14:32:44 +0000
(16:32 +0200)
committer
Pablo Neira Ayuso
<pablo@netfilter.org>
Tue, 6 Jun 2023 22:43:44 +0000
(
00:43
+0200)
Add current size of rule expressions to the boundary check.
Fixes:
2c865a8a28a1
("netfilter: nf_tables: add rule blob layout")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c
patch
|
blob
|
history
diff --git
a/net/netfilter/nf_tables_api.c
b/net/netfilter/nf_tables_api.c
index
3445b8e
..
0519d45
100644
(file)
--- a/
net/netfilter/nf_tables_api.c
+++ b/
net/netfilter/nf_tables_api.c
@@
-9007,7
+9007,7
@@
static int nf_tables_commit_chain_prepare(struct net *net, struct nft_chain *cha
continue;
}
- if (WARN_ON_ONCE(data + expr->ops->size > data_boundary))
+ if (WARN_ON_ONCE(data +
size +
expr->ops->size > data_boundary))
return -ENOMEM;
memcpy(data + size, expr, expr->ops->size);