[{"id":3683995,"web_url":"http://patchwork.ozlabs.org/comment/3683995/","msgid":"<209b0327-64b4-4a58-9ee1-19ec693c8105@suse.cz>","list_archive_url":null,"date":"2026-04-29T11:15:12","subject":"Re: [LTP] [PATCH 2/2] ima_violations.sh: ima_mmap.c: Replace sleep\n with checkpoints","submitter":{"id":77472,"url":"http://patchwork.ozlabs.org/api/people/77472/","name":"Martin Doucha","email":"mdoucha@suse.cz"},"content":"Hi,\nfor both patches:\n\nReviewed-by: Martin Doucha <mdoucha@suse.cz>\n\nOn 4/28/26 18:10, Petr Vorel wrote:\n> Using checkpoints is a proper way in LTP new API [1] to avoid races and\n> waste of time.  It reduces 3 sec sleep in ima_mmap.c and 1 sec sleep in\n> ima_violations.sh with just checkpoints.\n> \n> NOTE: tst_reinit() is really needed instead of .needs_checkpoints = 1\n> as documented in Shell-Test-API.asciidoc.\n> \n> [1] https://people.kernel.org/metan/why-sleep-is-almost-never-acceptable-in-tests\n> \n> Fixes: 0e4cbf753f (\"security/ima: Rewrite tests into new API + fixes\")\n> Suggested-by: Cyril Hrubis <chrubis@suse.cz>\n> Signed-off-by: Petr Vorel <pvorel@suse.cz>\n> ---\n>   testcases/kernel/security/integrity/ima/src/ima_mmap.c     | 7 ++++---\n>   .../kernel/security/integrity/ima/tests/ima_violations.sh  | 6 +++++-\n>   2 files changed, 9 insertions(+), 4 deletions(-)\n> \n> diff --git a/testcases/kernel/security/integrity/ima/src/ima_mmap.c b/testcases/kernel/security/integrity/ima/src/ima_mmap.c\n> index 8596809ef4..09b22fd4f4 100644\n> --- a/testcases/kernel/security/integrity/ima/src/ima_mmap.c\n> +++ b/testcases/kernel/security/integrity/ima/src/ima_mmap.c\n> @@ -9,7 +9,6 @@\n>   \n>   #include \"tst_test.h\"\n>   \n> -#define SLEEP_AFTER_CLOSE 3\n>   #define MMAPSIZE 1024\n>   \n>   static char *filename;\n> @@ -35,8 +34,10 @@ static void run(void)\n>   \tfile = SAFE_MMAP(NULL, MMAPSIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);\n>   \tSAFE_CLOSE(fd);\n>   \n> -\ttst_res(TINFO, \"sleep %ds\", SLEEP_AFTER_CLOSE);\n> -\tsleep(SLEEP_AFTER_CLOSE);\n> +\ttst_reinit();\n> +\tTST_CHECKPOINT_WAIT(0);\n> +\t/* keep running until ima_violations.sh open and close file */\n> +\tTST_CHECKPOINT_WAKE_AND_WAIT(0);\n>   \n>   \ttst_res(TPASS, \"test completed\");\n>   }\n> diff --git a/testcases/kernel/security/integrity/ima/tests/ima_violations.sh b/testcases/kernel/security/integrity/ima/tests/ima_violations.sh\n> index 0c03c30786..d7dcd077b4 100755\n> --- a/testcases/kernel/security/integrity/ima/tests/ima_violations.sh\n> +++ b/testcases/kernel/security/integrity/ima/tests/ima_violations.sh\n> @@ -8,6 +8,7 @@\n>   # test[4-6] test 6.15 commit 5b3cd801155f (\"ima: limit the number of open-writers integrity violations\")\n>   # test[7-8] test 6.15 commit a414016218ca (\"ima: limit the number of ToMToU integrity violations\")\n>   \n> +TST_NEEDS_CHECKPOINTS=1\n>   TST_SETUP=\"setup\"\n>   TST_CLEANUP=\"cleanup\"\n>   TST_CNT=8\n> @@ -171,12 +172,15 @@ test3()\n>   \n>   \tima_mmap -f $FILE &\n>   \tpid=$!\n> +\n>   \t# wait for violations appear in logs\n> -\ttst_sleep 1s\n> +\tTST_CHECKPOINT_WAKE_AND_WAIT 0\n>   \n>   \topen_file_read\n>   \tclose_file_read\n>   \n> +\tTST_CHECKPOINT_WAKE 0\n> +\n>   \tvalidate $num_violations $count $search\n>   \n>   \t# wait for ima_mmap to exit, so we can umount","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 4g5F8X6w6Fz1yHZ\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 21:15:24 +1000 (AEST)","from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id 6E5733E2D4D\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 13:15:22 +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 D6A083E2206\n for <ltp@lists.linux.it>; Wed, 29 Apr 2026 13:15:18 +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 278D7600942\n for <ltp@lists.linux.it>; Wed, 29 Apr 2026 13:15:17 +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 70A665BD52;\n Wed, 29 Apr 2026 11:15:17 +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 5FBE6593B0;\n Wed, 29 Apr 2026 11:15:17 +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 A9MLF0Xo8WkwIgAAD6G6ig\n (envelope-from <mdoucha@suse.cz>); Wed, 29 Apr 2026 11:15:17 +0000"],"Message-ID":"<209b0327-64b4-4a58-9ee1-19ec693c8105@suse.cz>","Date":"Wed, 29 Apr 2026 13:15:12 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","To":"Petr Vorel <pvorel@suse.cz>, ltp@lists.linux.it","References":"<20260428161034.947614-1-pvorel@suse.cz>\n <20260428161034.947614-2-pvorel@suse.cz>","Content-Language":"en-US","From":"Martin Doucha <mdoucha@suse.cz>","Autocrypt":"addr=mdoucha@suse.cz; keydata=\n xsFNBGaqVbgBEACpipjj9sTO/5/DFIIYr/HiC9GEAHpmU+jzRraYh7Lcx11XDVZ00nWN5AlO\n GL+UxpvYs9cInmLGVav2gK36FxAUsxl99OCQjM45OrQHVkyDPbeZzw7NSvEblv1gaydu/YKk\n ktwuO3yzjtb5X1hiDLYULorpCYGz8CXnkkoYm79fa0g+rTivJLMaMSnO2rDcp4EsSofBE/is\n UcG4e2BIUKQE2d+ogrbHYkmbt9jQZnyipCDm61yEiNZSKR9ktbQ8IvevCpoZJu+2EFRRhDsv\n 3lvNKmlJpa+MkZ/18u/OX5zZwyP5wS9SYGIAW9236R4qoFinYYlA1LeHjJtVLq2cVjIyo9Wm\n ZG5BPsKLC31H4dzGUcvBTU0D/V5dowb5Qnt0kPAb7cmKC3vNrVB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WP8bMadbTMyE\n uVTsRqzKKRPPhp8dQX7DnPzfFixvBoSbodNaBL+R432Ljl9CvXkDDLymuLyzxPdhrQ3mf02T\n jq1nHXCXFm8zC3bRvCv7k8m/PLBY956/8OPRt3ePxSFgO/Pf3FKFTKIqHDiV3dAxAO7Ibuii\n Zr5AzfbRpdA7Gt8afL/yTujen+skhuVentxwhoLw/WqqgZefK9CUXTv5A9HzXuhsgTQPPzBn\n qsL+5eFNf1QBdRa6lInbwbH0vgHZEF04mK7Ac4dsXGU+cMsHEUaNhrEBoR0cu/NFfmlwpWqO\n sOf6M5s7RKNzreVXkrlArE+x29swkXZbxFoXuahA2iykPyyCAgPz0ikRI+374jXVAtbZAAut\n HD1KfuCahogFT4upYpOUl26KquywYOGciSan4jHuqXIVCQzjYd/zOzsL7hTJiteae/oOg4m5\n i8BUUzanmo3FPwFBcjEn4nDvkw/YEo5gtQZmrxOHQAdSHdyqtFgRxu4+w3JFmnQvkResUgm3 ag==","In-Reply-To":"<20260428161034.947614-2-pvorel@suse.cz>","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-Server":"rspamd2.dmz-prg2.suse.org","X-Spamd-Result":"default: False [-4.00 / 50.00];\n\tREPLY(-4.00)[]","X-Rspamd-Queue-Id":"70A665BD52","X-Rspamd-Action":"no action","X-Spam-Score":"-4.00","X-Spam-Level":"","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] [PATCH 2/2] ima_violations.sh: ima_mmap.c: Replace sleep\n with checkpoints","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":"linux-integrity@vger.kernel.org","Content-Transfer-Encoding":"7bit","Content-Type":"text/plain; charset=\"us-ascii\"; Format=\"flowed\"","Errors-To":"ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it","Sender":"\"ltp\" <ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>"}},{"id":3684015,"web_url":"http://patchwork.ozlabs.org/comment/3684015/","msgid":"<20260429120030.GA993265@pevik>","list_archive_url":null,"date":"2026-04-29T12:00:30","subject":"Re: [LTP] [PATCH 2/2] ima_violations.sh: ima_mmap.c: Replace sleep\n with checkpoints","submitter":{"id":70792,"url":"http://patchwork.ozlabs.org/api/people/70792/","name":"Petr Vorel","email":"pvorel@suse.cz"},"content":"Hi Martin, all,\n\n> Hi,\n> for both patches:\n\n> Reviewed-by: Martin Doucha <mdoucha@suse.cz>\n\nThanks for review, patchset merged.\n\nKind regards,\nPetr\n\n> On 4/28/26 18:10, Petr Vorel wrote:\n> > Using checkpoints is a proper way in LTP new API [1] to avoid races and\n> > waste of time.  It reduces 3 sec sleep in ima_mmap.c and 1 sec sleep in\n> > ima_violations.sh with just checkpoints.\n\n> > NOTE: tst_reinit() is really needed instead of .needs_checkpoints = 1\n> > as documented in Shell-Test-API.asciidoc.\n\n> > [1] https://people.kernel.org/metan/why-sleep-is-almost-never-acceptable-in-tests\n\n> > Fixes: 0e4cbf753f (\"security/ima: Rewrite tests into new API + fixes\")\n> > Suggested-by: Cyril Hrubis <chrubis@suse.cz>\n> > Signed-off-by: Petr Vorel <pvorel@suse.cz>\n> > ---\n> >   testcases/kernel/security/integrity/ima/src/ima_mmap.c     | 7 ++++---\n> >   .../kernel/security/integrity/ima/tests/ima_violations.sh  | 6 +++++-\n> >   2 files changed, 9 insertions(+), 4 deletions(-)\n\n> > diff --git a/testcases/kernel/security/integrity/ima/src/ima_mmap.c b/testcases/kernel/security/integrity/ima/src/ima_mmap.c\n> > index 8596809ef4..09b22fd4f4 100644\n> > --- a/testcases/kernel/security/integrity/ima/src/ima_mmap.c\n> > +++ b/testcases/kernel/security/integrity/ima/src/ima_mmap.c\n> > @@ -9,7 +9,6 @@\n> >   #include \"tst_test.h\"\n> > -#define SLEEP_AFTER_CLOSE 3\n> >   #define MMAPSIZE 1024\n> >   static char *filename;\n> > @@ -35,8 +34,10 @@ static void run(void)\n> >   \tfile = SAFE_MMAP(NULL, MMAPSIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);\n> >   \tSAFE_CLOSE(fd);\n> > -\ttst_res(TINFO, \"sleep %ds\", SLEEP_AFTER_CLOSE);\n> > -\tsleep(SLEEP_AFTER_CLOSE);\n> > +\ttst_reinit();\n> > +\tTST_CHECKPOINT_WAIT(0);\n> > +\t/* keep running until ima_violations.sh open and close file */\n> > +\tTST_CHECKPOINT_WAKE_AND_WAIT(0);\n> >   \ttst_res(TPASS, \"test completed\");\n> >   }\n> > diff --git a/testcases/kernel/security/integrity/ima/tests/ima_violations.sh b/testcases/kernel/security/integrity/ima/tests/ima_violations.sh\n> > index 0c03c30786..d7dcd077b4 100755\n> > --- a/testcases/kernel/security/integrity/ima/tests/ima_violations.sh\n> > +++ b/testcases/kernel/security/integrity/ima/tests/ima_violations.sh\n> > @@ -8,6 +8,7 @@\n> >   # test[4-6] test 6.15 commit 5b3cd801155f (\"ima: limit the number of open-writers integrity violations\")\n> >   # test[7-8] test 6.15 commit a414016218ca (\"ima: limit the number of ToMToU integrity violations\")\n> > +TST_NEEDS_CHECKPOINTS=1\n> >   TST_SETUP=\"setup\"\n> >   TST_CLEANUP=\"cleanup\"\n> >   TST_CNT=8\n> > @@ -171,12 +172,15 @@ test3()\n> >   \tima_mmap -f $FILE &\n> >   \tpid=$!\n> > +\n> >   \t# wait for violations appear in logs\n> > -\ttst_sleep 1s\n> > +\tTST_CHECKPOINT_WAKE_AND_WAIT 0\n> >   \topen_file_read\n> >   \tclose_file_read\n> > +\tTST_CHECKPOINT_WAKE 0\n> > +\n> >   \tvalidate $num_violations $count $search\n> >   \t# wait for ima_mmap to exit, so we can umount","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=S4bxcTXk;\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=pntH6DiL;\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=hs9bTTM+;\n\tdkim=neutral header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=ofV+Aeos;\n\tdkim-atps=neutral","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-out1.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 4g5G8w4HKNz1yHZ\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 22:00:47 +1000 (AEST)","from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id 36F183E210C\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 14:00:45 +0200 (CEST)","from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it\n [IPv6:2001:4b78:1:20::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 7E2803E12DF\n for <ltp@lists.linux.it>; Wed, 29 Apr 2026 14:00:39 +0200 (CEST)","from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130])\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 BD83E1400C73\n for <ltp@lists.linux.it>; Wed, 29 Apr 2026 14:00:38 +0200 (CEST)","from imap1.dmz-prg2.suse.org (unknown [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-out1.suse.de (Postfix) with ESMTPS id 8E7EF6A867;\n Wed, 29 Apr 2026 12:00:32 +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 60697593B0;\n Wed, 29 Apr 2026 12:00:32 +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 /B3bFODy8WlcTwAAD6G6ig\n (envelope-from <pvorel@suse.cz>); Wed, 29 Apr 2026 12:00:32 +0000"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_rsa;\n t=1777464033;\n h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to:\n cc:cc:mime-version:mime-version:content-type:content-type:\n in-reply-to:in-reply-to:references:references;\n bh=tz2WAb/fW8M+Pe6f3LjxvCxoJDHXETTFeISIiiEJgvA=;\n b=S4bxcTXkTgAqqcQffMVUAX3MYKoAVvZfjvMOTMGQ+i/ljppJcvcpUX74X0jqYyPMsnymbA\n JozxN3SD7B2WQZ5IIlrkVrOMH1fE88BaD7uJ2SN5oEYuXU56NobfPq34hcYNBmi3nNfJPq\n AChX+rkMPTRhyx13k3uXXZiE1xdpkpU=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_ed25519; t=1777464033;\n h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to:\n cc:cc:mime-version:mime-version:content-type:content-type:\n in-reply-to:in-reply-to:references:references;\n bh=tz2WAb/fW8M+Pe6f3LjxvCxoJDHXETTFeISIiiEJgvA=;\n b=pntH6DiL1Mkaw+Qxa4D7DUpArIFmxz8THH60znML88ku7ZhQ+OMwa+7PgFCv0Wmn5Hoxxi\n R0wgKHxrL8A/JgDg==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_rsa;\n t=1777464032;\n h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to:\n cc:cc:mime-version:mime-version:content-type:content-type:\n in-reply-to:in-reply-to:references:references;\n bh=tz2WAb/fW8M+Pe6f3LjxvCxoJDHXETTFeISIiiEJgvA=;\n b=hs9bTTM+pWfhR9P5C2FJ31keLCe+MRPoSkYEuzFTFGSInwm8tJ/xN7DzvoFWMn6OLwDmCd\n ANKtq1krbw26d/A1oxkxUC1NLL2IUg+uTlovqMdPO/6P3j/zwqFAXwquTVbeNDRu2z2l0/\n wPfnilFFWpNj88gfJxsVLw9lrUpMWC8=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_ed25519; t=1777464032;\n h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to:\n cc:cc:mime-version:mime-version:content-type:content-type:\n in-reply-to:in-reply-to:references:references;\n bh=tz2WAb/fW8M+Pe6f3LjxvCxoJDHXETTFeISIiiEJgvA=;\n b=ofV+AeoslEjK1UBWhzW/t0/m/X3y+UsjP/j80WebTSk1KlhrQqDEvbL7j/8mIuUBH/1esW\n E7XNGKWBVn7gQSCw=="],"Date":"Wed, 29 Apr 2026 14:00:30 +0200","From":"Petr Vorel <pvorel@suse.cz>","To":"Martin Doucha <mdoucha@suse.cz>","Message-ID":"<20260429120030.GA993265@pevik>","References":"<20260428161034.947614-1-pvorel@suse.cz>\n <20260428161034.947614-2-pvorel@suse.cz>\n <209b0327-64b4-4a58-9ee1-19ec693c8105@suse.cz>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<209b0327-64b4-4a58-9ee1-19ec693c8105@suse.cz>","X-Spamd-Result":"default: False [-7.50 / 50.00]; REPLY(-4.00)[];\n BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000];\n MID_RHS_NOT_FQDN(0.50)[]; HAS_REPLYTO(0.30)[pvorel@suse.cz];\n NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain];\n TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+];\n RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[];\n MISSING_XM_UA(0.00)[]; RCVD_TLS_ALL(0.00)[];\n RCPT_COUNT_THREE(0.00)[4]; FROM_EQ_ENVFROM(0.00)[];\n FROM_HAS_DN(0.00)[];\n DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519];\n DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.cz:replyto,suse.cz:email];\n RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[];\n REPLYTO_EQ_FROM(0.00)[]","X-Spam-Score":"-7.50","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-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] [PATCH 2/2] ima_violations.sh: ima_mmap.c: Replace sleep\n with checkpoints","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>","Reply-To":"Petr Vorel <pvorel@suse.cz>","Cc":"linux-integrity@vger.kernel.org, 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":3684560,"web_url":"http://patchwork.ozlabs.org/comment/3684560/","msgid":"<afMd82ykYhNz9Msy@yuki.lan>","list_archive_url":null,"date":"2026-04-30T09:16:35","subject":"Re: [LTP] [PATCH 2/2] ima_violations.sh: ima_mmap.c: Replace sleep\n with checkpoints","submitter":{"id":8530,"url":"http://patchwork.ozlabs.org/api/people/8530/","name":"Cyril Hrubis","email":"chrubis@suse.cz"},"content":"Hi!\n> Using checkpoints is a proper way in LTP new API [1] to avoid races and\n> waste of time.  It reduces 3 sec sleep in ima_mmap.c and 1 sec sleep in\n> ima_violations.sh with just checkpoints.\n> \n> NOTE: tst_reinit() is really needed instead of .needs_checkpoints = 1\n> as documented in Shell-Test-API.asciidoc.\n> \n> [1] https://people.kernel.org/metan/why-sleep-is-almost-never-acceptable-in-tests\n> \n> Fixes: 0e4cbf753f (\"security/ima: Rewrite tests into new API + fixes\")\n> Suggested-by: Cyril Hrubis <chrubis@suse.cz>\n> Signed-off-by: Petr Vorel <pvorel@suse.cz>\n> ---\n>  testcases/kernel/security/integrity/ima/src/ima_mmap.c     | 7 ++++---\n>  .../kernel/security/integrity/ima/tests/ima_violations.sh  | 6 +++++-\n>  2 files changed, 9 insertions(+), 4 deletions(-)\n> \n> diff --git a/testcases/kernel/security/integrity/ima/src/ima_mmap.c b/testcases/kernel/security/integrity/ima/src/ima_mmap.c\n> index 8596809ef4..09b22fd4f4 100644\n> --- a/testcases/kernel/security/integrity/ima/src/ima_mmap.c\n> +++ b/testcases/kernel/security/integrity/ima/src/ima_mmap.c\n> @@ -9,7 +9,6 @@\n>  \n>  #include \"tst_test.h\"\n>  \n> -#define SLEEP_AFTER_CLOSE 3\n>  #define MMAPSIZE 1024\n>  \n>  static char *filename;\n> @@ -35,8 +34,10 @@ static void run(void)\n>  \tfile = SAFE_MMAP(NULL, MMAPSIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);\n>  \tSAFE_CLOSE(fd);\n>  \n> -\ttst_res(TINFO, \"sleep %ds\", SLEEP_AFTER_CLOSE);\n> -\tsleep(SLEEP_AFTER_CLOSE);\n> +\ttst_reinit();\n> +\tTST_CHECKPOINT_WAIT(0);\n> +\t/* keep running until ima_violations.sh open and close file */\n> +\tTST_CHECKPOINT_WAKE_AND_WAIT(0);\n>  \n>  \ttst_res(TPASS, \"test completed\");\n>  }\n\nC helpers that call tst_reinit() should implement main(). These are not\ncomplete tests, just helpers. The main problem is that if you add\ntst_reinit() to a source that defines tst_test structure you are\ninitializing the test library for a second time, which overwrites the\nsome of the already initialized variables.\n\nWe probably want:\n\ndiff --git a/lib/tst_test.c b/lib/tst_test.c\nindex 26f6510a0..971a184f2 100644\n--- a/lib/tst_test.c\n+++ b/lib/tst_test.c\n@@ -196,6 +196,9 @@ void tst_reinit(void)\n        size_t size = getpagesize();\n        int fd;\n\n+       if (ipc)\n+               tst_brk(TBROK, \"Test library already initialized!\");\n+\n        if (!path)\n                tst_brk(TBROK, IPC_ENV_VAR\" is not defined\");\n\n\nSo that this kind of mistake is caught early.","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=vU86OTEt;\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=/grSMBln;\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=y4b6Z+pu;\n\tdkim=neutral header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=l9qM9ohM;\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\tnone"],"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 4g5pT56Njkz1yHZ\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 30 Apr 2026 19:16:41 +1000 (AEST)","from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id E3E633E5C34\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 30 Apr 2026 11:16:39 +0200 (CEST)","from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [217.194.8.3])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n (No client certificate requested)\n by picard.linux.it (Postfix) with ESMTPS id D39863E210C\n for <ltp@lists.linux.it>; Thu, 30 Apr 2026 11:16:36 +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-3.smtp.seeweb.it (Postfix) with ESMTPS id 4094F1A00A5A\n for <ltp@lists.linux.it>; Thu, 30 Apr 2026 11:16:35 +0200 (CEST)","from imap1.dmz-prg2.suse.org (unknown [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 E971A5BD5D;\n Thu, 30 Apr 2026 09:16:34 +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 D80DE593B0;\n Thu, 30 Apr 2026 09:16:34 +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 EuLJM/Id82m8NgAAD6G6ig\n (envelope-from <chrubis@suse.cz>); Thu, 30 Apr 2026 09:16:34 +0000"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_rsa;\n t=1777540595;\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=rgCCe1R7DGN14yeRLGu9vS3iBbqDao+6RAiTQBwuw7U=;\n b=vU86OTEt4cbH6f3QTwZk4ohOsTrFDl5WRn2JQZry+pCxSKNQ2beY0rZDJ3HOUJWdTvCDga\n Px2dic7FCLaIxDlYpPx1jfrrlvVYJU67emaUDT9W5uBJ+1b3HM1ut9wJ/wWD9DSeVawKOD\n U2hnC3kk0cHV6OZ6vCe9S3WJB2nMeXg=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_ed25519; t=1777540595;\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=rgCCe1R7DGN14yeRLGu9vS3iBbqDao+6RAiTQBwuw7U=;\n b=/grSMBlngeTf8D69mmAyPz8jzJZh1xmh2MsLMM6UsBw8Smgd2VA0QHF9o4XXPWn7ypjyzt\n drbZVNulF7LnpcDA==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_rsa;\n t=1777540594;\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=rgCCe1R7DGN14yeRLGu9vS3iBbqDao+6RAiTQBwuw7U=;\n b=y4b6Z+puf1d7Jl6BvHgLBoyclud3t81Z8gFPScg4TKunsTnY2gM1byQRu+RjBm1V9ByIJH\n VeWkrmKKiv7IpSbUt2XmhD+fDWH4IM2Pflb6+fkPHu2+jvgtCyrp/a+PDavZ7aHgSWb4nU\n jrSDw4pVA+eU+W7A6wosVSTGKFS20Nw=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_ed25519; t=1777540594;\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=rgCCe1R7DGN14yeRLGu9vS3iBbqDao+6RAiTQBwuw7U=;\n b=l9qM9ohMt+eQkDCZiTnJNd58naxtLiV9/M/rK5jczg3q8nmK3qJ5t6ijndM5/trDH/B9zb\n +ZFvNm9ZntUkBzAw=="],"Date":"Thu, 30 Apr 2026 11:16:35 +0200","From":"Cyril Hrubis <chrubis@suse.cz>","To":"Petr Vorel <pvorel@suse.cz>","Message-ID":"<afMd82ykYhNz9Msy@yuki.lan>","References":"<20260428161034.947614-1-pvorel@suse.cz>\n <20260428161034.947614-2-pvorel@suse.cz>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20260428161034.947614-2-pvorel@suse.cz>","X-Spamd-Result":"default: False [-4.30 / 50.00]; BAYES_HAM(-3.00)[100.00%];\n NEURAL_HAM_LONG(-1.00)[-1.000];\n NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain];\n RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[];\n MIME_TRACE(0.00)[0:+]; MISSING_XM_UA(0.00)[];\n TO_DN_SOME(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com];\n RCVD_TLS_ALL(0.00)[];\n DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519];\n FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[6];\n FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[];\n RCVD_COUNT_TWO(0.00)[2];\n DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.cz:email]","X-Spam-Score":"-4.30","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-3.smtp.seeweb.it","X-Virus-Scanned":"clamav-milter 1.0.9 at in-3.smtp.seeweb.it","X-Virus-Status":"Clean","Subject":"Re: [LTP] [PATCH 2/2] ima_violations.sh: ima_mmap.c: Replace sleep\n with checkpoints","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, linux-integrity@vger.kernel.org","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>"}}]