summaryrefslogtreecommitdiffstats
path: root/net/netfilter
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2018-10-22 21:49:45 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2018-10-25 10:18:31 +0200
commit5e91c9d9cd3fd557226ca75fed58816b9eee7e07 (patch)
treeace9caef5db08ea65ff891c1dc2c7179a8c46225 /net/netfilter
parent61792b677415b77c8db04991c22966bb8de7603e (diff)
downloadlinux-5e91c9d9cd3fd557226ca75fed58816b9eee7e07.tar.gz
linux-5e91c9d9cd3fd557226ca75fed58816b9eee7e07.tar.bz2
linux-5e91c9d9cd3fd557226ca75fed58816b9eee7e07.zip
netfilter: nft_osf: check if attribute is present
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>
Diffstat (limited to 'net/netfilter')
-rw-r--r--net/netfilter/nft_osf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/nft_osf.c b/net/netfilter/nft_osf.c
index ca5e5d8c5ef8..b13618c764ec 100644
--- 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;