aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services/ppp/patches/701-pppd-Fix-bounds-check-in-EAP-code.patch
diff options
context:
space:
mode:
authorPetr Štetiar <ynezz@true.cz>2020-02-20 09:03:54 +0100
committerPetr Štetiar <ynezz@true.cz>2020-02-20 09:17:11 +0100
commit6b7eeb74dbf8b491b6426820bfa230fca60047dc (patch)
treeafa24c1137aacce65eb00c0f74800871fbc70ebc /package/network/services/ppp/patches/701-pppd-Fix-bounds-check-in-EAP-code.patch
parent95d5cbdec34e3d29db17a2c823e3d01be1e9c283 (diff)
downloadupstream-6b7eeb74dbf8b491b6426820bfa230fca60047dc.tar.gz
upstream-6b7eeb74dbf8b491b6426820bfa230fca60047dc.tar.bz2
upstream-6b7eeb74dbf8b491b6426820bfa230fca60047dc.zip
ppp: backport security fixes
8d45443bb5c9 pppd: Ignore received EAP messages when not doing EAP 8d7970b8f3db pppd: Fix bounds check in EAP code 858976b1fc31 radius: Prevent buffer overflow in rc_mksid() Signed-off-by: Petr Štetiar <ynezz@true.cz> (cherry picked from commit 215598fd03899c19a9cd26266221269dd5ec8cee)
Diffstat (limited to 'package/network/services/ppp/patches/701-pppd-Fix-bounds-check-in-EAP-code.patch')
-rw-r--r--package/network/services/ppp/patches/701-pppd-Fix-bounds-check-in-EAP-code.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/package/network/services/ppp/patches/701-pppd-Fix-bounds-check-in-EAP-code.patch b/package/network/services/ppp/patches/701-pppd-Fix-bounds-check-in-EAP-code.patch
new file mode 100644
index 0000000000..c2ca9729ec
--- /dev/null
+++ b/package/network/services/ppp/patches/701-pppd-Fix-bounds-check-in-EAP-code.patch
@@ -0,0 +1,37 @@
+From 8d7970b8f3db727fe798b65f3377fe6787575426 Mon Sep 17 00:00:00 2001
+From: Paul Mackerras <paulus@ozlabs.org>
+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 <ivansprundel@ioactive.com>
+Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
+---
+ pppd/eap.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/pppd/eap.c b/pppd/eap.c
+index 94407f56a336..1b93db01aebd 100644
+--- a/pppd/eap.c
++++ b/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';