projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7072a35
)
netfilter: nfnetlink_osf: Fix a missing skb_header_pointer() NULL check
author
Pablo Neira Ayuso
<pablo@netfilter.org>
Wed, 5 May 2021 20:25:24 +0000
(22:25 +0200)
committer
Pablo Neira Ayuso
<pablo@netfilter.org>
Wed, 5 May 2021 20:26:09 +0000
(22:26 +0200)
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:
11eeef41d5f6
("netfilter: passive OS fingerprint xtables match")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nfnetlink_osf.c
patch
|
blob
|
history
diff --git
a/net/netfilter/nfnetlink_osf.c
b/net/netfilter/nfnetlink_osf.c
index
e8f8875
..
0fa2e20
100644
(file)
--- a/
net/netfilter/nfnetlink_osf.c
+++ b/
net/netfilter/nfnetlink_osf.c
@@
-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;