Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2224270/?format=api
{ "id": 2224270, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2224270/?format=api", "web_url": "http://patchwork.ozlabs.org/project/ltp/patch/20260417082920.1101928-1-mcermak@redhat.com/", "project": { "id": 59, "url": "http://patchwork.ozlabs.org/api/1.2/projects/59/?format=api", "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": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260417082920.1101928-1-mcermak@redhat.com>", "list_archive_url": null, "date": "2026-04-17T08:29:20", "name": "Fix Valgrind warnings in ioctl_pidfd02", "commit_ref": null, "pull_url": null, "state": "needs-review-ack", "archived": false, "hash": "4e1565e5a2adceb2fcdba1189a4ce0e8d142c718", "submitter": { "id": 88822, "url": "http://patchwork.ozlabs.org/api/1.2/people/88822/?format=api", "name": "Martin Cermak", "email": "mcermak@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/ltp/patch/20260417082920.1101928-1-mcermak@redhat.com/mbox/", "series": [ { "id": 500272, "url": "http://patchwork.ozlabs.org/api/1.2/series/500272/?format=api", "web_url": "http://patchwork.ozlabs.org/project/ltp/list/?series=500272", "date": "2026-04-17T08:29:20", "name": "Fix Valgrind warnings in ioctl_pidfd02", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/500272/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2224270/comments/", "check": "warning", "checks": "http://patchwork.ozlabs.org/api/patches/2224270/checks/", "tags": {}, "related": [], "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=SyRCjoJN;\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=i+x2NX7V;\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 4fxp2r1hrgz1yGt\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2026 18:29:40 +1000 (AEST)", "from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id 5C6F33E2DD5\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2026 10:29:37 +0200 (CEST)", "from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [217.194.8.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 9F99D3C2B4B\n for <ltp@lists.linux.it>; Fri, 17 Apr 2026 10:29:33 +0200 (CEST)", "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.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 624291000D35\n for <ltp@lists.linux.it>; Fri, 17 Apr 2026 10:29:30 +0200 (CEST)", "from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-50-K8i_3UchNIaxbZDcEL2meQ-1; Fri,\n 17 Apr 2026 04:29:26 -0400", "from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17])\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 mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 0C69A1800578; Fri, 17 Apr 2026 08:29:25 +0000 (UTC)", "from workstation.redhat.com (unknown [10.44.48.37])\n by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id 97D5C195608E; Fri, 17 Apr 2026 08:29:23 +0000 (UTC)" ], "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=1776414577; h=to : date :\n message-id : mime-version : subject : list-id : list-unsubscribe :\n list-archive : list-post : list-help : list-subscribe : from :\n reply-to : cc : content-type : content-transfer-encoding : sender :\n from; bh=ojbaVGSG/w1UUEpPpHp7ybVC6b5pdwUL5tgvoEhjU48=;\n b=SyRCjoJNe5hMl0zmPvxrHW8MVpyhcPE7r30eoSFgcV30xHnbyV+TkeQymEdIIKq9PCPAB\n y8ZmP/gwDGkGKSiWb82/VUUjXz/DfbQyW/cyuMn4E9DMCXMVu9tuePF53Q0YER/X6nmzPGM\n /ou3KBpXYC9GDRVMP4l+A2YwOBeR0mQ=", "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1776414569;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding;\n bh=VqJl5HJFnGhru1YI2JjREB1/ZsP72AIWXtp1ZiJ4ldg=;\n b=i+x2NX7Vs9MfbTqbpt2gzZUw5X/e6kAcGg/poLwt+hP0nLEH8sIl/1LUS/UO6ZSp0hqaXr\n XFjsw18/ovEsNkdGOyOz4mn/DBA+pQTCRHz0ZmklB1mjbNIrM7i7Httn716zQjThS8ScFy\n 6mF+2wNI5kjxk+6+VoQpVJXlo6mdxmc=" ], "X-MC-Unique": "K8i_3UchNIaxbZDcEL2meQ-1", "X-Mimecast-MFC-AGG-ID": "K8i_3UchNIaxbZDcEL2meQ_1776414565", "To": "ltp@lists.linux.it", "Date": "Fri, 17 Apr 2026 10:29:20 +0200", "Message-ID": "<20260417082920.1101928-1-mcermak@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.0 on 10.30.177.17", "X-Mimecast-Spam-Score": "0", "X-Mimecast-MFC-PROC-ID": "ewp5PGhLAyxQ5KIhDmFzs6HVBc9VZfJUGGBVgjZRSH4_1776414565", "X-Mimecast-Originator": "redhat.com", "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] [PATCH] Fix Valgrind warnings in ioctl_pidfd02", "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>", "Cc": "valgrind-developers@lists.sourceforge.net, mcermak@redhat.com", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it", "Sender": "\"ltp\" <ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>" }, "content": "When ioctl_pidfd02 runs under valgrind, it fails to use clone3()\nin lib/tst_clone.c:27, because valgrind doesn't implement clone3.\nSo, tst_clone.c resorts to a raw clone() 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 clone() syscall is notorious for having different \"Calling\nConventions\" depending on the CPU architecture. The following\nvalgrind source demonstrates that mess:\n\n || defined(VGP_ppc32_linux) \\\n || defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux) \\\n || defined(VGP_arm_linux) || defined(VGP_mips32_linux) \\\n || defined(VGP_mips64_linux) || defined(VGP_arm64_linux) \\\n || defined(VGP_nanomips_linux) || defined(VGP_riscv64_linux)\n// And s390x is even more special, and inverts flags and child stack args\n\nThe ARG3 (parent_tidptr) - this patch actually is about - actually is\nthe only arg having identical position across various arches, hooray :)\n\nThe ioctl_pidfd02.c testcase calls clone() with CLONE_PIDFD.\nIn that case ARG3 becomes mandatory (ftr. kernel/fork.c:2669) and\nvalgrind checks its validity. Without this patch, Valgrind fails:\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[ ... stuff deleted ... ]\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 ARG3 explicitly, making valgrind happy. With this\nupdate, ioctl_pidfd02 tests fine on all the rhel supported arches both\nwith 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\n[ ... stuff deleted ... ]\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\nThis patch also sets ARG4 and ARG5. Luckily in this case both are NULL.\nThat's a win, because otherwise we'd need to look into the messy clone()\ncalling convention and handle individual arches separately, see above.", "diff": "diff --git a/lib/tst_clone.c b/lib/tst_clone.c\nindex 8638052e2..296cd40ac 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, NULL, NULL);\n #else\n-\tpid = syscall(__NR_clone, flags, NULL);\n+\tpid = syscall(__NR_clone, flags, NULL, args.pidfd, NULL, NULL);\n #endif\n \n \tif (pid == -1)\n", "prefixes": [] }