{"id":2229700,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2229700/?format=json","web_url":"http://patchwork.ozlabs.org/project/ltp/patch/20260428161034.947614-2-pvorel@suse.cz/","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":"<20260428161034.947614-2-pvorel@suse.cz>","date":"2026-04-28T16:10:34","name":"[2/2] ima_violations.sh: ima_mmap.c: Replace sleep with checkpoints","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"965201c91e22dab9b3a6c390ab3ea4a141865667","submitter":{"id":70792,"url":"http://patchwork.ozlabs.org/api/1.1/people/70792/?format=json","name":"Petr Vorel","email":"pvorel@suse.cz"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/ltp/patch/20260428161034.947614-2-pvorel@suse.cz/mbox/","series":[{"id":501891,"url":"http://patchwork.ozlabs.org/api/1.1/series/501891/?format=json","web_url":"http://patchwork.ozlabs.org/project/ltp/list/?series=501891","date":"2026-04-28T16:10:33","name":"[1/2] ima_violations.sh: Wait for ima_mmap to exit","version":1,"mbox":"http://patchwork.ozlabs.org/series/501891/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2229700/comments/","check":"success","checks":"http://patchwork.ozlabs.org/api/patches/2229700/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=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=2W7pFKHb;\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=ixFs+yiG;\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=2W7pFKHb;\n\tdkim=neutral header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=ixFs+yiG;\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 dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=2W7pFKHb;\n dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=ixFs+yiG"],"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 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g4lmL3hCbz1yJQ\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 02:11:14 +1000 (AEST)","from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id D55A03DEFF3\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 18:11:11 +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))\n (No client certificate requested)\n by picard.linux.it (Postfix) with ESMTPS id 4A0673E5373\n for <ltp@lists.linux.it>; Tue, 28 Apr 2026 18:10:56 +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-3.smtp.seeweb.it (Postfix) with ESMTPS id BCD381A00916\n for <ltp@lists.linux.it>; Tue, 28 Apr 2026 18:10:55 +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-out1.suse.de (Postfix) with ESMTPS id C037D6A838;\n Tue, 28 Apr 2026 16:10:43 +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 813A2593B1;\n Tue, 28 Apr 2026 16:10:43 +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 SBuEHQPc8Gm6EgAAD6G6ig\n (envelope-from <pvorel@suse.cz>); Tue, 28 Apr 2026 16:10:43 +0000"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_rsa;\n t=1777392643;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=k/xY+JuT9SB922Vd8GksQP3O2M/EVrOW+CmvFUk5xtI=;\n b=2W7pFKHbILiW6ruDwR4Ai1yTBviQKUOBLOtirfzboLQMYpySsJQyJf7Lfs+rA3CBYtwxP4\n 9zJiD0T2Lec9z0YgfXOlOosrcO9Y6ru7Yd4n+fEOmzWBXwS3JiJJTgxveK2cTz6keZu7Ka\n SA/iSEQwItShAV6OzbkGYUiiCXasmXc=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_ed25519; t=1777392643;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=k/xY+JuT9SB922Vd8GksQP3O2M/EVrOW+CmvFUk5xtI=;\n b=ixFs+yiGLLKRQVNWLgAIb5KKl04BaLDHfiA+nX3R28MEpNJYsUTHzwkyLhASqYJ/mPFy18\n xWdWPsehozYs6hCA==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_rsa;\n t=1777392643;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=k/xY+JuT9SB922Vd8GksQP3O2M/EVrOW+CmvFUk5xtI=;\n b=2W7pFKHbILiW6ruDwR4Ai1yTBviQKUOBLOtirfzboLQMYpySsJQyJf7Lfs+rA3CBYtwxP4\n 9zJiD0T2Lec9z0YgfXOlOosrcO9Y6ru7Yd4n+fEOmzWBXwS3JiJJTgxveK2cTz6keZu7Ka\n SA/iSEQwItShAV6OzbkGYUiiCXasmXc=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_ed25519; t=1777392643;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=k/xY+JuT9SB922Vd8GksQP3O2M/EVrOW+CmvFUk5xtI=;\n b=ixFs+yiGLLKRQVNWLgAIb5KKl04BaLDHfiA+nX3R28MEpNJYsUTHzwkyLhASqYJ/mPFy18\n xWdWPsehozYs6hCA=="],"From":"Petr Vorel <pvorel@suse.cz>","To":"ltp@lists.linux.it","Date":"Tue, 28 Apr 2026 18:10:34 +0200","Message-ID":"<20260428161034.947614-2-pvorel@suse.cz>","X-Mailer":"git-send-email 2.54.0","In-Reply-To":"<20260428161034.947614-1-pvorel@suse.cz>","References":"<20260428161034.947614-1-pvorel@suse.cz>","MIME-Version":"1.0","X-Rspamd-Action":"no action","X-Rspamd-Server":"rspamd2.dmz-prg2.suse.org","X-Spamd-Result":"default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%];\n MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000];\n R_MISSING_CHARSET(0.50)[];\n R_DKIM_ALLOW(-0.20)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519];\n NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain];\n MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[];\n MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[];\n DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519];\n RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];\n FUZZY_RATELIMITED(0.00)[rspamd.com]; RCVD_TLS_ALL(0.00)[];\n DKIM_TRACE(0.00)[suse.cz:+]; RCVD_COUNT_TWO(0.00)[2];\n FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[];\n SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from];\n DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from,2a07:de40:b281:106:10:150:64:167:received];\n RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];\n RCPT_COUNT_SEVEN(0.00)[7]; RCVD_VIA_SMTP_AUTH(0.00)[];\n DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,\n imap1.dmz-prg2.suse.org:rdns, suse.cz:dkim, suse.cz:mid, suse.cz:email]","X-Rspamd-Queue-Id":"C037D6A838","X-Spam-Score":"-3.01","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":"[LTP] [PATCH 2/2] ima_violations.sh: ima_mmap.c: Replace sleep with\n 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-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":"Using checkpoints is a proper way in LTP new API [1] to avoid races and\nwaste of time.  It reduces 3 sec sleep in ima_mmap.c and 1 sec sleep in\nima_violations.sh with just checkpoints.\n\nNOTE: tst_reinit() is really needed instead of .needs_checkpoints = 1\nas documented in Shell-Test-API.asciidoc.\n\n[1] https://people.kernel.org/metan/why-sleep-is-almost-never-acceptable-in-tests\n\nFixes: 0e4cbf753f (\"security/ima: Rewrite tests into new API + fixes\")\nSuggested-by: Cyril Hrubis <chrubis@suse.cz>\nSigned-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(-)","diff":"diff --git a/testcases/kernel/security/integrity/ima/src/ima_mmap.c b/testcases/kernel/security/integrity/ima/src/ima_mmap.c\nindex 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 }\ndiff --git a/testcases/kernel/security/integrity/ima/tests/ima_violations.sh b/testcases/kernel/security/integrity/ima/tests/ima_violations.sh\nindex 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\n","prefixes":["2/2"]}