mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
netfilter: nfnetlink_osf: Fix a missing skb_header_pointer() NULL check
[ Upstream commit5e024c3254] Do not assume that the tcph->doff field is correct when parsing for TCP options, skb_header_pointer() might fail to fetch these bits. Fixes:11eeef41d5("netfilter: passive OS fingerprint xtables match") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
cee6592d44
commit
403ccad066
@@ -186,6 +186,8 @@ static const struct tcphdr *nf_osf_hdr_ctx_init(struct nf_osf_hdr_ctx *ctx,
|
||||
|
||||
ctx->optp = skb_header_pointer(skb, ip_hdrlen(skb) +
|
||||
sizeof(struct tcphdr), ctx->optsize, opts);
|
||||
if (!ctx->optp)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return tcp;
|
||||
|
||||
Reference in New Issue
Block a user