From 12d79272bd926655e908ef194812738e25a6272a Mon Sep 17 00:00:00 2001 From: Andrew Benson Date: Fri, 6 Mar 2020 07:23:09 -0600 Subject: [PATCH] ppp: patch for CVE-2020-8497, add vlicense --- srcpkgs/ppp/patches/CVE-2020-8597.patch | 39 +++++++++++++++++++++++++ srcpkgs/ppp/template | 9 ++++-- 2 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 srcpkgs/ppp/patches/CVE-2020-8597.patch diff --git a/srcpkgs/ppp/patches/CVE-2020-8597.patch b/srcpkgs/ppp/patches/CVE-2020-8597.patch new file mode 100644 index 00000000000..e0988a886e0 --- /dev/null +++ b/srcpkgs/ppp/patches/CVE-2020-8597.patch @@ -0,0 +1,39 @@ +https://github.com/paulusmack/ppp/commit/8d7970b8f3db727fe798b65f3377fe6787575426.patch + +From 8d7970b8f3db727fe798b65f3377fe6787575426 Mon Sep 17 00:00:00 2001 +From: Paul Mackerras +Date: Mon, 3 Feb 2020 15:53:28 +1100 +Subject: [PATCH] pppd: Fix bounds check in EAP code + +Given that we have just checked vallen < len, it can never be the case +that vallen >= len + sizeof(rhostname). This fixes the check so we +actually avoid overflowing the rhostname array. + +Reported-by: Ilja Van Sprundel +Signed-off-by: Paul Mackerras +--- + pppd/eap.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/pppd/eap.c b/pppd/eap.c +index 94407f56..1b93db01 100644 +--- pppd/eap.c ++++ pppd/eap.c +@@ -1420,7 +1420,7 @@ int len; + } + + /* Not so likely to happen. */ +- if (vallen >= len + sizeof (rhostname)) { ++ if (len - vallen >= sizeof (rhostname)) { + dbglog("EAP: trimming really long peer name down"); + BCOPY(inp + vallen, rhostname, sizeof (rhostname) - 1); + rhostname[sizeof (rhostname) - 1] = '\0'; +@@ -1846,7 +1846,7 @@ int len; + } + + /* Not so likely to happen. */ +- if (vallen >= len + sizeof (rhostname)) { ++ if (len - vallen >= sizeof (rhostname)) { + dbglog("EAP: trimming really long peer name down"); + BCOPY(inp + vallen, rhostname, sizeof (rhostname) - 1); + rhostname[sizeof (rhostname) - 1] = '\0'; diff --git a/srcpkgs/ppp/template b/srcpkgs/ppp/template index 17db21c7ca3..a0863cec565 100644 --- a/srcpkgs/ppp/template +++ b/srcpkgs/ppp/template @@ -1,12 +1,12 @@ # Template file for 'ppp' pkgname=ppp version=2.4.7 -revision=10 +revision=11 makedepends="libpcap-devel libressl-devel" short_desc="PPP (Point-to-Point Protocol) daemon" -homepage="https://ppp.samba.org/" -license="BSD-3-Clause, LGPL-2.0-or-later, GPL-2.0-or-later, Public Domain" maintainer="Orphaned " +license="BSD-3-Clause, LGPL-2.0-or-later, GPL-2.0-or-later, Public Domain" +homepage="https://ppp.samba.org/" distfiles="https://ftp.samba.org/pub/ppp/ppp-$version.tar.gz" checksum=02e0a3dd3e4799e33103f70ec7df75348c8540966ee7c948e4ed8a42bbccfb30 make_dirs=" @@ -79,6 +79,9 @@ do_install() { vinstall etc.ppp/pap-secrets 600 etc/ppp vinstall etc.ppp/chap-secrets 600 etc/ppp + + head -n67 pppd/main.c > LICENSE + vlicense LICENSE } ppp-devel_package() {