From patchwork Sat Aug 23 20:04:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 69068 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A626CA0EFA for ; Sat, 23 Aug 2025 20:04:16 +0000 (UTC) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by mx.groups.io with SMTP id smtpd.web10.3943.1755979449156009992 for ; Sat, 23 Aug 2025 13:04:09 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=I0onOu75; spf=pass (domain: gmail.com, ip: 209.85.214.175, mailfrom: raj.khem@gmail.com) Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-246181827e9so22746705ad.3 for ; Sat, 23 Aug 2025 13:04:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755979448; x=1756584248; 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; bh=dnBF/fRH7SxSiJY2h5GzPHXiYdV7h0yq4j+g/J/0xNc=; b=I0onOu753IZ1Osbwmd1L1uc8KdOX5amauFqfhjBhzYUuIebDs0qj5wSX7/AHX1QblP 9uLWIq1cBvlBDR+gkE0Z484Fp6vwg0FDnSAsUhDWQ4N/NV33lb1WB3Qv5hzDSlPGykEI AVGkvhIFFXYAwHqjuxs0MSMzFzuULlMSoI5pwZbfgdxIhLig2DrxISYEmF+XOMPxNjyB CwCN1XV7w/GQcN7lbI0/L8KoN5vpqTy/jW+QU3A78qbLMP3XxnXsglzVkkAevhGn+znB T0+JjLKOrqCEKfo5NXjs8pAMRmc6oC6nLVhu3kT8v3a9ru9S4dmhRz/Bo99fJJoeSaKs M5lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755979448; x=1756584248; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dnBF/fRH7SxSiJY2h5GzPHXiYdV7h0yq4j+g/J/0xNc=; b=F96geHcQ9dbvpXTUV2ZTQoo/4/AMyZPqOFhkFR618HwwE/Djyz4B3S9Mrwth1nYxSD un7fXWxgNy/+yp6auqgs/Tt6kzFSxNu5PnD/PeuQylNiDvnBs0Wi+AzMo5BXRPSdcq7a HUehrLRo7Xv1kou2dLnZKt0Rsy/NoJbYhHo1n1gtubXSNpkvdfALCfw9MZ+osMpTWrZG f8k/9MqiF9qSP4XPtJWMo9/OOP180cOzwugNU3/6hNHzhQ7nFzFJdPaG2HBjBQ4wIu+M x/LdX3NZziIPnXGN6etdUdGeIMMAAu4GQMnzYEt5DUtQawoIMN/DwRQvRFTJlvG6OxxN xxhw== X-Gm-Message-State: AOJu0Yx9HanuxDXlF5hziA5khpB+jN4zWg07NOB7ec428uW1Xd1QEr7R vL3k6/h2RncVu2t5G4lGvbn5D1BlLNtVb5Z4KjrES2H34O8pJgNhVzN462NQ87bT X-Gm-Gg: ASbGncvn8/Y3M3TV6L3iWLfJaifjPNkXRG9n3n2gtiTChh70GAhUsCAeZv5YvppiiK7 IOWWskKh4cLiW5Wk0AJO0R2x25qMvA0+EKRyXg5VlHlqlv6TFyJnFfOlIwAH6g/eTd+VUjzPPFp v8TsHpbXN9ad85VuAhTnYsEsGGrtzHV6pHaggQfOzzvmDqvVGR4jAowiLM0B99OeyDO2nu8SYKI DnweIB2g1DxDOYlHL2KnMpvtR8IaXkoAm7McAAwDVaPsSJoTwAl8jd1RWD2TQi82XqG7MoLfS8s OkfOnYBpziKQVHN/UHSF3TRi/oAUIs/xTYQJr+uA2zzw0MW7oQwE9+YtcUGDss+E4kDS3W+iyiD 9KmQfc8OTk2vOlgGsEeaYqP90/vYeut9MvfiU3RtQlTA+q+u7eGxowkNtP1KCq6qSJyeNdpoqm7 EYbys82SNxOg9GMUKMLBtAj7IMaAaH0c9FEEYVHTdSe7EaR4WyPQ== X-Google-Smtp-Source: AGHT+IFZRAxpycVOU9tckCyetMLOmTzV85i1z83n3oWpdvSX9Kf1zcMKkH/7JOR4TlkvH6UQ22zb4Q== X-Received: by 2002:a17:902:ebc5:b0:235:f143:9b07 with SMTP id d9443c01a7336-2462eddcee0mr102405765ad.5.1755979448087; Sat, 23 Aug 2025 13:04:08 -0700 (PDT) Received: from apollo.tail3ccdd3.ts.net ([2601:646:8201:fd20::adc2]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-77040214effsm3201153b3a.84.2025.08.23.13.04.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Aug 2025 13:04:07 -0700 (PDT) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 1/2] libseccomp: fix seccomp_export_bpf_mem out-of-bounds read Date: Sat, 23 Aug 2025 13:04:04 -0700 Message-ID: <20250823200405.680409-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.50.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sat, 23 Aug 2025 20:04:16 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/222349 Fixes segfaults in ptests on musl Failed ptests: {'libseccomp': ['11-basic-basic_errors%%001-00001_11-basic-basic_errors_rc=139']} Signed-off-by: Khem Raj --- ...mp_export_bpf_mem-out-of-bounds-read.patch | 37 +++++++++++++++++++ .../libseccomp/libseccomp_2.6.0.bb | 1 + 2 files changed, 38 insertions(+) create mode 100644 meta/recipes-support/libseccomp/files/0001-api-fix-seccomp_export_bpf_mem-out-of-bounds-read.patch diff --git a/meta/recipes-support/libseccomp/files/0001-api-fix-seccomp_export_bpf_mem-out-of-bounds-read.patch b/meta/recipes-support/libseccomp/files/0001-api-fix-seccomp_export_bpf_mem-out-of-bounds-read.patch new file mode 100644 index 00000000000..0d2910846c7 --- /dev/null +++ b/meta/recipes-support/libseccomp/files/0001-api-fix-seccomp_export_bpf_mem-out-of-bounds-read.patch @@ -0,0 +1,37 @@ +From 83a56d74482ef6b6cc9311b14bf9ea23573f5d4e Mon Sep 17 00:00:00 2001 +From: Alyssa Ross +Date: Thu, 13 Feb 2025 12:05:17 +0100 +Subject: [PATCH] api: fix seccomp_export_bpf_mem out-of-bounds read + +*len is the length of the destination buffer, but program->blks is +probably not anywhere near that long. It's already been checked above +that BPF_PGM_SIZE(program) is less than or equal to *len, so that's +the correct value to use here to avoid either reading or writing too +much. + +I noticed this because tests/11-basic-basic_errors started failing on +musl after e797591 ("all: add seccomp_precompute() functionality"). + +Upstream-Status: Backport [https://github.com/seccomp/libseccomp/commit/dd759e8c4f5685b526638fba9ec4fc24c37c9aec] +Signed-off-by: Alyssa Ross +Acked-by: Tom Hromatka +Signed-off-by: Paul Moore +(imported from commit e8dbc6b555fb936bdfb8ab86f9a45fda96a8b7a2) +Signed-off-by: Khem Raj +--- + src/api.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/api.c b/src/api.c +index adccef3..65a277a 100644 +--- a/src/api.c ++++ b/src/api.c +@@ -786,7 +786,7 @@ API int seccomp_export_bpf_mem(const scmp_filter_ctx ctx, void *buf, + if (BPF_PGM_SIZE(program) > *len) + rc = _rc_filter(-ERANGE); + else +- memcpy(buf, program->blks, *len); ++ memcpy(buf, program->blks, BPF_PGM_SIZE(program)); + } + *len = BPF_PGM_SIZE(program); + diff --git a/meta/recipes-support/libseccomp/libseccomp_2.6.0.bb b/meta/recipes-support/libseccomp/libseccomp_2.6.0.bb index 97988afa27b..998f1b5548d 100644 --- a/meta/recipes-support/libseccomp/libseccomp_2.6.0.bb +++ b/meta/recipes-support/libseccomp/libseccomp_2.6.0.bb @@ -10,6 +10,7 @@ DEPENDS += "gperf-native" SRCREV = "c7c0caed1d04292500ed4b9bb386566053eb9775" SRC_URI = "git://github.com/seccomp/libseccomp.git;branch=release-2.6;protocol=https \ + file://0001-api-fix-seccomp_export_bpf_mem-out-of-bounds-read.patch \ file://run-ptest \ " From patchwork Sat Aug 23 20:04:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 69067 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BAB6CA0EFF for ; Sat, 23 Aug 2025 20:04:16 +0000 (UTC) Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by mx.groups.io with SMTP id smtpd.web10.3947.1755979450310811957 for ; Sat, 23 Aug 2025 13:04:10 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=W10tVGUn; spf=pass (domain: gmail.com, ip: 209.85.210.176, mailfrom: raj.khem@gmail.com) Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-7704799d798so312723b3a.3 for ; Sat, 23 Aug 2025 13:04:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755979449; x=1756584249; 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; bh=w9D4vk/fgp0XDMWiRHRj2bVfLOu76Njg+ikzEDbPtI4=; b=W10tVGUnJTVMX1UxnLLEocClIYB2nLNxKww72kTsS19Xi9j+29ZnRzghk+nTug82B/ /MHdwd1L5rNed4VpIUTAbhaTW/deWTiFH2/GtN/RFhTYVTt6Ob8PdZ+mEx44uYMTYrBq aYO5TFYu4X5o6agbURB4PfgXBpN44Jj8ooCaJPH6SJqJ2XS5CK+JkmnJDtejaUZad8Ls Ki0I9+xdkEQjfFnLW7f48nAUuFzsodfO34pom6bO6NFKBLuSA/Oa9WLJ+IVnnmjPt1J0 LDkJdE/LRDg5dvzMroCJL0g1aOYcapsN0MKPMrfZV11F+YGIu3v0l4EsJG39Y4mVD95a yTYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755979449; x=1756584249; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=w9D4vk/fgp0XDMWiRHRj2bVfLOu76Njg+ikzEDbPtI4=; b=R3sWsIbY9Kk7/SSEgoK0jHDJEuDtPIrkWipHclgLwJhTfSf7qHgCamMy0uHosgufkk epZrN5NfrIo3aFUFWe2RZZI04Pj+o2jdkNfjcri1D5aBiYxhmKCacPTLqLkzhLQ+4jXS 2urwIpTT4dwz0zTSNm38fDmaraasH2/oLbgAaXogwQTziY2NTyUQ5lnWbCZPuhSzYAc0 vVnsLmC9HM1wJRi8KqSC+wjZOo3iZNHCLODacugC9kkS/90rEOoDTKanfFhi/rxXIpUP UR/6la98QxM2dbBF8FHyJ9eymEZgef86u42P93xSP4drw0m2HW28Ny/rzrrf2cvp7C3b SmpA== X-Gm-Message-State: AOJu0Yx7RaCDfdJS9Tvff+5q917WyRtwPiB4V43GVVCk19Wh2ue5PCNR T9CCzhuT2wAb9YvYY/m9Af33LLJ/N4dcf52iKnSlZRgpetUEfoaehWiGQk9O5gjb X-Gm-Gg: ASbGnctUAFBCF77oYf/azvLAzI1QNCagalMLYhYKtAcJ/eO/QSlQ66uVmSioAxJG83y D79X7Zxxdhodiy86u18JauWcmIbIwIwZwceyzDwDTiGLiBch1fQ4CSeIJGIYSNKXTqHUb6lrqHK hS/SHJApIJLqZlcT+Mxj1epVvL0tkkg8Gjs2tCQXrvg2gDPnweLttuMxigX0AonSPVVMtcYGCpe dkTYPxErrsFjX6W0DZVmGLZtbkHeBh1CJt7KU+UeeYRCq2FziPCYdTqzSsQE8/5OdoRZcN+Kelo 8BzbSGB4Twj+LLbKyV55eTsloTt9RALejQUDNPvJsWTZHJhELkFvtrllvY+j4gbwEBvSVnrZ4bd kVNLirNzx+ndm6UNtHCsp10l7GpKbHzBuPuGb6PGLEc5XUC3YokVS1iVVKDRVhdMUCX6qr/noIm kwCGw4ETkpJkCyxpTBKQr173EEZSXrIBB9GCj+kgo= X-Google-Smtp-Source: AGHT+IHT+9f7uDP6i9RXLZkwPlsvuw/3rj3sdWmZor87uyF0yTJ3xTFzLJbykWfaMjwbDbJAoiFV/g== X-Received: by 2002:a05:6a20:3949:b0:240:cd6:a922 with SMTP id adf61e73a8af0-24340d2d846mr11767842637.37.1755979449310; Sat, 23 Aug 2025 13:04:09 -0700 (PDT) Received: from apollo.tail3ccdd3.ts.net ([2601:646:8201:fd20::adc2]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-77040214effsm3201153b3a.84.2025.08.23.13.04.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Aug 2025 13:04:08 -0700 (PDT) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 2/2] lttng-tools: fix unix socket high FD count test Date: Sat, 23 Aug 2025 13:04:05 -0700 Message-ID: <20250823200405.680409-2-raj.khem@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250823200405.680409-1-raj.khem@gmail.com> References: <20250823200405.680409-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sat, 23 Aug 2025 20:04:16 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/222350 Fixes ptest failure on musl 'ERROR: Exited from signal Killed (9)\n' 'DURATION: 663\n'} Signed-off-by: Khem Raj --- .../lttng/lttng-tools/test.patch | 22 +++++++++++++++++++ .../lttng/lttng-tools_2.14.0.bb | 1 + 2 files changed, 23 insertions(+) create mode 100644 meta/recipes-kernel/lttng/lttng-tools/test.patch diff --git a/meta/recipes-kernel/lttng/lttng-tools/test.patch b/meta/recipes-kernel/lttng/lttng-tools/test.patch new file mode 100644 index 00000000000..99d99369637 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-tools/test.patch @@ -0,0 +1,22 @@ +tests: fix unix socket high FD count test off-by-one + +The HIGH_FD_COUNT macro in test_unix_socket.cpp was set equal to +LTTCOMM_MAX_SEND_FDS, which could cause the test to exceed the +maximum allowed number of file descriptors. Adjust it to +LTTCOMM_MAX_SEND_FDS - 1 to avoid hitting the limit and ensure the +test remains valid. + +Upstream-Status: Inappropriate [Musl-specific] +Signed-off-by: Khem Raj + +--- a/tests/unit/test_unix_socket.cpp ++++ b/tests/unit/test_unix_socket.cpp +@@ -25,7 +25,7 @@ + #include + #include + +-#define HIGH_FD_COUNT LTTCOMM_MAX_SEND_FDS ++#define HIGH_FD_COUNT LTTCOMM_MAX_SEND_FDS - 1 + #define MESSAGE_COUNT 4 + #define LARGE_PAYLOAD_SIZE (4 * 1024) + #define LARGE_PAYLOAD_RECV_SIZE 100 diff --git a/meta/recipes-kernel/lttng/lttng-tools_2.14.0.bb b/meta/recipes-kernel/lttng/lttng-tools_2.14.0.bb index 49575ef57cd..6f3fba1d735 100644 --- a/meta/recipes-kernel/lttng/lttng-tools_2.14.0.bb +++ b/meta/recipes-kernel/lttng/lttng-tools_2.14.0.bb @@ -54,6 +54,7 @@ SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \ file://disable-tests2.patch \ file://0001-liblttng-ctl-drop-index-allocator-symbols-from-versi.patch \ file://libc++.patch \ + file://test.patch \ " SRC_URI[sha256sum] = "d8c39c26cec13b7bd82551cd52a22efc358b888e36ebcf9c1b60ef1c3a3c2fd3"