[{"id":3677171,"web_url":"http://patchwork.ozlabs.org/comment/3677171/","msgid":"<20260414124418.3792-1-linuxtestproject.agent@gmail.com>","list_archive_url":null,"date":"2026-04-14T12:44:18","subject":"Re: [LTP] Avoid syscall param ioctl(generic) points to\n uninitialised byte(s)","submitter":{"id":93132,"url":"http://patchwork.ozlabs.org/api/people/93132/","name":null,"email":"linuxtestproject.agent@gmail.com"},"content":"Hi Martin,\n\nour agent completed the review of the patch.\n\nThe agent can sometimes produce false positives although often its\nfindings are genuine. If you find issues with the review, please\ncomment this email or ignore the suggestions.\n\nOn Wed, 20 Jan 2038, Martin Cermak wrote:\n> Avoid syscall param ioctl(generic) points to uninitialised byte(s)\n\nThe subject is a raw Valgrind diagnostic string, not a commit subject.\nName the component and the fix, e.g.:\n  userfaultfd01: initialize uffdio_register to avoid uninitialized bytes\n\n> lib/tst_clocks.c: fix uninitialized memory in run()  Reproducible\n>                   using userfaultfd01.\n\nThe file named here (lib/tst_clocks.c) is not the file changed by this\npatch; the actual change is in\ntestcases/kernel/syscalls/userfaultfd/userfaultfd01.c. Please correct\nthis and explain why uffdio_register was uninitialized (the ioctls field\nis not set before UFFDIO_REGISTER is called).\n\nRegards,\nLTP AI Reviewer","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=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=NaT4twji;\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 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fw3rC3xgyz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 22:44:27 +1000 (AEST)","from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id 5CC5F3E4B22\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 14:44:24 +0200 (CEST)","from in-5.smtp.seeweb.it (in-5.smtp.seeweb.it [217.194.8.5])\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 DCF953C888C\n for <ltp@lists.linux.it>; Tue, 14 Apr 2026 14:44:21 +0200 (CEST)","from mail-qt1-x842.google.com (mail-qt1-x842.google.com\n [IPv6:2607:f8b0:4864:20::842])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by in-5.smtp.seeweb.it (Postfix) with ESMTPS id 6E2E86005D1\n for <ltp@lists.linux.it>; Tue, 14 Apr 2026 14:44:21 +0200 (CEST)","by mail-qt1-x842.google.com with SMTP id\n d75a77b69052e-50d6b9bca48so72762241cf.2\n for <ltp@lists.linux.it>; Tue, 14 Apr 2026 05:44:21 -0700 (PDT)","from\n runnervm35a4x.cjvt5eu2u5teznjqene1d4z5dg.ex.internal.cloudapp.net\n ([172.183.133.245]) by smtp.gmail.com with ESMTPSA id\n d75a77b69052e-50de3a7faecsm82997461cf.16.2026.04.14.05.44.19\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 14 Apr 2026 05:44:19 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1776170660; x=1776775460; darn=lists.linux.it;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=V3UYbWxecNEkIaP97HhHlyUQTBXvpCwmavPESsrI5rc=;\n b=NaT4twjiWXg/TxG4y4GKdxrbL1Zqxn1Sw1UzegJCn8oSaTswd83bXz6Vhq2LCZqoE4\n UW16pJUqXzpYzI50A6RohORo4kF+uw854VIRgKAonYAacXdMX28SyzjA/vzghc0lpwXo\n W7QTLUsmdnV40+5RnR4hk6uJOdETW78FD4+Aw4GfuqGZbS6mx5a91y3QDaehrAjJ0x/o\n tAUACEZM4imlvCGM1CSa1OYWmup6OsgEUfoYpxYkHmkQv3cmRuBE/IFir9ywpgVR8ptc\n iLgQuANF89C9qoYqELvjfsEEjMf7RZ0cQbI5zB1EyDD2bhrzB08fj3sWLs3iMvMPdc32\n AIxg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776170660; x=1776775460;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=V3UYbWxecNEkIaP97HhHlyUQTBXvpCwmavPESsrI5rc=;\n b=MVlXVH2fzaGINLaKIAQiOsCQcsKA+9WDRK+1a6uTdk9pv9/VWtppIVOhDfh19h+sLc\n ZkVqPATWpGqu6SWREUFLanbrORz6OhVcNawr48KTvK6riNwzjoJLqw7pPlX7BM0QaAib\n 11BZir385ftKxXOSp8IMdhLhMdOOtinU4xMDRqglM5wH6yKIsXjEz8rzAIwLnd7aWZXM\n b3DMnx3QyuO6Vp5KJtwvEJxiSpb0+mhUmikVhiM8LJTosMvdWKYYiNRluIASUAAlI8ml\n qeR7M5xZEnbrnn+nvfU+8Q5wAMbUQSNjolIriKspLxevA5C+rQTxWmjaD8Od+7zuaKU2\n LQcQ==","X-Gm-Message-State":"AOJu0YxfCVbp/pkb6K4d3dSb2Vkj1s2SguN39smmLF1Rtmyk7qtL9Cou\n teS/vSSfuWovOwrM1121f5HxaU6DzD02TuadsTfQt/VOutFXn2lJPTbSHQ8nqMYw+hmSNMpV","X-Gm-Gg":"AeBDiesMrnznpDuXEv/NQf4SUFRp4xPJfXjSN6HTrnzNPN0/5Yx/68+2Dq7mC5qk+uJ\n 3TfegHQYolDGV/WQv2k4zaq6JhWyyuLYUGaPud6bJ01LOOL/y25A7nN/cC/XY/mbZEyo1MBAoc0\n sh8Ys1i3XW/WrbmjLTZJiz4oU9bRTlZdCvOPvzTZIQb3B0Z7vpjTATOvp09RBCvqO8EFfXQqc9b\n EVU/WXWTalPT4tVCDqrg4K+ff0CChLGHu9KRpuG4fSuNiNrSpG7EhaJOEhP0wVn//+aZmPeQe4M\n +yMod0L7SkGPukyVbPfoAGea05IYVAY4sNB3HwarSz1j3nEqS5KBsQBmWIubwkK445L1DAQinej\n bcD52dsvGyL02cwNUXQvWd2cRmeI4s7pJMj0aVDNcDNA2M7P5fRs6woxbV/2Kp/qcpHl7z5WRkV\n /mmaZP+scOl6mkOHuZkJIt1swfff8BRU0uKOv/OKWbcIpFRgcvLu/8FoIXSPFY6phEaE1+1b6Ii\n YddzdXWtFvARGKNspNVfA4junY=","X-Received":"by 2002:a05:622a:8d0f:b0:509:39b5:a97f with SMTP id\n d75a77b69052e-50dd5cc125dmr227358141cf.29.1776170660199;\n Tue, 14 Apr 2026 05:44:20 -0700 (PDT)","From":"linuxtestproject.agent@gmail.com","To":"Martin Cermak <mcermak@redhat.com>","Date":"Tue, 14 Apr 2026 12:44:18 +0000","Message-ID":"<20260414124418.3792-1-linuxtestproject.agent@gmail.com>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<20260414114758.7xtei7hyddxu2fic@lida.tpb.lab.eng.brq.redhat.com>","References":"<20260414114758.7xtei7hyddxu2fic@lida.tpb.lab.eng.brq.redhat.com>","MIME-Version":"1.0","X-Spam-Status":"No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID,\n DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS\n shortcircuit=no autolearn=disabled version=4.0.1","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on in-5.smtp.seeweb.it","X-Virus-Scanned":"clamav-milter 1.0.9 at in-5.smtp.seeweb.it","X-Virus-Status":"Clean","Subject":"Re: [LTP] Avoid syscall param ioctl(generic) points to\n uninitialised byte(s)","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>","Cc":"ltp@lists.linux.it","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>"}},{"id":3677582,"web_url":"http://patchwork.ozlabs.org/comment/3677582/","msgid":"<ad9l7MeJneX1LdCe@yuki.lan>","list_archive_url":null,"date":"2026-04-15T10:18:20","subject":"Re: [LTP] Avoid syscall param ioctl(generic) points to\n uninitialised byte(s)","submitter":{"id":8530,"url":"http://patchwork.ozlabs.org/api/people/8530/","name":"Cyril Hrubis","email":"chrubis@suse.cz"},"content":"Hi!\n> From b81924101f441d7f2103197c8b81a38e8920fda4 Mon Sep 17 00:00:00 2001\n> From: Super User <root@vm-10-0-185-15.hosted.upshift.rdu2.redhat.com>\n> Date: Wed, 20 Jan 2038 01:08:34 -0500\n> Subject: [PATCH] Avoid syscall param ioctl(generic) points to uninitialised\n>  byte(s)\n> \n> lib/tst_clocks.c: fix uninitialized memory in run()  Reproducible\n>                   using userfaultfd01.\n\nThis description does not seem to correspond to the actual change.\n\n> Signed-off-by: Martin Cermak <mcermak@redhat.com>\n> ---\n>  testcases/kernel/syscalls/userfaultfd/userfaultfd01.c | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git a/testcases/kernel/syscalls/userfaultfd/userfaultfd01.c b/testcases/kernel/syscalls/userfaultfd/userfaultfd01.c\n> index 7368d3863..d24766e7c 100644\n> --- a/testcases/kernel/syscalls/userfaultfd/userfaultfd01.c\n> +++ b/testcases/kernel/syscalls/userfaultfd/userfaultfd01.c\n> @@ -92,8 +92,8 @@ static void *handle_thread(void)\n>  static void run(unsigned int i)\n>  {\n>  \tpthread_t thr;\n> -\tstruct uffdio_api uffdio_api = {};\n> -\tstruct uffdio_register uffdio_register;\n> +\tstruct uffdio_api uffdio_api = {0, };\n> +\tstruct uffdio_register uffdio_register = {0, };\n\nGiven that we were using = {}; in the code before can we keep using that\nand for all instances?\n\nAlso I assume the problem is the ioctls field in the uffdio_api\nstructure that is not initialized beacuse is supposed to be set by\nkernel before returning into userspace. Should valgrind warn about such\ncases?","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 spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it\n (client-ip=2001:1418:10:5::2; helo=picard.linux.it;\n envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it;\n receiver=patchwork.ozlabs.org)","smtp-out2.suse.de;\n\tnone"],"Received":["from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2])\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 4fwcY20rB8z1yDF\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 15 Apr 2026 20:18:14 +1000 (AEST)","from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id 9AD1A3E5BAC\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 15 Apr 2026 12:18:11 +0200 (CEST)","from in-5.smtp.seeweb.it (in-5.smtp.seeweb.it [217.194.8.5])\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 9E18C3C1E06\n for <ltp@lists.linux.it>; Wed, 15 Apr 2026 12:18:07 +0200 (CEST)","from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131])\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-5.smtp.seeweb.it (Postfix) with ESMTPS id 2732A600BCE\n for <ltp@lists.linux.it>; Wed, 15 Apr 2026 12:18:06 +0200 (CEST)","from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org\n [IPv6:2a07:de40:b281:104:10:150:64:97])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by smtp-out2.suse.de (Postfix) with ESMTPS id 925205BE39;\n Wed, 15 Apr 2026 10:18:06 +0000 (UTC)","from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 841114B963;\n Wed, 15 Apr 2026 10:18:06 +0000 (UTC)","from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])\n by imap1.dmz-prg2.suse.org with ESMTPSA id wYLEH95l32n9JwAAD6G6ig\n (envelope-from <chrubis@suse.cz>); Wed, 15 Apr 2026 10:18:06 +0000"],"Date":"Wed, 15 Apr 2026 12:18:20 +0200","From":"Cyril Hrubis <chrubis@suse.cz>","To":"Martin Cermak <mcermak@redhat.com>","Message-ID":"<ad9l7MeJneX1LdCe@yuki.lan>","References":"<20260414114758.7xtei7hyddxu2fic@lida.tpb.lab.eng.brq.redhat.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20260414114758.7xtei7hyddxu2fic@lida.tpb.lab.eng.brq.redhat.com>","X-Rspamd-Pre-Result":["action=no action; module=replies;\n Message is reply to one we originated","action=no action; module=replies;\n Message is reply to one we originated"],"X-Rspamd-Queue-Id":"925205BE39","X-Rspamd-Action":"no action","X-Spam-Score":"-4.00","X-Spam-Level":"","X-Spamd-Result":"default: False [-4.00 / 50.00];\n\tREPLY(-4.00)[]","X-Rspamd-Server":"rspamd1.dmz-prg2.suse.org","X-Spam-Status":"No, score=0.0 required=7.0 tests=SPF_HELO_NONE,SPF_PASS\n shortcircuit=no autolearn=disabled version=4.0.1","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on in-5.smtp.seeweb.it","X-Virus-Scanned":"clamav-milter 1.0.9 at in-5.smtp.seeweb.it","X-Virus-Status":"Clean","Subject":"Re: [LTP] Avoid syscall param ioctl(generic) points to\n uninitialised byte(s)","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>","Cc":"valgrind-developers@lists.sourceforge.net, ltp@lists.linux.it","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>"}},{"id":3678044,"web_url":"http://patchwork.ozlabs.org/comment/3678044/","msgid":"<20260416092131.kkbfd3cdi3tv7z7l@lida.tpb.lab.eng.brq.redhat.com>","list_archive_url":null,"date":"2026-04-16T09:21:31","subject":"Re: [LTP] Avoid syscall param ioctl(generic) points to\n uninitialised byte(s)","submitter":{"id":88822,"url":"http://patchwork.ozlabs.org/api/people/88822/","name":"Martin Cermak","email":"mcermak@redhat.com"},"content":"Hi Cyril,\n\nOn  Wed  2026-04-15  12:18 , Cyril Hrubis wrote:\n> Hi!\n> > From b81924101f441d7f2103197c8b81a38e8920fda4 Mon Sep 17 00:00:00 2001\n> > From: Super User <root@vm-10-0-185-15.hosted.upshift.rdu2.redhat.com>\n> > Date: Wed, 20 Jan 2038 01:08:34 -0500\n> > Subject: [PATCH] Avoid syscall param ioctl(generic) points to uninitialised\n> >  byte(s)\n> > \n> > lib/tst_clocks.c: fix uninitialized memory in run()  Reproducible\n> >                   using userfaultfd01.\n> \n> This description does not seem to correspond to the actual change.\n\nOh, right, this is a true mistake in my proposed patch.  Sorry about that.\n\n> \n> > Signed-off-by: Martin Cermak <mcermak@redhat.com>\n> > ---\n> >  testcases/kernel/syscalls/userfaultfd/userfaultfd01.c | 4 ++--\n> >  1 file changed, 2 insertions(+), 2 deletions(-)\n> > \n> > diff --git a/testcases/kernel/syscalls/userfaultfd/userfaultfd01.c b/testcases/kernel/syscalls/userfaultfd/userfaultfd01.c\n> > index 7368d3863..d24766e7c 100644\n> > --- a/testcases/kernel/syscalls/userfaultfd/userfaultfd01.c\n> > +++ b/testcases/kernel/syscalls/userfaultfd/userfaultfd01.c\n> > @@ -92,8 +92,8 @@ static void *handle_thread(void)\n> >  static void run(unsigned int i)\n> >  {\n> >  \tpthread_t thr;\n> > -\tstruct uffdio_api uffdio_api = {};\n> > -\tstruct uffdio_register uffdio_register;\n> > +\tstruct uffdio_api uffdio_api = {0, };\n> > +\tstruct uffdio_register uffdio_register = {0, };\n> \n> Given that we were using = {}; in the code before can we keep using that\n> and for all instances?\n\nI saw both initializers in the LTP source, see `$ grep -rIn  '= {};'` and\n`$ grep -rIn  '= { 0, };'`.  The latter one is compliant with older standards.\nBut to keep the coding style within this file, I've updated the initializer.\n\n> Also I assume the problem is the ioctls field in the uffdio_api\n> structure that is not initialized beacuse is supposed to be set by\n> kernel before returning into userspace. Should valgrind warn about such\n> cases?\n\nYou are right that zeroing just this uffdio_register.ioctls = 0; is suffi-\ncient to to avoid the valgrind complaint.  Zeroing whole the struct seems\nsyntactically more concise and also correct.\n\nHere is how Valgrind complains when uffdio_register.ioctls isn't zero inited:\n\nel10 x86_64 # echo $T\n/root/ltp/testcases/kernel/syscalls/userfaultfd/userfaultfd01\nel10 x86_64 # \nel10 x86_64 # \nel10 x86_64 # \nel10 x86_64 # $T\ntst_test.c:2059: TINFO: LTP version: 20260130\ntst_test.c:2062: TINFO: Tested kernel: 6.12.0-218.el10.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 31 08:07:36 EDT 2026 x86_64\ntst_kconfig.c:90: TINFO: Parsing kernel config '/lib/modules/6.12.0-218.el10.x86_64/build/.config'\ntst_test.c:1887: TINFO: Overall timeout per run is 0h 25m 00s\nuserfaultfd01.c:120: TPASS: Pagefault handled!\nuserfaultfd01.c:120: TPASS: Pagefault handled!\n\nSummary:\npassed   2\nfailed   0\nbroken   0\nskipped  0\nwarnings 0\nel10 x86_64 # valgrind $T\ntst_test.c:2059: TINFO: LTP version: 20260130\ntst_test.c:2062: TINFO: Tested kernel: 6.12.0-218.el10.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 31 08:07:36 EDT 2026 x86_64\ntst_kconfig.c:90: TINFO: Parsing kernel config '/lib/modules/6.12.0-218.el10.x86_64/build/.config'\ntst_test.c:1887: TINFO: Overall timeout per run is 0h 25m 00s\n==2747289== Syscall param ioctl(generic) points to uninitialised byte(s)\n==2747289==    at 0x4966D1F: ioctl (ioctl.c:36)\n==2747289==    by 0x40534C: run (userfaultfd01.c:113)\n==2747289==    by 0x41164C: run_tests (tst_test.c:1730)\n==2747289==    by 0x41164C: testrun (tst_test.c:1796)\n==2747289==    by 0x41164C: fork_testrun (tst_test.c:1936)\n==2747289==    by 0x413B74: tst_run_tcases (tst_test.c:2079)\n==2747289==    by 0x404E8D: main (tst_test.h:755)\n==2747289==  Address 0x1ffefff98a is on thread 1's stack\n==2747289==  in frame #1, created by run (userfaultfd01.c:93)\n==2747289== \n==2747289== \n==2747289== Exit program on first error (--exit-on-first-error=yes)\ntst_test.c:1953: TBROK: Child returned with 253\n\nSummary:\npassed   0\nfailed   0\nbroken   1\nskipped  0\nwarnings 0\nel10 x86_64 # \n\n\nHere is the updated patch (inline):\n\n\n---------------------------------8<------------------------------------\n$ cat 0001-userfaultfd01.c-Zero-initialize-the-uffdio_register-.patch \nFrom e1ed7e74551bfa51204e1f45fe0b3bb64f21bcae Mon Sep 17 00:00:00 2001\nFrom: Martin Cermak <mcermak@redhat.com>\nDate: Thu, 16 Apr 2026 11:15:38 +0200\nSubject: [PATCH] userfaultfd01.c: Zero-initialize the uffdio_register struct\n\nWithout this patch, valgrind complains when running userfaultfd01:\n\nel10 x86_64 # valgrind testcases/kernel/syscalls/userfaultfd/userfaultfd01\ntst_test.c:2059: TINFO: LTP version: 20260130\ntst_test.c:2062: TINFO: Tested kernel: 6.12.0-218.el10.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 31 08:07:36 EDT 2026 x86_64\ntst_kconfig.c:90: TINFO: Parsing kernel config '/lib/modules/6.12.0-218.el10.x86_64/build/.config'\ntst_test.c:1887: TINFO: Overall timeout per run is 0h 25m 00s\n==2748329== Syscall param ioctl(generic) points to uninitialised byte(s)\n==2748329==    at 0x4966D1F: ioctl (ioctl.c:36)\n==2748329==    by 0x40534C: run (userfaultfd01.c:113)\n==2748329==    by 0x41164C: run_tests (tst_test.c:1730)\n==2748329==    by 0x41164C: testrun (tst_test.c:1796)\n==2748329==    by 0x41164C: fork_testrun (tst_test.c:1936)\n==2748329==    by 0x413B74: tst_run_tcases (tst_test.c:2079)\n==2748329==    by 0x404E8D: main (tst_test.h:755)\n==2748329==  Address 0x1ffefff98a is on thread 1's stack\n==2748329==  in frame #1, created by run (userfaultfd01.c:93)\n==2748329==\n==2748329==\n==2748329== Exit program on first error (--exit-on-first-error=yes)\ntst_test.c:1953: TBROK: Child returned with 253\n\nIt would be sufficient to zero out the uffdio_register.ioctls member.\nThis patch inits whole the struct before use.\n---\n testcases/kernel/syscalls/userfaultfd/userfaultfd01.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/testcases/kernel/syscalls/userfaultfd/userfaultfd01.c b/testcases/kernel/syscalls/userfaultfd/userfaultfd01.c\nindex 7368d3863..bd955ffdd 100644\n--- a/testcases/kernel/syscalls/userfaultfd/userfaultfd01.c\n+++ b/testcases/kernel/syscalls/userfaultfd/userfaultfd01.c\n@@ -93,7 +93,7 @@ static void run(unsigned int i)\n {\n        pthread_t thr;\n        struct uffdio_api uffdio_api = {};\n-       struct uffdio_register uffdio_register;\n+       struct uffdio_register uffdio_register {};\n        struct tcase *tc = &tcases[i];\n \n        if (tc->kver == AFTER_5_11 && kver == BEFORE_5_11)","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=iTLIKX2M;\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=FPb0WaYy;\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 4fxCFR2FZZz1yG9\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 19:21:47 +1000 (AEST)","from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id F2DC43E2DE7\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 11:21:44 +0200 (CEST)","from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [217.194.8.2])\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 736CE3CDBD8\n for <ltp@lists.linux.it>; Thu, 16 Apr 2026 11:21:41 +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-2.smtp.seeweb.it (Postfix) with ESMTPS id B337C600836\n for <ltp@lists.linux.it>; Thu, 16 Apr 2026 11:21:38 +0200 (CEST)","from mail-wr1-f70.google.com (mail-wr1-f70.google.com\n [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-116-NmFJItU5PkC8WwYv03XS3Q-1; Thu, 16 Apr 2026 05:21:36 -0400","by mail-wr1-f70.google.com with SMTP id\n ffacd0b85a97d-43d76eeb303so4510180f8f.3\n for <ltp@lists.linux.it>; Thu, 16 Apr 2026 02:21:35 -0700 (PDT)","from lida.tpb.lab.eng.brq.redhat.com ([213.175.46.86])\n by smtp.gmail.com with ESMTPSA id\n ffacd0b85a97d-43ead3d5c8fsm12742765f8f.19.2026.04.16.02.21.33\n (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);\n Thu, 16 Apr 2026 02:21:33 -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=1776331305; h=date : to :\n message-id : references : mime-version : in-reply-to : subject :\n list-id : list-unsubscribe : list-archive : list-post : list-help :\n list-subscribe : from : reply-to : cc : content-type :\n content-transfer-encoding : sender : from;\n bh=OEVlpxmzUGfE2OqG/TfFZ9QsiTdEAkclLl2YmMjyPmQ=;\n b=iTLIKX2MsVKBFQyumi6gyWHNal9oNDF8tAk22HVjrsXsWSaUGP1tTCcAq2iwLBJT8gCkR\n fkRPyBmt69XBK0tFbmbpqXxgHnFtHwasNu0A6lHgRh4nM1KacgAv9s8BVVH7bo1fX77HO5P\n lph58wq+QLy/6X+6f+6GciIgV0V8Q2w=","v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1776331297;\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 in-reply-to:in-reply-to:references:references;\n bh=x8ESu070ULh+P8bhamzEYNaIVsDZaOMg32AKwdYIU2U=;\n b=FPb0WaYyBxwjKE80kZzsTSyRp/U1/ZMHzmdERgsPxCmq1qvCoucfe//rVNZjNBMna6wod3\n 8iug8pC2Vu3imDp9FbPUxL8c80BaVANzBei1EtzB1bABn13nPjgg+WLkWgZKs5d6eFr5B1\n M/Gpgvzq8F0cmzkSuIcTBnNFZXZbK3Y="],"X-MC-Unique":"NmFJItU5PkC8WwYv03XS3Q-1","X-Mimecast-MFC-AGG-ID":"NmFJItU5PkC8WwYv03XS3Q_1776331295","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776331295; x=1776936095;\n h=user-agent:in-reply-to:content-disposition:mime-version:references\n :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=x8ESu070ULh+P8bhamzEYNaIVsDZaOMg32AKwdYIU2U=;\n b=UrgknuD3PVWiFULsPQKd2CqY3r9701Xav01vJi/2+urc1d7Hmn+lrxlfg9+MuXD89D\n fzgd0QeM4dMHmqhSnWC1AxLg1Pn1k1lvs3q3luSoRLoxHNsoHPbP8Rlw6dI1bt/KLcKO\n a+QlAKnhIWjK5E6XiPlqFxBEIwcNaO/PP0/1h/X2CYRM67aYk8RMeWi/p+uxKV3smH6i\n q8+raPbdTMn5oxNu3mspxud61qTm8w1aiPrLvJJkzodUk9Jx4kmY3WY/W37Nq6nT0ttJ\n gJXp21h4gxmkDpebu+F+CX4WDCa1TyzZaj9Xrbw3IdIAefhyIabU4Xk/MCcSAWAfD3/j\n kPdQ==","X-Forwarded-Encrypted":"i=1;\n AFNElJ8OVa0uBM1gbD02399hOroNVx9s5SvtPmIUvjQMLq2pBSmwiRkDHdnwC9frQ4XZV2wtfeo=@lists.linux.it","X-Gm-Message-State":"AOJu0YzbDHHCrzwFc4y9kNi3o4RYrC9BIGPXbMFb6gj3Ivs82Jzsmamm\n rjFuT21HWLCDvWn+odM7nlNXHt6mgl7O3uNQtLvitI3MdRXZ/wLXTp/9CSMelkgUXsvoVNKNFUu\n f6FaN552fzFGn7mm0aq+OzyvOMjV8JUo+9d8INzwgT4dv7VozE5eL","X-Gm-Gg":"AeBDieuVZfWxsKA1UpFu+GYirCgHVkhVpd7U8rfnzag37PNT3LTGtJfGxR9j5nznrFi\n zY8MLWN6XGsEgMCmVK/vWoYKmollVK5kTNulLa49comUolsk7sVPQV8BgcamJaQJyZNcOPIfRuC\n q/N1MnRIa0perVU2nKCFtxN3b5YwuM9Q3TkQsD9o1jwIohUh2Rwvofm161kpH4ncyWX1VIEuqre\n O7iGBBqsVT+OSHAiwYy6NFUU3g51wEeVRnDsuZNHOCbAtRXy/fSi9Um1Jhl+G+AOJbNgM8lHYAD\n j5X8ps1rFJhqavX2Z6Q4M/9EamE6acihhRD5TdkaNRJxVdmLYVc6cIdvXwMRasHkVIjGmqTanEv\n D+Xromqipn8Z+47cpNIBDltuSiWO+VExZLg==","X-Received":["by 2002:a05:6000:290b:b0:43e:a703:3665 with SMTP id\n ffacd0b85a97d-43ea7033872mr14896966f8f.25.1776331294694;\n Thu, 16 Apr 2026 02:21:34 -0700 (PDT)","by 2002:a05:6000:290b:b0:43e:a703:3665 with SMTP id\n ffacd0b85a97d-43ea7033872mr14896900f8f.25.1776331294047;\n Thu, 16 Apr 2026 02:21:34 -0700 (PDT)"],"Date":"Thu, 16 Apr 2026 11:21:31 +0200","To":"Cyril Hrubis <chrubis@suse.cz>","Message-ID":"<20260416092131.kkbfd3cdi3tv7z7l@lida.tpb.lab.eng.brq.redhat.com>","References":"<20260414114758.7xtei7hyddxu2fic@lida.tpb.lab.eng.brq.redhat.com>\n <ad9l7MeJneX1LdCe@yuki.lan>","MIME-Version":"1.0","In-Reply-To":"<ad9l7MeJneX1LdCe@yuki.lan>","User-Agent":"NeoMutt/20180716","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"xagP8hjRak1OpHYusdE0UktGYlDtlnwK1Rr46q1YFp8_1776331295","X-Mimecast-Originator":"redhat.com","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,DMARC_PASS,SPF_HELO_PASS,SPF_PASS\n shortcircuit=no autolearn=disabled version=4.0.1","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on in-2.smtp.seeweb.it","X-Virus-Scanned":"clamav-milter 1.0.9 at in-2.smtp.seeweb.it","X-Virus-Status":"Clean","Subject":"Re: [LTP] Avoid syscall param ioctl(generic) points to\n uninitialised byte(s)","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, ltp@lists.linux.it","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>"}},{"id":3678070,"web_url":"http://patchwork.ozlabs.org/comment/3678070/","msgid":"<aeC01nkaA2jzhUVV@yuki.lan>","list_archive_url":null,"date":"2026-04-16T10:07:18","subject":"Re: [LTP] Avoid syscall param ioctl(generic) points to\n uninitialised byte(s)","submitter":{"id":8530,"url":"http://patchwork.ozlabs.org/api/people/8530/","name":"Cyril Hrubis","email":"chrubis@suse.cz"},"content":"Hi!\n> > > diff --git a/testcases/kernel/syscalls/userfaultfd/userfaultfd01.c b/testcases/kernel/syscalls/userfaultfd/userfaultfd01.c\n> > > index 7368d3863..d24766e7c 100644\n> > > --- a/testcases/kernel/syscalls/userfaultfd/userfaultfd01.c\n> > > +++ b/testcases/kernel/syscalls/userfaultfd/userfaultfd01.c\n> > > @@ -92,8 +92,8 @@ static void *handle_thread(void)\n> > >  static void run(unsigned int i)\n> > >  {\n> > >  \tpthread_t thr;\n> > > -\tstruct uffdio_api uffdio_api = {};\n> > > -\tstruct uffdio_register uffdio_register;\n> > > +\tstruct uffdio_api uffdio_api = {0, };\n> > > +\tstruct uffdio_register uffdio_register = {0, };\n> > \n> > Given that we were using = {}; in the code before can we keep using that\n> > and for all instances?\n> \n> I saw both initializers in the LTP source, see `$ grep -rIn  '= {};'` and\n> `$ grep -rIn  '= { 0, };'`.  The latter one is compliant with older standards.\n> But to keep the coding style within this file, I've updated the initializer.\n> \n> > Also I assume the problem is the ioctls field in the uffdio_api\n> > structure that is not initialized beacuse is supposed to be set by\n> > kernel before returning into userspace. Should valgrind warn about such\n> > cases?\n> \n> You are right that zeroing just this uffdio_register.ioctls = 0; is suffi-\n> cient to to avoid the valgrind complaint.  Zeroing whole the struct seems\n> syntactically more concise and also correct.\n\nThat's not what I was trying to point out. Some fields of structures\npassed to ioctls are output-only. The question is if valgrind should\nwarn if we do not set output only field in such structure?","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=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256\n header.s=susede2_rsa header.b=u+KNim2e;\n\tdkim=fail reason=\"signature verification failed\" header.d=suse.cz\n header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519\n header.b=PSq3BnSc;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key)\n header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa\n header.b=u+KNim2e;\n\tdkim=neutral header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=PSq3BnSc;\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)","smtp-out2.suse.de;\n dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=u+KNim2e;\n dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=PSq3BnSc"],"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 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fxDFt155Vz1yG9\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 20:07:13 +1000 (AEST)","from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id AC5483E2DE7\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 12:07:10 +0200 (CEST)","from in-5.smtp.seeweb.it (in-5.smtp.seeweb.it\n [IPv6:2001:4b78:1:20::5])\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 3A2023DCD6A\n for <ltp@lists.linux.it>; Thu, 16 Apr 2026 12:07:05 +0200 (CEST)","from smtp-out2.suse.de (smtp-out2.suse.de\n [IPv6:2a07:de40:b251:101:10:150:64:2])\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-5.smtp.seeweb.it (Postfix) with ESMTPS id 7C9D76001EE\n for <ltp@lists.linux.it>; Thu, 16 Apr 2026 12:07:05 +0200 (CEST)","from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org\n [IPv6:2a07:de40:b281:104:10:150:64:97])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by smtp-out2.suse.de (Postfix) with ESMTPS id 3C1E05BD14;\n Thu, 16 Apr 2026 10:07:04 +0000 (UTC)","from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 2B9AD4BEDD;\n Thu, 16 Apr 2026 10:07:04 +0000 (UTC)","from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])\n by imap1.dmz-prg2.suse.org with ESMTPSA id gFVqCci04GnyEQAAD6G6ig\n (envelope-from <chrubis@suse.cz>); Thu, 16 Apr 2026 10:07:04 +0000"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_rsa;\n t=1776334024;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n in-reply-to:in-reply-to:references:references;\n bh=Mppv07pqdwTD/ibhMEtyQxrQEqW5Expq0E6DPW8ArZk=;\n b=u+KNim2eyYG1GtU9xAhLy8hJ/T1ag2Zkk5BGPlqR6QABIPFvWCCWlDyUWQKo7t9P0jzicU\n 0a21pqL9V8thjsHWZAsNc76NF+UrrQQJOPEuBcSyz+btcrTavg2S/x0gK+/MKooRFE+EtD\n OPXb4fCAABf3KVG9k1WJpXFOv1AZGq8=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_ed25519; t=1776334024;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n in-reply-to:in-reply-to:references:references;\n bh=Mppv07pqdwTD/ibhMEtyQxrQEqW5Expq0E6DPW8ArZk=;\n b=PSq3BnSceUsnAH0wgPEi5UV7ZZ22OrqUGKz3utku3gxU7CTP+XubjUAZ/kroQ/oykY4SXJ\n KElEU7NMGr5krTCQ==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_rsa;\n t=1776334024;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n in-reply-to:in-reply-to:references:references;\n bh=Mppv07pqdwTD/ibhMEtyQxrQEqW5Expq0E6DPW8ArZk=;\n b=u+KNim2eyYG1GtU9xAhLy8hJ/T1ag2Zkk5BGPlqR6QABIPFvWCCWlDyUWQKo7t9P0jzicU\n 0a21pqL9V8thjsHWZAsNc76NF+UrrQQJOPEuBcSyz+btcrTavg2S/x0gK+/MKooRFE+EtD\n OPXb4fCAABf3KVG9k1WJpXFOv1AZGq8=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_ed25519; t=1776334024;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n in-reply-to:in-reply-to:references:references;\n bh=Mppv07pqdwTD/ibhMEtyQxrQEqW5Expq0E6DPW8ArZk=;\n b=PSq3BnSceUsnAH0wgPEi5UV7ZZ22OrqUGKz3utku3gxU7CTP+XubjUAZ/kroQ/oykY4SXJ\n KElEU7NMGr5krTCQ=="],"Date":"Thu, 16 Apr 2026 12:07:18 +0200","From":"Cyril Hrubis <chrubis@suse.cz>","To":"Martin Cermak <mcermak@redhat.com>","Message-ID":"<aeC01nkaA2jzhUVV@yuki.lan>","References":"<20260414114758.7xtei7hyddxu2fic@lida.tpb.lab.eng.brq.redhat.com>\n <ad9l7MeJneX1LdCe@yuki.lan>\n <20260416092131.kkbfd3cdi3tv7z7l@lida.tpb.lab.eng.brq.redhat.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20260416092131.kkbfd3cdi3tv7z7l@lida.tpb.lab.eng.brq.redhat.com>","X-Rspamd-Action":"no action","X-Rspamd-Server":"rspamd2.dmz-prg2.suse.org","X-Spamd-Result":"default: False [-4.51 / 50.00]; BAYES_HAM(-3.00)[100.00%];\n NEURAL_HAM_LONG(-1.00)[-1.000];\n NEURAL_HAM_SHORT(-0.20)[-1.000];\n R_DKIM_ALLOW(-0.20)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519];\n MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[];\n DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519];\n FUZZY_RATELIMITED(0.00)[rspamd.com]; ARC_NA(0.00)[];\n TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_SOME(0.00)[];\n MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[];\n RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.cz:+];\n RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[];\n SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from];\n DWL_DNSWL_BLOCKED(0.00)[suse.cz:dkim]; MISSING_XM_UA(0.00)[];\n RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_THREE(0.00)[3];\n DBL_BLOCKED_OPENRESOLVER(0.00)[yuki.lan:mid, suse.cz:dkim, suse.cz:email,\n imap1.dmz-prg2.suse.org:helo, imap1.dmz-prg2.suse.org:rdns]","X-Rspamd-Queue-Id":"3C1E05BD14","X-Spam-Score":"-4.51","X-Spam-Level":"","X-Spam-Status":"No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID,\n DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS shortcircuit=no\n autolearn=disabled version=4.0.1","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on in-5.smtp.seeweb.it","X-Virus-Scanned":"clamav-milter 1.0.9 at in-5.smtp.seeweb.it","X-Virus-Status":"Clean","Subject":"Re: [LTP] Avoid syscall param ioctl(generic) points to\n uninitialised byte(s)","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>","Cc":"valgrind-developers@lists.sourceforge.net, ltp@lists.linux.it","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>"}},{"id":3678148,"web_url":"http://patchwork.ozlabs.org/comment/3678148/","msgid":"<20260416123923.3xxfhyxztcw2rqth@lida.tpb.lab.eng.brq.redhat.com>","list_archive_url":null,"date":"2026-04-16T12:39:23","subject":"Re: [LTP] Avoid syscall param ioctl(generic) points to\n uninitialised byte(s)","submitter":{"id":88822,"url":"http://patchwork.ozlabs.org/api/people/88822/","name":"Martin Cermak","email":"mcermak@redhat.com"},"content":"On  Thu  2026-04-16  12:07 , Cyril Hrubis wrote:\n> Hi!\n> > > > diff --git a/testcases/kernel/syscalls/userfaultfd/userfaultfd01.c b/testcases/kernel/syscalls/userfaultfd/userfaultfd01.c\n> > > > index 7368d3863..d24766e7c 100644\n> > > > --- a/testcases/kernel/syscalls/userfaultfd/userfaultfd01.c\n> > > > +++ b/testcases/kernel/syscalls/userfaultfd/userfaultfd01.c\n> > > > @@ -92,8 +92,8 @@ static void *handle_thread(void)\n> > > >  static void run(unsigned int i)\n> > > >  {\n> > > >  \tpthread_t thr;\n> > > > -\tstruct uffdio_api uffdio_api = {};\n> > > > -\tstruct uffdio_register uffdio_register;\n> > > > +\tstruct uffdio_api uffdio_api = {0, };\n> > > > +\tstruct uffdio_register uffdio_register = {0, };\n> > > \n> > > Given that we were using = {}; in the code before can we keep using that\n> > > and for all instances?\n> > \n> > I saw both initializers in the LTP source, see `$ grep -rIn  '= {};'` and\n> > `$ grep -rIn  '= { 0, };'`.  The latter one is compliant with older standards.\n> > But to keep the coding style within this file, I've updated the initializer.\n> > \n> > > Also I assume the problem is the ioctls field in the uffdio_api\n> > > structure that is not initialized beacuse is supposed to be set by\n> > > kernel before returning into userspace. Should valgrind warn about such\n> > > cases?\n> > \n> > You are right that zeroing just this uffdio_register.ioctls = 0; is suffi-\n> > cient to to avoid the valgrind complaint.  Zeroing whole the struct seems\n> > syntactically more concise and also correct.\n> \n> That's not what I was trying to point out. Some fields of structures\n> passed to ioctls are output-only. The question is if valgrind should\n> warn if we do not set output only field in such structure?\n\nYou are very right.  Curent version of valgrind doesn't recognize\nUFFDIO_REGISTER, and treats this ioctl as unknown ioctl via\nML_(PRE_unknown_ioctl)(tid, ARG2, ARG3);  Good point, thanks!\n\nMartin","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=f/yzS4Fj;\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=dEtE7Gcd;\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 4fxHdk4w7Wz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 22:39:38 +1000 (AEST)","from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id 1A2753E2926\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 14:39:36 +0200 (CEST)","from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [217.194.8.6])\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 323593C1E06\n for <ltp@lists.linux.it>; Thu, 16 Apr 2026 14:39:32 +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-6.smtp.seeweb.it (Postfix) with ESMTPS id 9BC021400425\n for <ltp@lists.linux.it>; Thu, 16 Apr 2026 14:39:29 +0200 (CEST)","from mail-wr1-f70.google.com (mail-wr1-f70.google.com\n [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-271-J2LJ0TolObO7bQerv6Angw-1; Thu, 16 Apr 2026 08:39:27 -0400","by mail-wr1-f70.google.com with SMTP id\n ffacd0b85a97d-43cfb72377bso6871325f8f.2\n for <ltp@lists.linux.it>; Thu, 16 Apr 2026 05:39:27 -0700 (PDT)","from lida.tpb.lab.eng.brq.redhat.com ([213.175.46.86])\n by smtp.gmail.com with ESMTPSA id\n ffacd0b85a97d-43ead33d6d3sm13734526f8f.8.2026.04.16.05.39.24\n (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);\n Thu, 16 Apr 2026 05:39:25 -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=1776343176; h=date : to :\n message-id : references : mime-version : in-reply-to : subject :\n list-id : list-unsubscribe : list-archive : list-post : list-help :\n list-subscribe : from : reply-to : cc : content-type :\n content-transfer-encoding : sender : from;\n bh=qaouHPOn0EX4nKLhketYZAffQFfFOx1Y8pZ93kDKflg=;\n b=f/yzS4FjyfBeLBlQ/wFTb5ilKWrx+X+sNKRILmNcCFhTORdqBHvyba0UdQSwH870WyHdA\n aJCpE3S6FFGn7/1JAwhXplbZBA4c+IU8ZRceT23J6/xD4NSYSdQv9do/1ufXlwh1v5+mrwU\n NyX011igZVrgKOY7q1RDhGLOQIFdFbA=","v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1776343168;\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 in-reply-to:in-reply-to:references:references;\n bh=DaWqQ48wN7QhtHRKl6kWvik41UG+L5WmsfpUGCewtWY=;\n b=dEtE7GcdTwO+LbqvzfLSH97alRMJQ5fabNVUR6gNhRcJTRZ60sS3ZOGtU+ObCcQCFzW43G\n fNOqMtdFh3EzvVWEFH2sKHnCg2pwtYMiA9uxxpEWcsaXZ6qA7qLBpdNV098ClSoHKChdKs\n 6wRGCy8sb8f18JSqf9N99eL4DQU2/RY="],"X-MC-Unique":"J2LJ0TolObO7bQerv6Angw-1","X-Mimecast-MFC-AGG-ID":"J2LJ0TolObO7bQerv6Angw_1776343166","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776343166; x=1776947966;\n h=user-agent:in-reply-to:content-disposition:mime-version:references\n :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=DaWqQ48wN7QhtHRKl6kWvik41UG+L5WmsfpUGCewtWY=;\n b=ZR5QPwqwuo9eaDxzVNdOukvJ261+7qVCV2B0xi0Tbj26UOghj/Mn4YWTw5t3iRbLHt\n fEqdFnq9tZVuKpDJ2D52Pb1hYBz8efxpkxeYPVlWtY6Qots+BZKP2t76/CuO3jf+JFzV\n SD1j/cvIlOfMnyrH352W13wKbzsirdKk9USSmXlW8dE/CM46M+AnFUPbMugY3NuD4swL\n wajy4X5GOV1tCVlCHjWjS2WVTVAcipeiWXvXHZnwOAHoCn1ZN2XX4FPx7W85tuzzjpEs\n kkyj6FLLZ9LpZuDqRre9Gg9B/+7x4NNkkLqg6r5eZ8L/EhGXIB8WS5GIRxjeqxLYGRG2\n V6KA==","X-Forwarded-Encrypted":"i=1;\n AFNElJ9tpuUd9StcdsKccUyTfk1bTZRKvUw0+h5FSePFh7f0d7CEf8059QexjmGSRmOWLOVQgOQ=@lists.linux.it","X-Gm-Message-State":"AOJu0YzaFcWlaFLK46FuKV7YrS2dZen1/AicZutgAcqCXfQM/gaU8nTd\n 0zp84r4dzsKr/i8VY/IIvXGZ1131gmBhj5b+VZRnzOxJvJgIm9UuaLfChH+hvYY/aHQIhiZBj4Y\n xu6A2GEk4jLG3kaR3TwaZ1ld9gW11TRrm86nxOR6jTjsL9og/XkqM1WBjt3a5","X-Gm-Gg":"AeBDiethg/joohMJ9kpYFmwVHpx61K8aqv+yMvTGTy2DFfarANKEDg4kN8QkQEFGiFl\n x/6DEX2Ydd1NGSiVK4TNtemii9H87t2nteYPp0p930u/PGJ024J70fug3nXd5m8NSmj8ZNyTN9e\n dfawjYfrC+QpUCi/s2KllPJPsINrSsI4k4cQRTslzqmdlarpXj9uxwFYhzOVJVcXPxJloSzWC1G\n LBpQqg04fVCXnNH2ifoWl3J3ztK5wyX2DSVGR+hERoaV3FskYF6VivpAnLMOxZOwoCVQwQJXqF9\n V17y5tebsgHl9HwE+kBdeXuR5DZ38UZHdf1trk5k6V61pimnTibMMNJwAdUoC0Jdy0XQKh/qGL7\n lAb7f1g2LTCcxg5YglcnHISfgL/fz9DVuzg==","X-Received":["by 2002:a5d:5d84:0:b0:43b:4136:1e76 with SMTP id\n ffacd0b85a97d-43d642b6a47mr42546110f8f.29.1776343166125;\n Thu, 16 Apr 2026 05:39:26 -0700 (PDT)","by 2002:a5d:5d84:0:b0:43b:4136:1e76 with SMTP id\n ffacd0b85a97d-43d642b6a47mr42546055f8f.29.1776343165491;\n Thu, 16 Apr 2026 05:39:25 -0700 (PDT)"],"Date":"Thu, 16 Apr 2026 14:39:23 +0200","To":"Cyril Hrubis <chrubis@suse.cz>","Message-ID":"<20260416123923.3xxfhyxztcw2rqth@lida.tpb.lab.eng.brq.redhat.com>","References":"<20260414114758.7xtei7hyddxu2fic@lida.tpb.lab.eng.brq.redhat.com>\n <ad9l7MeJneX1LdCe@yuki.lan>\n <20260416092131.kkbfd3cdi3tv7z7l@lida.tpb.lab.eng.brq.redhat.com>\n <aeC01nkaA2jzhUVV@yuki.lan>","MIME-Version":"1.0","In-Reply-To":"<aeC01nkaA2jzhUVV@yuki.lan>","User-Agent":"NeoMutt/20180716","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"lIau2chaz2jkP_3sRwZVLP8QWLime0U2NTgGtEoRoo4_1776343166","X-Mimecast-Originator":"redhat.com","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-6.smtp.seeweb.it","X-Virus-Scanned":"clamav-milter 1.0.9 at in-6.smtp.seeweb.it","X-Virus-Status":"Clean","Subject":"Re: [LTP] Avoid syscall param ioctl(generic) points to\n uninitialised byte(s)","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, ltp@lists.linux.it","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>"}}]