Skip to contentSkip to conversation

util-linux: fix lsfd mkfds-mapped-packet-socket ptest on riscv64

PATCH New Jaipaul Cheernam 1 participant 1 message Sep 10

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 util-linux: fix lsfd mkfds-mapped-packet-socket ptest on riscv64

riscv64 reports the write-only packet-ring mmap as "rw-s" (RISC-V has no write-only page encoding), so lsfd reports MODE "rw-" and the test's (MODE == "-w-") filter excluded the shm row, making the expected PACKET lines disappear.

Reported upstream (issue #4618) and backport the fix.

Failure case logs:

root@qemuriscv64:/usr/lib/util-linux/ptest# ./tests/run.sh --use-system-commands --show-diff lsfd/mkfds-mapped-packet-socket
----
         kernel: 7.2.4-yocto-standard
        options: --use-system-commands \
                 --show-diff \
                 --srcdir=/usr/lib/util-linux/ptest/tests/.. \
                 --builddir=/usr/lib/util-linux/ptest/tests/..

           lsfd: mmap'ed AF_PACKET socket       ...

diff-{{{
--- /usr/lib/util-linux/ptest/tests/expected/lsfd/mkfds-mapped-packet-socket 2011-04-05 23:00:00.000000000 +0000 +++ /usr/lib/util-linux/ptest/tests/output/lsfd/mkfds-mapped-packet-socket 2026-09-10 05:57:24.219872733 +0000 @@ -1,16 +1,12 @@
-PACKET
SOCK.PROTONAME: 0
type=raw protocol=ppptalk iface=lo raw PACKET lo ppptalk 16 NAME,SOCK.TYPE,SOCK.PROTONAME,PACKET.IFACE,PACKET.PROTOCOL,PACKET.PROTOCOL.RAW: 0
-PACKET
SOCK.PROTONAME: 0
type=dgram protocol=ppptalk iface=lo dgram PACKET lo ppptalk 16 NAME,SOCK.TYPE,SOCK.PROTONAME,PACKET.IFACE,PACKET.PROTOCOL,PACKET.PROTOCOL.RAW: 0
-PACKET
SOCK.PROTONAME: 0
type=raw protocol=unknown(10000) iface=lo raw PACKET lo unknown(10000) 10000 NAME,SOCK.TYPE,SOCK.PROTONAME,PACKET.IFACE,PACKET.PROTOCOL,PACKET.PROTOCOL.RAW: 0
-PACKET
SOCK.PROTONAME: 0
type=dgram protocol=unknown(10000) iface=lo dgram PACKET lo unknown(10000) 10000 NAME,SOCK.TYPE,SOCK.PROTONAME,PACKET.IFACE,PACKET.PROTOCOL,PACKET.PROTOCOL.RAW: 0
}}}-diff

FAILED (lsfd/mkfds-mapped-packet-socket)
----

Working case logs:

root@qemuriscv64:/usr/lib/util-linux/ptest# ./tests/run.sh --use-system-commands --show-diff lsfd/mkfds-mapped-packet-socket
----
       kernel: 7.2.4-yocto-standard
      options: --use-system-commands \
               --show-diff \
               --srcdir=/usr/lib/util-linux/ptest/tests/.. \
               --builddir=/usr/lib/util-linux/ptest/tests/..

         lsfd: mmap'ed AF_PACKET socket       ... OK

----

Upstream issue: https://github.com/util-linux/util-linux/issues/4618
Upstream PR: https://github.com/util-linux/util-linux/pull/4619

---
 meta/recipes-core/util-linux/util-linux.inc   |  1 +
 ...t-rw-mode-for-mmap-ed-packet-socket-.patch | 45 +++++++++++++++++++
 2 files changed, 46 insertions(+)
 create mode 100644 meta/recipes-core/util-linux/util-linux/0006-tests-lsfd-accept-rw-mode-for-mmap-ed-packet-socket-.patch
meta/recipes-core/util-linux/util-linux.inc +1 -0
index 20b0c37e8c..b30fb04e05 100644
@@ -22,6 +22,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-lin
            file://0003-mount-fix-grammar-and-typo-in-X-mount.idmap-document.patch \
            file://0004-libmount-use-USE_LIBMOUNT_MOUNTFD_SUPPORT-for-idmap-h.patch \
            file://0005-tools-add-non-newmount.conf-config-gen-profile.patch \
+           file://0006-tests-lsfd-accept-rw-mode-for-mmap-ed-packet-socket-.patch \
            "
 
 SRC_URI[sha256sum] = "66ac7c0e725278eb2b039e3104f2c91119341d941b41bac7a285c695f940bd57"
meta/recipes-core/util-linux/util-linux/0006-tests-lsfd-accept-rw-mode-for-mmap-ed-packet-socket-.patch new file +45 -0

45 lines not on this page · raw message