Skip to content

Commit

Permalink
Merge latest upstream
Browse files Browse the repository at this point in the history
Signed-off-by: Can Wong <[email protected]>
  • Loading branch information
usercw88 committed Oct 22, 2024
2 parents 6d85db2 + 2e3126c commit e2d7eee
Show file tree
Hide file tree
Showing 69 changed files with 1,176 additions and 293 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"

GNOMEBASEBUILDCLASS = "meson"

inherit gnomebase gettext gsettings features_check
inherit gnomebase gettext gsettings features_check useradd

REQUIRED_DISTRO_FEATURES = "opengl"
REQUIRED_DISTRO_FEATURES = "opengl polkit"

SRC_URI[archive.sha256sum] = "7c62a4281fdfa9522110affbf75d09973035f2adc7fa4577511d733186beb68f"
SRC_URI[archive.sha256sum] = "97443eaffe4b1a69626886a41d25cbeb2c148d3fed43d92115c1b7d20d5238ab"

DEPENDS = " \
asciidoc-native \
Expand Down Expand Up @@ -36,5 +36,15 @@ PACKAGECONFIG[vnc] = "-Dvnc=true,-Dvnc=false,libvncserver"
PACKAGECONFIG[rdp] = "-Drdp=true,-Drdp=false,freerdp3 fuse3 libxkbcommon"
PACKAGECONFIG[systemd] = "-Dsystemd=true,-Dsystemd=false,systemd"

USERADD_PACKAGES = "${PN}"
USERADD_PARAM:${PN} = "--system --no-create-home --user-group --home-dir ${sysconfdir}/polkit-1 polkitd"

do_install:append() {
if [ -d ${D}${datadir}/polkit-1/rules.d ]; then
chmod 700 ${D}${datadir}/polkit-1/rules.d
chown polkitd:root ${D}${datadir}/polkit-1/rules.d
fi
}

PACKAGE_DEBUG_SPLIT_STYLE = "debug-without-src"
FILES:${PN} += "${systemd_user_unitdir} ${systemd_system_unitdir} ${datadir} ${libdir}/sysusers.d ${libdir}/tmpfiles.d"
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=379d5819937a6c2f1ef1630d341e026d"
SECTION = "libs"

S = "${WORKDIR}/git"
SRCREV = "5a764e5555c64337ed17444410269ff21cb617b1"
SRCREV = "5e146adef63b326b04282252639bebc2730939c6"
SRC_URI = "git://github.com/Mbed-TLS/mbedtls.git;protocol=https;branch=mbedtls-2.28 \
file://run-ptest \
"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=379d5819937a6c2f1ef1630d341e026d"
SECTION = "libs"

S = "${WORKDIR}/git"
SRC_URI = "git://github.com/Mbed-TLS/mbedtls.git;protocol=https;branch=master \
SRC_URI = "git://github.com/Mbed-TLS/mbedtls.git;protocol=https;branch=mbedtls-3.6 \
git://github.com/Mbed-TLS/mbedtls-framework.git;protocol=https;branch=main;destsuffix=git/framework;name=framework \
file://run-ptest"

SRCREV = "2ca6c285a0dd3f33982dd57299012dacab1ff206"
SRCREV_framework = "750634d3a51eb9d61b59fd5d801546927c946588"
SRCREV = "71c569d44bf3a8bd53d874c81ee8ac644dd6e9e3"
SRCREV_framework = "94599c0e3b5036e086446a51a3f79640f70f22f6"
SRCREV_FORMAT .= "_framework"

UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"
Expand Down Expand Up @@ -76,7 +76,8 @@ sysroot_stage_all:append() {

do_install_ptest () {
install -d ${D}${PTEST_PATH}/tests
install -d ${D}${PTEST_PATH}/framework
cp -f ${B}/tests/test_suite_* ${D}${PTEST_PATH}/tests/
find ${D}${PTEST_PATH}/tests/ -type f -name "*.c" -delete
cp -fR ${S}/tests/data_files ${D}${PTEST_PATH}/tests/
cp -fR ${S}/framework/data_files ${D}${PTEST_PATH}/framework/
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ SRC_URI:append:libc-musl = " \
file://samba-4.3.9-remove-getpwent_r.patch \
"

SRC_URI[sha256sum] = "653b52095554dbc223c63b96af5cdf9e98c3e048549c5f56143d3b33dce1cef1"
SRC_URI[sha256sum] = "1aeff76c207f383477ce4badebd154691c408d2e15b01b333c85eb775468ddf6"

UPSTREAM_CHECK_REGEX = "samba\-(?P<pver>4\.19(\.\d+)+).tar.gz"

Expand Down
71 changes: 71 additions & 0 deletions meta-networking/recipes-extended/tgt/files/CVE-2024-45751.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
From abd8e0d987ab56013d360077202bf2aca20a42dd Mon Sep 17 00:00:00 2001
From: Richard Weinberger <[email protected]>
Date: Tue, 3 Sep 2024 16:14:58 +0200
Subject: [PATCH] chap: Use proper entropy source

The challenge sent to the initiator is based on a poor
source of randomness, it uses rand() without seeding it by srand().
So the glibc PRNG is always seeded with 1 and as a consequence the
sequence of challenges is always the same.

An attacker which is able to monitor network traffic can apply a replay
attack to bypass the CHAP authentication. All the attacker has to do
is waiting for the server or the service to restart and replay with a
previously record CHAP session which fits into the sequence.

To overcome the issue, use getrandom() to query the kernel random
number generator.
Also always send a challenge of length CHAP_CHALLENGE_MAX, there is no
benefit in sending a variable length challenge.

Signed-off-by: Richard Weinberger <[email protected]>

Upstream-Status: Backport [https://github.com/fujita/tgt/commit/abd8e0d987ab56013d360077202bf2aca20a42dd]
CVE: CVE-2024-45751
Signed-off-by: Hitendra Prajapati <[email protected]>
---
usr/iscsi/chap.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/usr/iscsi/chap.c b/usr/iscsi/chap.c
index aa0fc67..b89ecab 100644
--- a/usr/iscsi/chap.c
+++ b/usr/iscsi/chap.c
@@ -28,6 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/random.h>

#include "iscsid.h"
#include "tgtd.h"
@@ -359,22 +360,19 @@ static int chap_initiator_auth_create_challenge(struct iscsi_connection *conn)
sprintf(text, "%u", (unsigned char)conn->auth.chap.id);
text_key_add(conn, "CHAP_I", text);

- /*
- * FIXME: does a random challenge length provide any benefits security-
- * wise, or should we rather always use the max. allowed length of
- * 1024 for the (unencoded) challenge?
- */
- conn->auth.chap.challenge_size = (rand() % (CHAP_CHALLENGE_MAX / 2)) + CHAP_CHALLENGE_MAX / 2;
+ conn->auth.chap.challenge_size = CHAP_CHALLENGE_MAX;

conn->auth.chap.challenge = malloc(conn->auth.chap.challenge_size);
if (!conn->auth.chap.challenge)
return CHAP_TARGET_ERROR;

+ if (getrandom(conn->auth.chap.challenge, conn->auth.chap.challenge_size, 0) != conn->auth.chap.challenge_size)
+ return CHAP_TARGET_ERROR;
+
p = text;
strcpy(p, "0x");
p += 2;
for (i = 0; i < conn->auth.chap.challenge_size; i++) {
- conn->auth.chap.challenge[i] = rand();
sprintf(p, "%.2hhx", conn->auth.chap.challenge[i]);
p += 2;
}
--
2.25.1

1 change: 1 addition & 0 deletions meta-networking/recipes-extended/tgt/tgt_1.0.90.bb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ SRC_URI = "git://github.com/fujita/tgt.git;branch=master;protocol=https \
file://0001-usr-Makefile-WARNING-fix.patch \
file://usr-Makefile-apply-LDFLAGS-to-all-executables.patch \
file://musl-__wordsize.patch \
file://CVE-2024-45751.patch \
"
SRC_URI += "file://tgtd.init \
file://tgtd.service \
Expand Down
9 changes: 6 additions & 3 deletions meta-networking/recipes-filter/nftables/nftables_1.0.9.bb
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ EXTRA_OECONF = " \

SETUPTOOLS_SETUP_PATH = "${S}/py"

inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'setuptools3', '', d)}
inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'python', 'setuptools3', '', d)}

PACKAGES =+ "${PN}-python"
PACKAGES =+ "${@bb.utils.contains('PACKAGECONFIG', 'python', '${PN}-python', '', d)}"
FILES:${PN}-python = "${PYTHON_SITEPACKAGES_DIR}"
RDEPENDS:${PN}-python = "python3-core python3-json ${PN}"

Expand All @@ -64,7 +64,10 @@ do_install() {
fi
}

RDEPENDS:${PN}-ptest += " ${PN}-python bash coreutils make iproute2 iputils-ping procps python3-core python3-ctypes python3-json python3-misc sed util-linux"
RDEPENDS:${PN}-ptest += " \
bash coreutils make iproute2 iputils-ping procps python3-core python3-ctypes python3-json python3-misc sed util-linux \
${@bb.utils.contains('PACKAGECONFIG', 'python', '${PN}-python', '', d)} \
"

RRECOMMENDS:${PN}-ptest += "\
kernel-module-nft-chain-nat kernel-module-nft-queue \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ LIC_FILES_CHKSUM = "file://pyldb.h;endline=24;md5=dfbd238cecad76957f7f860fbe9ada
file://man/ldb.3.xml;beginline=261;endline=262;md5=137f9fd61040c1505d1aa1019663fd08 \
file://tools/ldbdump.c;endline=19;md5=a7d4fc5d1f75676b49df491575a86a42"

SRC_URI[sha256sum] = "358dca10fcd27207ac857a0d7f435a46dbc6cd1f7c10dbb840c1931bf1965f08"
SRC_URI[sha256sum] = "b68ce6eb0ccd2870fa3c8c334f2028b5d16606fd41308696c17b71959f7bf59f"

inherit pkgconfig waf-samba ptest

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ SRC_URI = "https://1.eu.dl.wireshark.org/src/wireshark-${PV}.tar.xz \

UPSTREAM_CHECK_URI = "https://1.as.dl.wireshark.org/src"

SRC_URI[sha256sum] = "55e793ab87a9a73aac44336235c92cb76c52180c469b362ed3a54f26fbb1261f"
SRC_URI[sha256sum] = "2c5de08e19081bd666a2ce3f052c023274d06acaabc5d667a3c3051a9c618f86"

PE = "1"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Unit]
Description=Android Debug Bridge
ConditionPathExists=/var/usb-debugging-enabled
ConditionPathExists=/etc/usb-debugging-enabled
Before=android-system.service

[Service]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ FILES:${PN} += "${libdir}/android ${libdir}/android/*"
BBCLASSEXTEND = "native"

android_tools_enable_devmode() {
touch ${IMAGE_ROOTFS}/var/usb-debugging-enabled
touch ${IMAGE_ROOTFS}/etc/usb-debugging-enabled
}

ROOTFS_POSTPROCESS_COMMAND_${PN}-adbd += "${@bb.utils.contains("USB_DEBUGGING_ENABLED", "1", "android_tools_enable_devmode;", "", d)}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
From 364c2da8741f0979dae497551e70b94c0e6c8636 Mon Sep 17 00:00:00 2001
From: Jouni Malinen <[email protected]>
Date: Sun, 7 Jul 2024 11:46:49 +0300
Subject: [PATCH 1/3] SAE: Check for invalid Rejected Groups element length
explicitly

Instead of practically ignoring an odd octet at the end of the element,
check for such invalid case explicitly. This is needed to avoid a
potential group downgrade attack.

Signed-off-by: Jouni Malinen <[email protected]>

CVE: CVE-2024-3596
Upstream-Status: Backport [https://w1.fi/cgit/hostap/commit/?id=364c2da8741f0979dae497551e70b94c0e6c8636]
Signed-off-by: Peter Marko <[email protected]>
---
src/ap/ieee802_11.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index db4104928..1a62e30cc 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -1258,7 +1258,7 @@ static int check_sae_rejected_groups(struct hostapd_data *hapd,
struct sae_data *sae)
{
const struct wpabuf *groups;
- size_t i, count;
+ size_t i, count, len;
const u8 *pos;

if (!sae->tmp)
@@ -1268,7 +1268,15 @@ static int check_sae_rejected_groups(struct hostapd_data *hapd,
return 0;

pos = wpabuf_head(groups);
- count = wpabuf_len(groups) / 2;
+ len = wpabuf_len(groups);
+ if (len & 1) {
+ wpa_printf(MSG_DEBUG,
+ "SAE: Invalid length of the Rejected Groups element payload: %zu",
+ len);
+ return 1;
+ }
+
+ count = len / 2;
for (i = 0; i < count; i++) {
int enabled;
u16 group;
--
2.30.2

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
From 9716bf1160beb677e965d9e6475d6c9e162e8374 Mon Sep 17 00:00:00 2001
From: Jouni Malinen <[email protected]>
Date: Tue, 9 Jul 2024 23:34:34 +0300
Subject: [PATCH 3/3] SAE: Reject invalid Rejected Groups element in the parser

There is no need to depend on all uses (i.e., both hostapd and
wpa_supplicant) to verify that the length of the Rejected Groups field
in the Rejected Groups element is valid (i.e., a multiple of two octets)
since the common parser can reject the message when detecting this.

Signed-off-by: Jouni Malinen <[email protected]>

Upstream-Status: Backport [https://w1.fi/cgit/hostap/commit/?id=9716bf1160beb677e965d9e6475d6c9e162e8374]
Signed-off-by: Peter Marko <[email protected]>
---
src/common/sae.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/src/common/sae.c b/src/common/sae.c
index c0f154e91..620bdf753 100644
--- a/src/common/sae.c
+++ b/src/common/sae.c
@@ -2076,6 +2076,12 @@ static int sae_parse_rejected_groups(struct sae_data *sae,
return WLAN_STATUS_UNSPECIFIED_FAILURE;
epos++; /* skip ext ID */
len--;
+ if (len & 1) {
+ wpa_printf(MSG_DEBUG,
+ "SAE: Invalid length of the Rejected Groups element payload: %u",
+ len);
+ return WLAN_STATUS_UNSPECIFIED_FAILURE;
+ }

wpabuf_free(sae->tmp->peer_rejected_groups);
sae->tmp->peer_rejected_groups = wpabuf_alloc(len);
--
2.30.2

Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
From 945acf3ef06a6c312927da4fa055693dbac432d1 Mon Sep 17 00:00:00 2001
From: Jouni Malinen <[email protected]>
Date: Sat, 2 Apr 2022 16:28:12 +0300
Subject: [PATCH 1/9] ieee802_11_auth: Coding style cleanup - no string
constant splitting

Signed-off-by: Jouni Malinen <[email protected]>

Upstream-Status: Backport [https://w1.fi/cgit/hostap/commit/?id=945acf3ef06a6c312927da4fa055693dbac432d1]
Signed-off-by: Peter Marko <[email protected]>
---
src/ap/ieee802_11_auth.c | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/src/ap/ieee802_11_auth.c b/src/ap/ieee802_11_auth.c
index 783ee6dea..47cc625be 100644
--- a/src/ap/ieee802_11_auth.c
+++ b/src/ap/ieee802_11_auth.c
@@ -267,16 +267,16 @@ int hostapd_allowed_address(struct hostapd_data *hapd, const u8 *addr,
os_get_reltime(&query->timestamp);
os_memcpy(query->addr, addr, ETH_ALEN);
if (hostapd_radius_acl_query(hapd, addr, query)) {
- wpa_printf(MSG_DEBUG, "Failed to send Access-Request "
- "for ACL query.");
+ wpa_printf(MSG_DEBUG,
+ "Failed to send Access-Request for ACL query.");
hostapd_acl_query_free(query);
return HOSTAPD_ACL_REJECT;
}

query->auth_msg = os_memdup(msg, len);
if (query->auth_msg == NULL) {
- wpa_printf(MSG_ERROR, "Failed to allocate memory for "
- "auth frame.");
+ wpa_printf(MSG_ERROR,
+ "Failed to allocate memory for auth frame.");
hostapd_acl_query_free(query);
return HOSTAPD_ACL_REJECT;
}
@@ -467,19 +467,21 @@ hostapd_acl_recv_radius(struct radius_msg *msg, struct radius_msg *req,
if (query == NULL)
return RADIUS_RX_UNKNOWN;

- wpa_printf(MSG_DEBUG, "Found matching Access-Request for RADIUS "
- "message (id=%d)", query->radius_id);
+ wpa_printf(MSG_DEBUG,
+ "Found matching Access-Request for RADIUS message (id=%d)",
+ query->radius_id);

if (radius_msg_verify(msg, shared_secret, shared_secret_len, req, 0)) {
- wpa_printf(MSG_INFO, "Incoming RADIUS packet did not have "
- "correct authenticator - dropped\n");
+ wpa_printf(MSG_INFO,
+ "Incoming RADIUS packet did not have correct authenticator - dropped");
return RADIUS_RX_INVALID_AUTHENTICATOR;
}

if (hdr->code != RADIUS_CODE_ACCESS_ACCEPT &&
hdr->code != RADIUS_CODE_ACCESS_REJECT) {
- wpa_printf(MSG_DEBUG, "Unknown RADIUS message code %d to ACL "
- "query", hdr->code);
+ wpa_printf(MSG_DEBUG,
+ "Unknown RADIUS message code %d to ACL query",
+ hdr->code);
return RADIUS_RX_UNKNOWN;
}

@@ -506,8 +508,9 @@ hostapd_acl_recv_radius(struct radius_msg *msg, struct radius_msg *req,
msg, RADIUS_ATTR_ACCT_INTERIM_INTERVAL,
&info->acct_interim_interval) == 0 &&
info->acct_interim_interval < 60) {
- wpa_printf(MSG_DEBUG, "Ignored too small "
- "Acct-Interim-Interval %d for STA " MACSTR,
+ wpa_printf(MSG_DEBUG,
+ "Ignored too small Acct-Interim-Interval %d for STA "
+ MACSTR,
info->acct_interim_interval,
MAC2STR(query->addr));
info->acct_interim_interval = 0;
--
2.30.2

Loading

0 comments on commit e2d7eee

Please sign in to comment.