{"id":2223398,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2223398/?format=json","web_url":"http://patchwork.ozlabs.org/project/ltp/patch/20260415082547.vgn23q2aobxy5gzv@lida.tpb.lab.eng.brq.redhat.com/","project":{"id":59,"url":"http://patchwork.ozlabs.org/api/1.1/projects/59/?format=json","name":"Linux Test Project development","link_name":"ltp","list_id":"ltp.lists.linux.it","list_email":"ltp@lists.linux.it","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260415082547.vgn23q2aobxy5gzv@lida.tpb.lab.eng.brq.redhat.com>","date":"2026-04-15T08:25:47","name":"Make ioctl_pidfd02 valgrind-compliant","commit_ref":null,"pull_url":null,"state":"changes-requested","archived":false,"hash":"e5fe710c0a6faa7328178a02c31a546529792c71","submitter":{"id":88822,"url":"http://patchwork.ozlabs.org/api/1.1/people/88822/?format=json","name":"Martin Cermak","email":"mcermak@redhat.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/ltp/patch/20260415082547.vgn23q2aobxy5gzv@lida.tpb.lab.eng.brq.redhat.com/mbox/","series":[{"id":499945,"url":"http://patchwork.ozlabs.org/api/1.1/series/499945/?format=json","web_url":"http://patchwork.ozlabs.org/project/ltp/list/?series=499945","date":"2026-04-15T08:25:47","name":"Make ioctl_pidfd02 valgrind-compliant","version":1,"mbox":"http://patchwork.ozlabs.org/series/499945/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2223398/comments/","check":"warning","checks":"http://patchwork.ozlabs.org/api/patches/2223398/checks/","tags":{},"headers":{"Return-Path":"<ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>","X-Original-To":["incoming@patchwork.ozlabs.org","ltp@lists.linux.it"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","ltp@picard.linux.it"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=lists.linux.it header.i=@lists.linux.it\n header.a=rsa-sha256 header.s=picard header.b=azMJUwVL;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=KkXSDTEG;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it\n (client-ip=213.254.12.146; helo=picard.linux.it;\n envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it;\n receiver=patchwork.ozlabs.org)"],"Received":["from picard.linux.it (picard.linux.it [213.254.12.146])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fwZ3d2N3Kz1yHd\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 15 Apr 2026 18:26:05 +1000 (AEST)","from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id D39943E2930\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 15 Apr 2026 10:26:02 +0200 (CEST)","from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it\n [IPv6:2001:4b78:1:20::4])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature ECDSA (secp384r1))\n (No client certificate requested)\n by picard.linux.it (Postfix) with ESMTPS id 312BB3E20E3\n for <ltp@lists.linux.it>; Wed, 15 Apr 2026 10:25:58 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.124])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by in-4.smtp.seeweb.it (Postfix) with ESMTPS id 70D6D10000CA\n for <ltp@lists.linux.it>; Wed, 15 Apr 2026 10:25:56 +0200 (CEST)","from mail-wm1-f72.google.com (mail-wm1-f72.google.com\n [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-153-GWlefzvRNbK52miq8q6aEg-1; Wed, 15 Apr 2026 04:25:54 -0400","by mail-wm1-f72.google.com with SMTP id\n 5b1f17b1804b1-488c768a9a9so33212175e9.1\n for <ltp@lists.linux.it>; Wed, 15 Apr 2026 01:25:51 -0700 (PDT)","from lida.tpb.lab.eng.brq.redhat.com ([213.175.46.86])\n by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-488f1e95130sm31895355e9.13.2026.04.15.01.25.48\n (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);\n Wed, 15 Apr 2026 01:25:49 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=lists.linux.it;\n i=@lists.linux.it; q=dns/txt; s=picard; t=1776241562; h=date : to :\n message-id : mime-version : content-type : subject : list-id :\n list-unsubscribe : list-archive : list-post : list-help :\n list-subscribe : from : reply-to : sender : from;\n bh=SYc6nW4wlNiHq+3DcTvzw7cpI8qehsLNw8BMvA711OU=;\n b=azMJUwVLiRJonEMIq+FMxtagGJ3jQN5x7mqeJg1WRvg1hbgBShmI5GwkEbVYKqObQeOKw\n 61jPmog41zX1L3/v6z74S5bp4ZCwBHI63sCPscyrqIHUDIywwZ63FUn1zm+4UUg4ktDyNYI\n gmPmIQ0Y7gpBhblh1J2zzmaPmdC5Bz8=","v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1776241555;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:mime-version:mime-version:content-type:content-type;\n bh=ZF7lXqQY8RI3I+31MeQRlrtWJuKoFBAAelIWYcQZGpE=;\n b=KkXSDTEGTSSn5y0++wokcClx2ypxaRfMPK3vE1eW3Q4wTjRGFuccT21cblf3skJ4krq4bC\n vcu2khTyIv69nsrWkfx5jQ9dYSnFr7L6QZRp5apnv5iJ6aZVRDBfCQF9I+qPEg32STxj/s\n vgT8J8OT4NF593xycZca0C5kjEIhiw4="],"X-MC-Unique":"GWlefzvRNbK52miq8q6aEg-1","X-Mimecast-MFC-AGG-ID":"GWlefzvRNbK52miq8q6aEg_1776241550","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776241550; x=1776846350;\n h=user-agent:content-disposition:mime-version:message-id:subject:to\n :from:date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=IPubyEEXmc+lU5qo1wO0eMuuG8HhlPKTHhUImCQqAnM=;\n b=bdVoTbgnKIeZNdeLv/MfFvMztUpkJoZmos9mOwWoxhdGXgaRopc4pv2icYxnd5gGL5\n 0kXIgrEV854quZPtH6maFhIwuTEGJkigDngYRHOCaVLN6j/h+QC99z+GVbKRL7RGQlmb\n 1PUcK3pemk9LoVoQ4VXBBnH9LfOxszEMp1srQVev4QcDYlRZ0dBkzB4Lq8FS6RbWxutP\n MF/mbNHIlREOcEsbSv9eVM/ShyprR2QussR2QXIyIf5xPnijtMLW3wSPaLlnEy0bUqa6\n mZlzrWlgOx1EO0jbjCWTp+cyV+TNNFq6ir68qUPDWi24OigW9HUmjCY4JlayrU7OUOnI\n w9Tg==","X-Forwarded-Encrypted":"i=1;\n AFNElJ/9g8ly+8++jZWG8rkF8iaYPljNFpYO8cObR+yHEpgT7n0VYF2Hw849lWOFV2Csg75cX2E=@lists.linux.it","X-Gm-Message-State":"AOJu0Ywagc9bT0/KHBsQYkz3WsOxUuXuFc5Ocy8uc0twJDhbBQDjIVqh\n sNPmCiufe2D6G6iprSJW+4Skqzhs0dHpG4ecBYdNo7BnQmtvL+NSJSjvlqu4f6W/0EhCRoX93Vo\n c5SkvBEZZ0QEdcm1faTMME7JYiwiaNFBK0GF2zdCsfi0RTHU4Ucf/","X-Gm-Gg":"AeBDiet8MXtH5q5gbewMuzH6Wdt8wKVR4301R42T8ECDbYGD4Xc7Ifo7dTM/W5FPgwn\n s8j1Y3urC6DwZbo+3wzqnJ1cVWwbuzdRSx4YWu7pQoXq5w0DkNg2eaTU0jg9YxB67Eampw4MsWC\n XOMTAk205dNbNHEOrKHL1FD7Svc/Mg3b5CgXihWhgGS7DNnyMgEkEo4vo3fCz+g6bqIEu8ZUE6G\n Y71XXJD48PTEFh3S1ViR7v1W6uY9o2xuqBYDSKwCqlIuLqLHFifG8aTADltbK849RkewbqiPTQR\n acPOYI9JMX+73/SJ54/MF00NMFPt7HfAxq4BbzpZsm03/v/hZ13G6v/DB+R70l4FAsJZMFDhYbP\n ++VmwQykVhZbPTVaS8WAKfMaOdmY5C1VryA==","X-Received":["by 2002:a05:600c:890e:b0:483:6d4a:7e6d with SMTP id\n 5b1f17b1804b1-488d6ad4a72mr185682745e9.30.1776241550337;\n Wed, 15 Apr 2026 01:25:50 -0700 (PDT)","by 2002:a05:600c:890e:b0:483:6d4a:7e6d with SMTP id\n 5b1f17b1804b1-488d6ad4a72mr185682405e9.30.1776241549842;\n Wed, 15 Apr 2026 01:25:49 -0700 (PDT)"],"Date":"Wed, 15 Apr 2026 10:25:47 +0200","To":"Petr Vorel <pvorel@suse.cz>, Cyril Hrubis <chrubis@suse.cz>,\n valgrind-developers@lists.sourceforge.net, ltp@lists.linux.it","Message-ID":"<20260415082547.vgn23q2aobxy5gzv@lida.tpb.lab.eng.brq.redhat.com>","MIME-Version":"1.0","User-Agent":"NeoMutt/20180716","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"1gSDVpGTjVq6vP3Bdp3LYLo5mUCyfRSqCH7v4VEz2jI_1776241550","X-Mimecast-Originator":"redhat.com","Content-Type":"multipart/mixed; boundary=\"qllmnoumhnb5r3pq\"","Content-Disposition":"inline","X-Spam-Status":"No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID,\n DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS shortcircuit=no\n autolearn=disabled version=4.0.1","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on in-4.smtp.seeweb.it","X-Virus-Scanned":"clamav-milter 1.0.9 at in-4.smtp.seeweb.it","X-Virus-Status":"Clean","Subject":"[LTP] Make ioctl_pidfd02 valgrind-compliant","X-BeenThere":"ltp@lists.linux.it","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"Linux Test Project <ltp.lists.linux.it>","List-Unsubscribe":"<https://lists.linux.it/options/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=unsubscribe>","List-Archive":"<http://lists.linux.it/pipermail/ltp/>","List-Post":"<mailto:ltp@lists.linux.it>","List-Help":"<mailto:ltp-request@lists.linux.it?subject=help>","List-Subscribe":"<https://lists.linux.it/listinfo/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=subscribe>","From":"Martin Cermak via ltp <ltp@lists.linux.it>","Reply-To":"Martin Cermak <mcermak@redhat.com>","Errors-To":"ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it","Sender":"\"ltp\" <ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>"},"content":"Hi folks,\n\nattached is a ioctl_pidfd02 patch that improves the behavior of\nthis testcase under valgrind.  Please review and check in if\npossible.\n\nThanks,\nMartin\nFrom 25c0e052aba25b0a86f844246f14aa17ad47ef1f Mon Sep 17 00:00:00 2001\nFrom: Martin Cermak <mcermak@redhat.com>\nDate: Wed, 15 Apr 2026 10:03:44 +0200\nSubject: [PATCH] Make ioctl_pidfd02 valgrind-compliant\n\nWhen ioctl_pidfd02 runs under valgrind, it fails to use clone3()\nin lib/tst_clone.c:27, because valgrind doesn't implement it. So,\nit resorts to a raw syscall a few lines later.\n\nManual page clone(2) says that In Linux 2.4 and earlier, clone()\ndoes not take arguments parent_tid, tls, and child_tid.  That pre-\ndates valgrind itself though.  In reasonably recent history, the\nraw clone() syscall takes 5 args.\n\nThe ioctl_pidfd02.c testcase calls clone() with flags = CLONE_PIDFD\nand others.  When that happens, the 4th clone() arg, parent_tidptr,\nbecomes mandatory, and valgrind checks its validity per PRE(sys_clone)\nalong the lines of coregrind/m_syswrap/syswrap-linux.c:831.  If this\narg isn't set, the raw syscall() will execute without failure, but\nthat arg contains garbage, and valgrind fails to check it:\n\nioctl_pidfd02.c:64: TPASS: WEXITSTATUS(info1->exit_code) == 100 (100)\n==2227408== Syscall param clone(parent_tidptr) points to unaddressable byte(s)\n==2227408==    at 0x496215D: syscall (syscall.S:38)\n==2227408==    by 0x420E73: tst_clone (tst_clone.c:41)\n==2227408==    by 0x4135E9: safe_clone (tst_test.c:601)\n==2227408==    by 0x405094: run (ioctl_pidfd02.c:33)\n==2227408==    by 0x416AE4: run_tests (tst_test.c:1730)\n==2227408==    by 0x416D6E: testrun (tst_test.c:1796)\n==2227408==    by 0x417427: fork_testrun (tst_test.c:1936)\n==2227408==    by 0x417A8A: tst_run_tcases (tst_test.c:2079)\n==2227408==    by 0x404E9A: main (tst_test.h:755)\n==2227408==  Address 0xffffffffffffffa0 is not stack'd, malloc'd or (recently) free'd\n\nThis patch sets the parent_tidptr explicitly, making valgrind happy.\nWith this update, ioctl_pidfd02 tests fine on all the rhel supported\narches both with and without valgrind, e.g.:\n\nel10 s390x # valgrind --exit-on-first-error=yes --error-exitcode=-3 --quiet ./testcases/kernel/syscalls/ioctl/ioctl_pidfd02\ntst_kconfig.c:90: TINFO: Parsing kernel config '/lib/modules/6.12.0-218.el10.s390x/build/.config'\ntst_buffers.c:57: TINFO: Test is using guarded buffers\ntst_tmpdir.c:308: TINFO: Using /tmp/LTP_iocGIJIgS as tmpdir (xfs filesystem)\ntst_test.c:2059: TINFO: LTP version: 20260130\ntst_test.c:2062: TINFO: Tested kernel: 6.12.0-218.el10.s390x #1 SMP Tue Mar 31 07:51:26 EDT 2026 s390x\ntst_kconfig.c:90: TINFO: Parsing kernel config '/lib/modules/6.12.0-218.el10.s390x/build/.config'\ntst_test.c:1887: TINFO: Overall timeout per run is 0h 00m 30s\nioctl_pidfd02.c:49: TPASS: info0->mask & PIDFD_INFO_EXIT == 0 (0)\nioctl_pidfd02.c:50: TPASS: info0->exit_code == 0 (0)\nioctl_pidfd02.c:61: TPASS: info1->mask & PIDFD_INFO_EXIT == PIDFD_INFO_EXIT (8)\nioctl_pidfd02.c:62: TPASS: info1->exit_code == status (25600)\nioctl_pidfd02.c:64: TPASS: WEXITSTATUS(info1->exit_code) == 100 (100)\nioctl_pidfd02.c:49: TPASS: info0->mask & PIDFD_INFO_EXIT == 0 (0)\nioctl_pidfd02.c:50: TPASS: info0->exit_code == 0 (0)\nioctl_pidfd02.c:61: TPASS: info1->mask & PIDFD_INFO_EXIT == PIDFD_INFO_EXIT (8)\nioctl_pidfd02.c:62: TPASS: info1->exit_code == status (25600)\nioctl_pidfd02.c:64: TPASS: WEXITSTATUS(info1->exit_code) == 100 (100)\n\nSummary:\npassed   10\nfailed   0\nbroken   0\nskipped  0\nwarnings 0\nel10 s390x #\n---\n lib/tst_clone.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)","diff":"diff --git a/lib/tst_clone.c b/lib/tst_clone.c\nindex 8638052e2..d14f8699f 100644\n--- a/lib/tst_clone.c\n+++ b/lib/tst_clone.c\n@@ -36,9 +36,9 @@ pid_t tst_clone(const struct tst_clone_args *tst_args)\n \tflags = args.exit_signal | args.flags;\n \n #ifdef __s390x__\n-\tpid = syscall(__NR_clone, NULL, flags);\n+\tpid = syscall(__NR_clone, NULL, flags, args.pidfd);\n #else\n-\tpid = syscall(__NR_clone, flags, NULL);\n+\tpid = syscall(__NR_clone, flags, NULL, args.pidfd);\n #endif\n \n \tif (pid == -1)\n","prefixes":[]}