Skip to content

Commit

Permalink
netfilter: nf_tables: fix wrong length for jump/goto verdicts
Browse files Browse the repository at this point in the history
NFT_JUMP/GOTO erronously sets length to sizeof(void *).

We then allocate insufficient memory when such element is added to a vmap.

Suggested-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Florian Westphal authored and ummakynes committed Apr 24, 2015
1 parent b357a36 commit 4c4ed07
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/netfilter/nf_tables_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -4340,7 +4340,6 @@ static int nft_verdict_init(const struct nft_ctx *ctx, struct nft_data *data,
case NFT_CONTINUE:
case NFT_BREAK:
case NFT_RETURN:
desc->len = sizeof(data->verdict);
break;
case NFT_JUMP:
case NFT_GOTO:
Expand All @@ -4355,10 +4354,10 @@ static int nft_verdict_init(const struct nft_ctx *ctx, struct nft_data *data,

chain->use++;
data->verdict.chain = chain;
desc->len = sizeof(data);
break;
}

desc->len = sizeof(data->verdict);
desc->type = NFT_DATA_VERDICT;
return 0;
}
Expand Down

0 comments on commit 4c4ed07

Please sign in to comment.