diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-05-05 23:30:49 +0300 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-05-06 00:45:48 +0300 |
commit | 198ad973839ca4686f3575155ba9ff178289905f (patch) | |
tree | 84be795e49b224992fb1ccee0b4d679b364fb919 /net/netfilter/nf_conntrack_sane.c | |
parent | 5e024c325406470d1165a09c6feaf8ec897936be (diff) | |
download | linux-198ad973839ca4686f3575155ba9ff178289905f.tar.xz |
netfilter: remove BUG_ON() after skb_header_pointer()
Several conntrack helpers and the TCP tracker assume that
skb_header_pointer() never fails based on upfront header validation.
Even if this should not ever happen, BUG_ON() is a too drastic measure,
remove them.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/nf_conntrack_sane.c')
-rw-r--r-- | net/netfilter/nf_conntrack_sane.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/netfilter/nf_conntrack_sane.c b/net/netfilter/nf_conntrack_sane.c index 1aebd6569d4e..fcb33b1d5456 100644 --- a/net/netfilter/nf_conntrack_sane.c +++ b/net/netfilter/nf_conntrack_sane.c @@ -95,7 +95,10 @@ static int help(struct sk_buff *skb, spin_lock_bh(&nf_sane_lock); sb_ptr = skb_header_pointer(skb, dataoff, datalen, sane_buffer); - BUG_ON(sb_ptr == NULL); + if (!sb_ptr) { + spin_unlock_bh(&nf_sane_lock); + return NF_ACCEPT; + } if (dir == IP_CT_DIR_ORIGINAL) { if (datalen != sizeof(struct sane_request)) |