mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
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: a218dc82f0 ("netfilter: nft_osf: Add ttl option support")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user