initial buildroot for linux 5.15
This commit is contained in:
@@ -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 94407f56..1b93db01 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';
|
||||
@@ -0,0 +1,45 @@
|
||||
config BR2_PACKAGE_PPPD
|
||||
bool "pppd"
|
||||
depends on !BR2_STATIC_LIBS
|
||||
depends on !BR2_TOOLCHAIN_USES_MUSL # Use __P() macro all over the tree
|
||||
depends on BR2_USE_MMU
|
||||
select BR2_PACKAGE_OPENSSL if BR2_TOOLCHAIN_USES_GLIBC
|
||||
select BR2_PACKAGE_LIBOPENSSL_ENABLE_DES if BR2_PACKAGE_LIBOPENSSL \
|
||||
&& BR2_TOOLCHAIN_USES_GLIBC
|
||||
help
|
||||
An implementation of the Point-to-point protocol.
|
||||
|
||||
http://www.samba.org/ppp/
|
||||
|
||||
if BR2_PACKAGE_PPPD
|
||||
|
||||
config BR2_PACKAGE_PPPD_FILTER
|
||||
bool "filtering"
|
||||
select BR2_PACKAGE_LIBPCAP
|
||||
help
|
||||
Packet filtering abilities for pppd. If enabled,
|
||||
the pppd active-filter and pass-filter options
|
||||
are available.
|
||||
|
||||
config BR2_PACKAGE_PPPD_RADIUS
|
||||
bool "radius"
|
||||
help
|
||||
Install RADIUS support for pppd
|
||||
|
||||
config BR2_PACKAGE_PPPD_OVERWRITE_RESOLV_CONF
|
||||
bool "overwrite /etc/resolv.conf"
|
||||
default y
|
||||
help
|
||||
Overwrite /etc/resolv.conf instead of maintaining the
|
||||
separate list of nameservers in /etc/ppp/resolv.conf
|
||||
|
||||
Note that the pppd default of writing to /etc/ppp/resolv.conf
|
||||
does not work on a read-only rootfs unless you make it
|
||||
writable in your rootfs customizations (e.g. by linking it to
|
||||
a file in tmpfs or by mounting a writable filesystem on it).
|
||||
|
||||
endif
|
||||
|
||||
comment "pppd needs a uClibc or glibc toolchain w/ dynamic library"
|
||||
depends on BR2_STATIC_LIBS || BR2_TOOLCHAIN_USES_MUSL
|
||||
depends on BR2_USE_MMU
|
||||
@@ -0,0 +1,7 @@
|
||||
# Locally calculated
|
||||
sha256 91fbff784ad16a1111a7f22df4675aeb161d958bb79f1cc4c1f0c81944e7cb40 pppd-2.4.8.tar.gz
|
||||
sha256 3990c65c506885f7bb75455d1d6188743a14ad46f5b62e136ef3739aed52c532 pppd/tdb.c
|
||||
sha256 1822ead9d2854adfbd282322b29730a3fec4cc67f6f6a2e487aad3476e3afd59 pppd/plugins/pppoatm/COPYING
|
||||
sha256 91a5e9c173e0e001e081e15bf7850cfd782a0baa02f5921e327ae3b449beff3f pppdump/bsd-comp.c
|
||||
sha256 ee1c28551c87cdcdaf80eb3922726f015201614cb560a5ed18a7a0c15f2b4aa4 pppd/ccp.c
|
||||
sha256 6fa4c3dad059f6ef15c1c5e5219d9d0d40991dd3a162098a89967a1720de059e pppd/plugins/passprompt.c
|
||||
@@ -0,0 +1,123 @@
|
||||
################################################################################
|
||||
#
|
||||
# pppd
|
||||
#
|
||||
################################################################################
|
||||
|
||||
PPPD_VERSION = 2.4.8
|
||||
PPPD_SITE = $(call github,paulusmack,ppp,ppp-$(PPPD_VERSION))
|
||||
PPPD_LICENSE = LGPL-2.0+, LGPL, BSD-4-Clause, BSD-3-Clause, GPL-2.0+
|
||||
PPPD_LICENSE_FILES = \
|
||||
pppd/tdb.c pppd/plugins/pppoatm/COPYING \
|
||||
pppdump/bsd-comp.c pppd/ccp.c pppd/plugins/passprompt.c
|
||||
PPPD_CPE_ID_VENDOR = samba
|
||||
PPPD_CPE_ID_PRODUCT = ppp
|
||||
PPPD_SELINUX_MODULES = ppp
|
||||
|
||||
# 0001-pppd-Fix-bounds-check.patch
|
||||
PPPD_IGNORE_CVES += CVE-2020-8597
|
||||
|
||||
PPPD_MAKE_OPTS = HAVE_INET6=y
|
||||
ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
|
||||
PPPD_DEPENDENCIES += openssl
|
||||
else
|
||||
PPPD_MAKE_OPTS += USE_CRYPT=y
|
||||
endif
|
||||
|
||||
PPPD_INSTALL_STAGING = YES
|
||||
PPPD_TARGET_BINS = chat pppd pppdump pppstats
|
||||
PPPD_RADIUS_CONF = \
|
||||
dictionary dictionary.ascend dictionary.compat \
|
||||
dictionary.merit dictionary.microsoft \
|
||||
issue port-id-map realms servers radiusclient.conf
|
||||
|
||||
ifeq ($(BR2_PACKAGE_PPPD_FILTER),y)
|
||||
PPPD_DEPENDENCIES += libpcap
|
||||
PPPD_MAKE_OPTS += FILTER=y
|
||||
endif
|
||||
|
||||
# pppd bundles some but not all of the needed kernel headers. The embedded
|
||||
# if_pppol2tp.h is unfortunately not compatible with kernel headers > 2.6.34,
|
||||
# and has been part of the kernel headers since 2.6.23, so drop it
|
||||
define PPPD_DROP_INTERNAL_IF_PPOL2TP_H
|
||||
$(RM) $(@D)/include/linux/if_pppol2tp.h
|
||||
endef
|
||||
|
||||
PPPD_POST_EXTRACT_HOOKS += PPPD_DROP_INTERNAL_IF_PPOL2TP_H
|
||||
|
||||
# pppd defaults to /etc/ppp/resolv.conf, which not be writable and is
|
||||
# definitely not useful since the C library only uses
|
||||
# /etc/resolv.conf. Therefore, we change pppd to use /etc/resolv.conf
|
||||
# instead.
|
||||
define PPPD_SET_RESOLV_CONF
|
||||
$(SED) 's,ppp/resolv.conf,resolv.conf,' $(@D)/pppd/pathnames.h
|
||||
endef
|
||||
ifeq ($(BR2_PACKAGE_PPPD_OVERWRITE_RESOLV_CONF),y)
|
||||
PPPD_POST_EXTRACT_HOOKS += PPPD_SET_RESOLV_CONF
|
||||
endif
|
||||
|
||||
define PPPD_CONFIGURE_CMDS
|
||||
$(SED) 's/FILTER=y/#FILTER=y/' $(PPPD_DIR)/pppd/Makefile.linux
|
||||
$(SED) 's/ifneq ($$(wildcard \/usr\/include\/pcap-bpf.h),)/ifdef FILTER/' $(PPPD_DIR)/*/Makefile.linux
|
||||
( cd $(@D); $(TARGET_MAKE_ENV) ./configure --prefix=/usr )
|
||||
endef
|
||||
|
||||
define PPPD_BUILD_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE) CC="$(TARGET_CC)" COPTS="$(TARGET_CFLAGS)" \
|
||||
-C $(@D) $(PPPD_MAKE_OPTS)
|
||||
endef
|
||||
|
||||
ifeq ($(BR2_PACKAGE_PPPD_RADIUS),y)
|
||||
define PPPD_INSTALL_RADIUS
|
||||
$(INSTALL) -D $(PPPD_DIR)/pppd/plugins/radius/radattr.so \
|
||||
$(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/radattr.so
|
||||
$(INSTALL) -D $(PPPD_DIR)/pppd/plugins/radius/radius.so \
|
||||
$(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/radius.so
|
||||
$(INSTALL) -D $(PPPD_DIR)/pppd/plugins/radius/radrealms.so \
|
||||
$(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/radrealms.so
|
||||
for m in $(PPPD_RADIUS_CONF); do \
|
||||
$(INSTALL) -m 644 -D $(PPPD_DIR)/pppd/plugins/radius/etc/$$m \
|
||||
$(TARGET_DIR)/etc/ppp/radius/$$m; \
|
||||
done
|
||||
$(SED) 's:/usr/local/etc:/etc:' \
|
||||
$(TARGET_DIR)/etc/ppp/radius/radiusclient.conf
|
||||
$(SED) 's:/usr/local/sbin:/usr/sbin:' \
|
||||
$(TARGET_DIR)/etc/ppp/radius/radiusclient.conf
|
||||
$(SED) 's:/etc/radiusclient:/etc/ppp/radius:g' \
|
||||
$(TARGET_DIR)/etc/ppp/radius/*
|
||||
endef
|
||||
endif
|
||||
|
||||
define PPPD_INSTALL_TARGET_CMDS
|
||||
for sbin in $(PPPD_TARGET_BINS); do \
|
||||
$(INSTALL) -D $(PPPD_DIR)/$$sbin/$$sbin \
|
||||
$(TARGET_DIR)/usr/sbin/$$sbin; \
|
||||
done
|
||||
$(INSTALL) -D $(PPPD_DIR)/pppd/plugins/minconn.so \
|
||||
$(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/minconn.so
|
||||
$(INSTALL) -D $(PPPD_DIR)/pppd/plugins/passprompt.so \
|
||||
$(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/passprompt.so
|
||||
$(INSTALL) -D $(PPPD_DIR)/pppd/plugins/passwordfd.so \
|
||||
$(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/passwordfd.so
|
||||
$(INSTALL) -D $(PPPD_DIR)/pppd/plugins/pppoatm/pppoatm.so \
|
||||
$(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/pppoatm.so
|
||||
$(INSTALL) -D $(PPPD_DIR)/pppd/plugins/rp-pppoe/rp-pppoe.so \
|
||||
$(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/rp-pppoe.so
|
||||
$(INSTALL) -D $(PPPD_DIR)/pppd/plugins/rp-pppoe/pppoe-discovery \
|
||||
$(TARGET_DIR)/usr/sbin/pppoe-discovery
|
||||
$(INSTALL) -D $(PPPD_DIR)/pppd/plugins/winbind.so \
|
||||
$(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/winbind.so
|
||||
$(INSTALL) -D $(PPPD_DIR)/pppd/plugins/pppol2tp/openl2tp.so \
|
||||
$(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/openl2tp.so
|
||||
$(INSTALL) -D $(PPPD_DIR)/pppd/plugins/pppol2tp/pppol2tp.so \
|
||||
$(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/pppol2tp.so
|
||||
$(INSTALL) -D -m 0755 $(PPPD_DIR)/scripts/pon $(TARGET_DIR)/usr/bin/pon
|
||||
$(INSTALL) -D -m 0755 $(PPPD_DIR)/scripts/poff $(TARGET_DIR)/usr/bin/poff
|
||||
$(PPPD_INSTALL_RADIUS)
|
||||
endef
|
||||
|
||||
define PPPD_INSTALL_STAGING_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE) INSTROOT=$(STAGING_DIR)/ -C $(@D) $(PPPD_MAKE_OPTS) install-devel
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
Reference in New Issue
Block a user