From patchwork Wed Dec 2 06:28:02 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prasanth R X-Patchwork-Id: 106919 Received: from mail-dy1-f176.google.com (mail-dy1-f176.google.com [74.125.82.176]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.30475.1796192894000509640 for ; Tue, 01 Dec 2026 22:28:14 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=fB5HkA/8; spf=pass (domain: gmail.com, ip: 74.125.82.176, mailfrom: ragaprasanth@gmail.com) Received: by mail-dy1-f176.google.com with SMTP id 5a478bee46e88-3863db981d4so17431002eec.0 for ; Tue, 01 Dec 2026 22:28:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796192893; x=1796797693; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=d/aMfF602ERLBKawTtvtyhbPG1Fb4/qpTciBPXVZYYY=; b=fB5HkA/8wh4H4fa0btugy7vgYeECU7MBkVjSJRt2gt/idZ0zlYSaYsW3IRpbHTjCd7 6CPXYtAxczMno6aJIzZVAtzpXSMCLbsCTGRNts0Vp/s5HcLvjsdhTi7GPijObFFlmtyk Pn1GZ6UUhj1AiLenD3RzLlFoFzI8KuwzUhFZO2eW0XXBcTIMEUuiY+ZLy9n1R9jZoHTE FCWe1TnBq/8WBdyObj1I5Yu43Bolvbv/WuNYtbaModdP9gKjaOG4JUveMiQZI5sjoj1J wFVGtxGOvky125ofkB2Z2n3ja8NdLarwJRw6Lz15cavuuO83wu0lQQmwt/GMutstuq7q +k9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796192893; x=1796797693; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:c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cYxcNTqb+W9 MVNVCyoQPh0Y3bmJg9G4RQagZFYwZJXd/Tr0A37qbiLasYD+jneAHImvWpbTOwN0jX/EyIGB67M 9lZa8fssD59ck42kg5vNK/sWGuCcbGuBLDZIXxUR/6XhCw9jCGmYwwUyynARJ4An X-Received: by 2002:a05:7300:cf8f:b0:386:a728:6c12 with SMTP id 5a478bee46e88-386a72873femr29410716eec.8.1796192892987; Tue, 01 Dec 2026 22:28:12 -0800 (PST) Return-Path: Received: from prasanth.alps.lineo.co.jp (vpn1.lineo.co.jp. [203.141.200.204]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-386d605c894sm55544405eec.2.2026.12.01.22.28.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 22:28:12 -0800 (PST) From: Prasanth R To: openembedded-core@lists.openembedded.org Cc: Fabio Estevam , Prasanth R Subject: [PATCH 1/2] u-boot: fix CVE-2026-29007 and CVE-2026-29008 Date: Wed, 2 Dec 2026 15:28:02 +0900 Message-Id: <20261202062803.3544411-1-ragaprasanth@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Wed, 02 Dec 2026 06:28:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251779 Backport my fixes for the legacy TCP stack from U-Boot main. AI-Generated: Uses Claude Signed-off-by: Prasanth R --- .../u-boot/files/CVE-2026-29007.patch | 94 +++++++++++++++++++ .../u-boot/files/CVE-2026-29007_29008.patch | 66 +++++++++++++ meta/recipes-bsp/u-boot/u-boot_2026.10.bb | 4 + 3 files changed, 164 insertions(+) create mode 100644 meta/recipes-bsp/u-boot/files/CVE-2026-29007.patch create mode 100644 meta/recipes-bsp/u-boot/files/CVE-2026-29007_29008.patch diff --git a/meta/recipes-bsp/u-boot/files/CVE-2026-29007.patch b/meta/recipes-bsp/u-boot/files/CVE-2026-29007.patch new file mode 100644 index 0000000000..b58c300dd8 --- /dev/null +++ b/meta/recipes-bsp/u-boot/files/CVE-2026-29007.patch @@ -0,0 +1,94 @@ +From cf248526dbd1da6622b58483c307cb837fb76165 Mon Sep 17 00:00:00 2001 +From: Prasanth R +Date: Tue, 17 Nov 2026 17:56:45 +0900 +Subject: [PATCH] net: tcp: check option lengths in tcp_parse_options() + +tcp_parse_options() reads the length byte of an option without checking +that it is inside the option area, and reads the window scale and +timestamp values without checking the option length. A truncated or +malformed option makes it read past the end of the options. + +Check that each option and its length byte fit in the remaining +options, and only use the window scale and timestamp when the option +has the expected size. Limit the window scale to 14 as RFC 7323 says, +so the window shift in tcp_rx_state_machine() stays defined. + +Fixes: a3bf193bf4ea ("net: Add TCP protocol") + +CVE: CVE-2026-29007 +Upstream-Status: Backport [https://git.u-boot-project.org/u-boot/u-boot/-/commit/cf248526dbd1da6622b58483c307cb837fb76165] + +Signed-off-by: Prasanth R +--- + net/tcp.c | 42 +++++++++++++++++++++++------------------- + 1 file changed, 23 insertions(+), 19 deletions(-) + +diff --git a/net/tcp.c b/net/tcp.c +index 737a079ec5..cde3319bc4 100644 +--- a/net/tcp.c ++++ b/net/tcp.c +@@ -776,38 +776,42 @@ void tcp_parse_options(struct tcp_stream *tcp, uchar *o, int o_len) + { + struct tcp_t_opt *tsopt; + struct tcp_scale *wsopt; ++ uchar *end = o + o_len; + uchar *p = o; ++ u8 len; + +- /* +- * NOPs are options with a zero length, and thus are special. +- * All other options have length fields. +- */ +- for (p = o; p < (o + o_len); ) { +- if (!p[1]) +- return; /* Finished processing options */ ++ while (p < end) { ++ if (p[0] == TCP_O_END) ++ return; ++ if (p[0] == TCP_1_NOP) { ++ p++; ++ continue; ++ } + +- switch (p[0]) { +- case TCP_O_END: ++ /* All other options have a length byte covering kind and len */ ++ if (end - p < TCP_OPT_LEN_2) + return; +- case TCP_O_MSS: +- case TCP_P_SACK: +- case TCP_V_SACK: +- break; ++ len = p[1]; ++ if (len < TCP_OPT_LEN_2 || len > end - p) ++ return; ++ ++ switch (p[0]) { + case TCP_O_SCL: ++ if (len != TCP_OPT_LEN_3) ++ break; + wsopt = (struct tcp_scale *)p; +- tcp->rmt_win_scale = wsopt->scale; ++ /* RFC 7323: a shift count above 14 is treated as 14 */ ++ tcp->rmt_win_scale = wsopt->scale > 14 ? 14 : wsopt->scale; + break; + case TCP_O_TS: ++ if (len != TCP_OPT_LEN_A) ++ break; + tsopt = (struct tcp_t_opt *)p; + tcp->rmt_timestamp = tsopt->t_snd; + break; + } + +- /* Process optional NOPs */ +- if (p[0] == TCP_1_NOP) +- p++; +- else +- p += p[1]; ++ p += len; + } + } + +-- +2.43.0 + diff --git a/meta/recipes-bsp/u-boot/files/CVE-2026-29007_29008.patch b/meta/recipes-bsp/u-boot/files/CVE-2026-29007_29008.patch new file mode 100644 index 0000000000..90ad049c27 --- /dev/null +++ b/meta/recipes-bsp/u-boot/files/CVE-2026-29007_29008.patch @@ -0,0 +1,66 @@ +From a0e2935a4bdeb982e48a8f13fa257bbfc6d8e657 Mon Sep 17 00:00:00 2001 +From: Prasanth R +Date: Tue, 17 Nov 2026 17:56:44 +0900 +Subject: [PATCH] net: tcp: drop segments with an invalid data offset + +rxhand_tcp_f() trusts the data offset of a received segment. +tcp_rx_state_machine() then passes tcp_hdr_len - TCP_HDR_SIZE bytes of +options to tcp_parse_options() and computes payload_len as +tcp_len - tcp_hdr_len, without checking that the header fits in the +segment. + +A data offset larger than the segment makes tcp_parse_options() read +past the end of the packet (CVE-2026-29007) and makes payload_len +negative. In TCP_SYN_SENT the negative length reaches +tcp_rx_user_data() and the receive handler, where it wraps to a huge +memcpy() size (CVE-2026-29008). + +Drop segments that are shorter than a TCP header, or whose data offset +is below the header size or beyond the segment. Also ignore the +reserved bits when reading the data offset. + +Fixes: a3bf193bf4ea ("net: Add TCP protocol") + +CVE: CVE-2026-29007 CVE-2026-29008 +Upstream-Status: Backport [https://git.u-boot-project.org/u-boot/u-boot/-/commit/a0e2935a4bdeb982e48a8f13fa257bbfc6d8e657] + +Signed-off-by: Prasanth R +--- + net/tcp.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/net/tcp.c b/net/tcp.c +index 8740150365..737a079ec5 100644 +--- a/net/tcp.c ++++ b/net/tcp.c +@@ -58,7 +58,7 @@ static int (*tcp_stream_on_create)(struct tcp_stream *tcp); + #define ROUND_TCPHDR_LEN(x) (LEN_B_TO_DW((x) + 3)) + #define ROUND_TCPHDR_BYTES(x) (((x) + 3) & ~3) + #define SHIFT_TO_TCPHDRLEN_FIELD(x) ((x) << 4) +-#define GET_TCP_HDR_LEN_IN_BYTES(x) ((x) >> 2) ++#define GET_TCP_HDR_LEN_IN_BYTES(x) (((x) & 0xf0) >> 2) + + #define RANDOM_PORT_START 1024 + #define RANDOM_PORT_RANGE 0x4000 +@@ -1162,6 +1162,18 @@ void rxhand_tcp_f(union tcp_build_pkt *b, unsigned int pkt_len) + u16 tcp_rx_xsum = b->ip.hdr.ip_sum; + struct tcp_stream *tcp; + struct in_addr src; ++ int tcp_hdr_len; ++ ++ /* ++ * The data offset must cover the fixed TCP header and must not point ++ * past the end of the segment. Otherwise the options parser reads ++ * beyond the packet and the payload length becomes negative. ++ */ ++ if (tcp_len < (int)TCP_HDR_SIZE) ++ return; ++ tcp_hdr_len = GET_TCP_HDR_LEN_IN_BYTES(b->ip.hdr.tcp_hlen); ++ if (tcp_hdr_len < (int)TCP_HDR_SIZE || tcp_hdr_len > tcp_len) ++ return; + + /* Verify IP header */ + debug_cond(DEBUG_DEV_PKT, +-- +2.43.0 + diff --git a/meta/recipes-bsp/u-boot/u-boot_2026.10.bb b/meta/recipes-bsp/u-boot/u-boot_2026.10.bb index eed5127004..5132a81b9b 100644 --- a/meta/recipes-bsp/u-boot/u-boot_2026.10.bb +++ b/meta/recipes-bsp/u-boot/u-boot_2026.10.bb @@ -3,6 +3,10 @@ require u-boot.inc DEPENDS += "bc-native dtc-native gnutls-native python3-pyelftools-native" +SRC_URI += "file://CVE-2026-29007_29008.patch \ + file://CVE-2026-29007.patch \ +" + # workarounds for aarch64 kvm qemu boot regressions SRC_URI:append:qemuarm64 = " file://disable-CONFIG_BLOBLIST.cfg" SRC_URI:append:genericarm64 = " file://disable-CONFIG_BLOBLIST.cfg" From patchwork Wed Dec 2 06:28:03 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prasanth R X-Patchwork-Id: 106920 Received: from mail-dy1-f181.google.com (mail-dy1-f181.google.com [74.125.82.181]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.30476.1796192898622869378 for ; Tue, 01 Dec 2026 22:28:18 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=YsXcjXCV; spf=pass (domain: gmail.com, ip: 74.125.82.181, mailfrom: ragaprasanth@gmail.com) Received: by mail-dy1-f181.google.com with SMTP id 5a478bee46e88-38692f62b22so2089991eec.0 for ; Tue, 01 Dec 2026 22:28:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796192894; x=1796797694; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Ea8/c1fFTyv+SYbYH1JL3Qv58AM/zstwWFBQB1Vlgu0=; b=YsXcjXCV9LQSP5QR/0RlJZFAVViG52bRcTEI17GftEKQrz3IoTlN0SW+GvdsLdN/AG 7UnIkzRZmR036UeTJaBmrbwM+hHPREjZNrxG9dgw5U3VE5Pc1nZK4X7xqk2YXSsK1JxT GUlmmps7n/QSuNz7BlAPk/mmUbUYo62paYtEOv+FHImqyRKmpeOR/MXciMNgTY+hUET4 0bXH/xdKY/aD86TjjIsJaT7np+RRmkSbtkDxUjSUWYYFy4LXMIivcmHNcQkfMFfGAo0A aOyXbuQmpLPSPzs1fsNsCmy91/7Ff3ZhOFfj1fYuc+hPw16nF2P4ZSgMkfC0DS9BzFhl H7lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796192894; x=1796797694; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=Ea8/c1fFTyv+SYbYH1JL3Qv58AM/zstwWFBQB1Vlgu0=; b=gHZ9xBzMxtepJ94445P5y7b9RjL5jjH129+coyprXDAfBaIouQrIy6FJaHPN56+xEr a2oaJ0TydJXIVodZEnn6TdA40K2xvVsn0aYQ4Gkb2CLkd0kPpyRl4cVSh9Zbgdoz6MYX RXlDrdOhkNEEnMk5+gK5iNDTCcQSlSQHCi7+PEj3h4p05bMfyxCPy6QHt9Ui7kHRG2Hs DDd3Tn6DYJvQ6BdBZtZ1UeWHjUjkl5qt2NcVnjKYdxAk91Kn9MD1TYOy/C1EWfhXMsUP Vhz3hk69f09QjBeR+dE/6Tg0JGIEwtluxOnem78+0acM7+i3gDN3tMB/7JUGMgwqZQLs PeHQ== X-Gm-Message-State: APuU4Z9pK8r3zdGDBEuDBg/eadUcwNgnVQfgD8xFmmnszpwMQsoTbipo ZDOUABVuiW592Wr6hPK5s9YzHUzFYrQ8GZTPpeOeVxgSPUp9JImHAo1L+22ngA== X-Gm-Gg: AZFdTZciRAQrfQn1KUJt2LUj1W604ReKSCaz1VPNvonEGPdrdozz/WlQB068I+QcTtw O+Aj+kMXMtZnyN1/LVERjX7+zStGQ/FTu/Fr0R9ylW0e884PltkWk+iqYg6kz/S6uDcLbMME2sh gKzRXJDwOk9Vr4JGach+aBkwd9WPF2edr7v0orydIBqE5jUBGikaX3pF8VLU1skQGzvrcRVVOU5 TmrGYTPc+BbC1J4xEeHp9+geYDfjzEQ//oDtsBtqad++bXJLKwW2kLofkOsGZerP73fz2tYu85R jt3fzy2rn7SlhvGglf3yMiy3XqqyKG76OhWsZ0qV/dLhfkcVG4pYSkH9zMiHej6TxAT44zfYRc9 Hhb9W0XOA5nlwcOqRO8gR6Ke4VKRDWZR2o2Qnzmsh7Auy8LoIg213AtytRAj3oeDbnu2uvSnBFv uP9F1uMLpFgitZmfrHFpz/cEZ4sSxJuJoCardeY6TtOdB+fbYM4SWktRdaBzNdhEbHSj0js9v67 Oq6YjMAsFQJQ9e8EGmStvjdcU1A8IRx9TCHhfajunqWA+RNNbi7YiQVpGcU8WuGryxPvj2vXbqY SenHcvjp4l8MirplqVZvc50SSuiKwQzOAGgouv72sa/WgozKfuGPNbcRqO2sILLv X-Received: by 2002:a05:7301:4606:b0:380:d1bd:ed2c with SMTP id 5a478bee46e88-3856f54aecbmr39720471eec.27.1796192894227; Tue, 01 Dec 2026 22:28:14 -0800 (PST) Return-Path: Received: from prasanth.alps.lineo.co.jp (vpn1.lineo.co.jp. [203.141.200.204]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-386d605c894sm55544405eec.2.2026.12.01.22.28.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 22:28:13 -0800 (PST) From: Prasanth R To: openembedded-core@lists.openembedded.org Cc: Fabio Estevam , Prasanth R Subject: [PATCH 2/2] u-boot-tools: ignore CVE-2026-29007 and CVE-2026-29008 Date: Wed, 2 Dec 2026 15:28:03 +0900 Message-Id: <20261202062803.3544411-2-ragaprasanth@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20261202062803.3544411-1-ragaprasanth@gmail.com> References: <20261202062803.3544411-1-ragaprasanth@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Wed, 02 Dec 2026 06:28:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251780 tools-only_defconfig disables networking, so net/tcp.c is not built into u-boot-tools. Same status as on wrynose. AI-Generated: Uses Claude Signed-off-by: Prasanth R --- meta/recipes-bsp/u-boot/u-boot-tools_2026.10.bb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta/recipes-bsp/u-boot/u-boot-tools_2026.10.bb b/meta/recipes-bsp/u-boot/u-boot-tools_2026.10.bb index 9e7a178310..676d5b49f8 100644 --- a/meta/recipes-bsp/u-boot/u-boot-tools_2026.10.bb +++ b/meta/recipes-bsp/u-boot/u-boot-tools_2026.10.bb @@ -2,3 +2,6 @@ require u-boot-common.inc require u-boot-tools.inc SRC_URI += "file://0001-tools-mkeficapsule-Detect-GnuTLS-PKCS-11-support.patch" + +CVE_STATUS[CVE-2026-29007] = "not-applicable-config: tools-only_defconfig disables networking; net/tcp.c is not compiled into u-boot-tools." +CVE_STATUS[CVE-2026-29008] = "not-applicable-config: tools-only_defconfig disables networking; net/tcp.c is not compiled into u-boot-tools."