projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
61792b6
)
netfilter: nft_osf: check if attribute is present
author
Pablo Neira Ayuso
<pablo@netfilter.org>
Mon, 22 Oct 2018 19:49:45 +0000
(21:49 +0200)
committer
Pablo Neira Ayuso
<pablo@netfilter.org>
Thu, 25 Oct 2018 08:18:31 +0000
(10:18 +0200)
If the attribute is not sent, eg. old libnftnl binary, then
tb[NFTA_OSF_TTL] is NULL and kernel crashes from the _init path.
Fixes: a218dc82f0b5 ("netfilter: nft_osf: Add ttl option support")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nft_osf.c
patch
|
blob
|
history
diff --git
a/net/netfilter/nft_osf.c
b/net/netfilter/nft_osf.c
index ca5e5d8c5ef8b91cd61cb039d652f4549c343948..b13618c764ec296377778ee405b9067515ada25a 100644
(file)
--- a/
net/netfilter/nft_osf.c
+++ b/
net/netfilter/nft_osf.c
@@
-50,7
+50,7
@@
static int nft_osf_init(const struct nft_ctx *ctx,
int err;
u8 ttl;
- if (
nla_get_u8(tb[NFTA_OSF_TTL])
) {
+ if (
tb[NFTA_OSF_TTL]
) {
ttl = nla_get_u8(tb[NFTA_OSF_TTL]);
if (ttl > 2)
return -EINVAL;