netfilter: nf_conntrack_h323: restore boundary check correctness
authorJakub Jankowski <shasta@toxcorp.com>
Thu, 25 Apr 2019 21:46:50 +0000 (23:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Jun 2019 09:54:05 +0000 (11:54 +0200)
commit2aed9dfe1e5da6daf4c3c4f3a2f05f1c9575abfd
tree6f88717d7a31d1046a32278844c392ef4e99374d
parentd0941980fd81bf795400abd533831d348f08a8e2
netfilter: nf_conntrack_h323: restore boundary check correctness

[ Upstream commit f5e85ce8e733c2547827f6268136b70b802eabdb ]

Since commit bc7d811ace4a ("netfilter: nf_ct_h323: Convert
CHECK_BOUND macro to function"), NAT traversal for H.323
doesn't work, failing to parse H323-UserInformation.
nf_h323_error_boundary() compares contents of the bitstring,
not the addresses, preventing valid H.323 packets from being
conntrack'd.

This looks like an oversight from when CHECK_BOUND macro was
converted to a function.

To fix it, stop dereferencing bs->cur and bs->end.

Fixes: bc7d811ace4a ("netfilter: nf_ct_h323: Convert CHECK_BOUND macro to function")
Signed-off-by: Jakub Jankowski <shasta@toxcorp.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nf_conntrack_h323_asn1.c