From: Pablo Neira Ayuso Date: Thu, 9 Jan 2014 19:03:55 +0000 (+0100) Subject: netfilter: nft_meta: fix lack of validation of the input register X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b38895c5773b00977ca6beff8ebbd2e3f55f1f84;p=linux.git netfilter: nft_meta: fix lack of validation of the input register We have to validate that the input register is in the range of allowed registers, otherwise we can take a incorrect register value as input that may lead us to a crash. Signed-off-by: Pablo Neira Ayuso --- diff --git a/net/netfilter/nft_meta.c b/net/netfilter/nft_meta.c index b43975a433095..e8254ad2e5a9f 100644 --- a/net/netfilter/nft_meta.c +++ b/net/netfilter/nft_meta.c @@ -239,6 +239,9 @@ static int nft_meta_init(const struct nft_ctx *ctx, const struct nft_expr *expr, return err; priv->sreg = ntohl(nla_get_be32(tb[NFTA_META_SREG])); + err = nft_validate_input_register(priv->sreg); + if (err < 0) + return err; return 0; }