summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVasily Averin <vvs@virtuozzo.com>2020-06-09 10:53:22 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-07-09 09:35:57 +0200
commit396ba2fc4f27ef6c44bbc0098bfddf4da76dc4c9 (patch)
tree1aa3d14cb68ea5cd33a7c068d519aeb263a5fb99
parentdd54eb64ba65370b1abb1c689bd2e235bcd94284 (diff)
downloadlinux-stable-396ba2fc4f27ef6c44bbc0098bfddf4da76dc4c9.tar.gz
linux-stable-396ba2fc4f27ef6c44bbc0098bfddf4da76dc4c9.tar.bz2
linux-stable-396ba2fc4f27ef6c44bbc0098bfddf4da76dc4c9.zip
netfilter: nf_conntrack_h323: lost .data_len definition for Q.931/ipv6
Could you please push this patch into stable@? it fixes memory corruption in kernels v3.5 .. v4.10 Lost .data_len definition leads to write beyond end of struct nf_ct_h323_master. Usually it corrupts following struct nf_conn_nat, however if nat is not loaded it corrupts following slab object. In mainline this problem went away in v4.11, after commit 9f0f3ebeda47 ("netfilter: helpers: remove data_len usage for inkernel helpers") however many stable kernels are still affected. Fixes: 1afc56794e03 ("netfilter: nf_ct_helper: implement variable length helper private data") # v3.5 cc: stable@vger.kernel.org Reviewed-by: Florian Westphal <fw@strlen.de> Signed-off-by: Vasily Averin <vvs@virtuozzo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--net/netfilter/nf_conntrack_h323_main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/netfilter/nf_conntrack_h323_main.c b/net/netfilter/nf_conntrack_h323_main.c
index f65d93639d12..29fe1e7eac88 100644
--- a/net/netfilter/nf_conntrack_h323_main.c
+++ b/net/netfilter/nf_conntrack_h323_main.c
@@ -1225,6 +1225,7 @@ static struct nf_conntrack_helper nf_conntrack_helper_q931[] __read_mostly = {
{
.name = "Q.931",
.me = THIS_MODULE,
+ .data_len = sizeof(struct nf_ct_h323_master),
.tuple.src.l3num = AF_INET6,
.tuple.src.u.tcp.port = cpu_to_be16(Q931_PORT),
.tuple.dst.protonum = IPPROTO_TCP,