netfilter: nf_conntrack_pptp: prevent buffer overflows in debug code
commit9fb6b81e2454b0cf0c3c751f735eb7e8f90f855f
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 14 May 2020 12:14:23 +0000 (14 14:14 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Jun 2020 06:19:47 +0000 (3 08:19 +0200)
tree23effdb54146d20f7966ce3e73810525551d0e62
parente70fb3eff0e2776c6bf9d9600f5868a548882ad8
netfilter: nf_conntrack_pptp: prevent buffer overflows in debug code

commit 4c559f15efcc43b996f4da528cd7f9483aaca36d upstream.

Dan Carpenter says: "Smatch complains that the value for "cmd" comes
from the network and can't be trusted."

Add pptp_msg_name() helper function that checks for the array boundary.

Fixes: f09943fefe6b ("[NETFILTER]: nf_conntrack/nf_nat: add PPTP helper port")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/netfilter/nf_conntrack_pptp.h
net/ipv4/netfilter/nf_nat_pptp.c
net/netfilter/nf_conntrack_pptp.c