From 1c7ec53856d7b9d8eaaf08a8f70dd386419c7609 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Mon, 9 Mar 2026 19:17:35 +0100 Subject: [PATCH 1/3] build: add Fedora and Tubmleweed to the build matrix Extend the build matrix to include Fedora and Tumbleweed for the main build (nvme-cli). Since the main build also includes libnvme, build libnvme standalone only on Debian with GCC. This is to catch configuration errors in Meson, and there is no additional information gained from the main build. Signed-off-by: Daniel Wagner --- .github/workflows/build.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 55856ca2af..1a9959cf44 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,10 +14,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: + distro: [debian, fedora, tumbleweed] compiler: [gcc, clang] buildtype: [debug, release] container: - image: ghcr.io/linux-nvme/debian:latest + image: ghcr.io/linux-nvme/${{ matrix.distro }}:latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Mark repo as safe for git @@ -37,10 +38,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - compiler: [gcc, clang] - buildtype: [debug, release] + distro: [debian] + compiler: [gcc] + buildtype: [release] container: - image: ghcr.io/linux-nvme/debian:latest + image: ghcr.io/linux-nvme/${{ matrix.distro }}:latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Mark repo as safe for git From 1926e7dfe9228d5aadd20c82241a3a64cbd4ef49 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Mon, 9 Mar 2026 19:53:17 +0100 Subject: [PATCH 2/3] mi: verify length of data before reading header The total length could be shorter than then the header. Thus check first the message length. Running test mi_aem_ep_based_failure_conditions...==3181== Conditional jump or move depends on uninitialised value(s) ==3181== at 0x486E7D7: validate_enabled_list (mi.c:1445) ==3181== by 0x486E7D7: nvme_mi_aem_get_enabled (mi.c:1730) ==3181== by 0x486E8F3: aem_disable_enabled (mi.c:1605) ==3181== by 0x486EB3A: nvme_mi_aem_enable (mi.c:1667) ==3181== by 0x401621: test_mi_aem_ep_based_failure_helper (mi-mctp.c:1187) ==3181== by 0x401688: test_mi_aem_ep_based_failure_conditions (mi-mctp.c:1204) ==3181== by 0x400FF2: run_test (mi-mctp.c:1448) ==3181== by 0x400FF2: main (mi-mctp.c:1472) Signed-off-by: Daniel Wagner --- libnvme/src/nvme/mi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libnvme/src/nvme/mi.c b/libnvme/src/nvme/mi.c index f5153a6e9d..effb703701 100644 --- a/libnvme/src/nvme/mi.c +++ b/libnvme/src/nvme/mi.c @@ -1440,6 +1440,8 @@ void nvme_mi_aem_aeolli_set_aeoltl(struct nvme_mi_aem_occ_list_hdr *hdr, __u32 a static int validate_enabled_list(struct nvme_mi_aem_supported_list *list, size_t len) { + if (len < sizeof(struct nvme_mi_aem_supported_list)) + return -EPROTO; if (list->hdr.aeslver != 0) return -EPROTO; if (list->hdr.aeslhl != sizeof(struct nvme_mi_aem_supported_list)) From d8d7b313228926026d69ec628977ff6b8d9f84ce Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Mon, 9 Mar 2026 21:11:55 +0100 Subject: [PATCH 3/3] misc: initialize memory before using in tests valgrind complains about accessing not inialized data. Running test copy...==4327== Conditional jump or move depends on uninitialised value(s) ==4327== at 0x484E89E: bcmp (vg_replace_strmem.c:1234) ==4327== by 0x485D217: cmp (util.c:41) ==4327== by 0x485CE3C: ioctl (mock.c:188) ==4327== by 0x4870D1A: nvme_submit_passthru32 (ioctl.c:136) ==4327== by 0x4870EC3: nvme_submit_io_passthru (ioctl.c:183) ==4327== by 0x405595: test_copy (misc.c:1014) ==4327== by 0x406968: run_test (misc.c:1382) ==4327== by 0x406BF4: main (misc.c:1433) Signed-off-by: Daniel Wagner --- libnvme/test/ioctl/misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnvme/test/ioctl/misc.c b/libnvme/test/ioctl/misc.c index dcd82fe6fb..3045267c62 100644 --- a/libnvme/test/ioctl/misc.c +++ b/libnvme/test/ioctl/misc.c @@ -989,7 +989,7 @@ static void test_copy(void) _cleanup_free_ struct nvme_copy_range *copy = NULL; - copy = malloc(copy_size); + copy = calloc(1, copy_size); check(copy, "copy: ENOMEM"); struct mock_cmd mock_io_cmd = {