{"id":2223331,"url":"http://patchwork.ozlabs.org/api/1.2/patches/2223331/?format=json","web_url":"http://patchwork.ozlabs.org/project/ltp/patch/20260415044641.97806-1-avinesh.kumar@suse.com/","project":{"id":59,"url":"http://patchwork.ozlabs.org/api/1.2/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":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260415044641.97806-1-avinesh.kumar@suse.com>","list_archive_url":null,"date":"2026-04-15T04:46:36","name":"ima_kexec.sh: Use %s in printf to prevent evaluating cmdline backslashes","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"81580a17c1eef5cf73e9f61e2d689948d99e00db","submitter":{"id":88126,"url":"http://patchwork.ozlabs.org/api/1.2/people/88126/?format=json","name":"Avinesh Kumar","email":"avinesh.kumar@suse.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/ltp/patch/20260415044641.97806-1-avinesh.kumar@suse.com/mbox/","series":[{"id":499916,"url":"http://patchwork.ozlabs.org/api/1.2/series/499916/?format=json","web_url":"http://patchwork.ozlabs.org/project/ltp/list/?series=499916","date":"2026-04-15T04:46:36","name":"ima_kexec.sh: Use %s in printf to prevent evaluating cmdline backslashes","version":1,"mbox":"http://patchwork.ozlabs.org/series/499916/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2223331/comments/","check":"warning","checks":"http://patchwork.ozlabs.org/api/patches/2223331/checks/","tags":{},"related":[],"headers":{"Return-Path":"<ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>","X-Original-To":["incoming@patchwork.ozlabs.org","ltp@lists.linux.it"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","ltp@picard.linux.it"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=lists.linux.it header.i=@lists.linux.it\n header.a=rsa-sha256 header.s=picard header.b=XkwLljPc;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=suse.com header.i=@suse.com header.a=rsa-sha256\n header.s=google header.b=YyENI6yX;\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 4fwTBq6WRFz1yDF\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 15 Apr 2026 14:46:57 +1000 (AEST)","from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id 74B3B3E1A21\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 15 Apr 2026 06:46:54 +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 B9C203E148A\n for <ltp@lists.linux.it>; Wed, 15 Apr 2026 06:46:48 +0200 (CEST)","from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com\n [IPv6:2a00:1450:4864:20::42f])\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 69635600043\n for <ltp@lists.linux.it>; Wed, 15 Apr 2026 06:46:48 +0200 (CEST)","by mail-wr1-x42f.google.com with SMTP id\n ffacd0b85a97d-43d73352cf2so2734001f8f.1\n for <ltp@lists.linux.it>; Tue, 14 Apr 2026 21:46:48 -0700 (PDT)","from localhost ([2401:4900:891c:489f:72d7:98bb:9ebc:a99e])\n by smtp.gmail.com with ESMTPSA id\n ffacd0b85a97d-43ead33d665sm1725484f8f.7.2026.04.14.21.46.45\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 14 Apr 2026 21:46:46 -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=1776228414; h=to : date :\n message-id : mime-version : subject : list-id : list-unsubscribe :\n list-archive : list-post : list-help : list-subscribe : from :\n reply-to : content-type : content-transfer-encoding : sender : from;\n bh=fcFotkDr7j11UfPxg5HAbEbQdrmGedT+arTDA+m1rh8=;\n b=XkwLljPcGvf8KjkLEOqRWZMZcNzhSFUCYP+hEAXbMzJV5SrSVMP8bMGpZF1x1riD+X7Ro\n 1VUIUoheqHgzMR0sMZxq4jHTNSi8qItgmhajCj7/KOg8yROzVybI4cHwb2MhU/8RMMedhlf\n jB3ki1yjOaCRWQCW0hybmzCcfwFYqes=","v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=suse.com; s=google; t=1776228407; x=1776833207; darn=lists.linux.it;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=fiKARQmPy7P6rcF42a1gBE71XHmkOzemAUiAV/wEVMs=;\n b=YyENI6yXnyIg3k3GnU9Rh1WeFgjHYPy2yUArz+GzyOzhmb5FtuC6DyW0Ol2ioNqga/\n f6DCXhvqUCQz+nxnkNC4/6gihk+UGj8AKMLVnjgFv0wIjjMkcv0CPdSsLF5Flrdt9LB1\n tx5dkyWZypPQgB+G8xvWpHdMXdsOC6YlvTGXsjyTtyVvuT9nA8ZkUSTPxhu8QifITA9E\n edl0Hul/Z9D2miXokErRl254uC32WOzC0eOJtDPPOkfA5pwxTrTC9pKWX34yg0CtT+BD\n p4+J29kbIEagVgLnib0mP/9jcM+f1P5P+rI1pqC3cuIZyU8iRNjuJ+KvuXn6MYdDunOx\n isOg=="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776228407; x=1776833207;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=fiKARQmPy7P6rcF42a1gBE71XHmkOzemAUiAV/wEVMs=;\n b=JJStum/Z0+ti6lM5vRb2s3Uil2pz/7MwSZSXvVHBshc74aoIOp/0FrjGIYUl2+PTLj\n alq1e7rSjwIadcgax77cCjMJSYfKXTvdxV6HBqC7494ngjwoP5YyiV9Eeq+ZXNj506Fv\n cvAn3BfVwEWc58hIDInN6Sx1BhbiMXd0+W5kSOVm0jtgq28myCuSElvpoZnLB5aEJu/L\n /dXRj1VkJf4KnmDLoWx9DQi2lOs6O18a3tsro8aFI67CTX4xLknHUYuWdkCtwyiWbt5O\n /B9uDQvEb1O1YyOKGnuwsLp/EKoG0TEzg4X4SAg5yDrrNZwHcE5FQCgAa0Cp5+kmg6/H\n gkJA==","X-Gm-Message-State":"AOJu0YzREJ1msdUKh2bToBCHvmyGs4lIT80ravYw60zKgV4J1Iqn1SCF\n 0GyTOjzUc5f6gwy3B8zuftLTdBq/ZTwkdITwCQgaV8h8eggtRzCXBclxKshfs7+0xWj0BsBuh/s\n OqfZzkp4=","X-Gm-Gg":"AeBDiet09Z4a2TSHeQKS3eSWdU8hDUWqS5wpOzmc7s08x9lha75BGc86N8+uErsKzr0\n oQfmNZt3j3C91G41pWjwdi1fZCVKvnBdaEjZFVb++scnJ9ZXhtufhMJxXYizbrs8jJZaJ6s2V55\n JadPVvlMO74830T/xEJy40uI/35g+5FP1A85MfikzEWejFH9USe68/js/bgk2TogH57j0MnZ8jH\n 1QqeIadMDc0uO8gTF2q5a6UUwneFyimBWcH4p0RZ3nTlILVgTLF+JW6c/6dbOy3CsVnw01jcVkL\n nBx6VTJwRXDFcI78xAmw7yMCIBAoaoi8O9aL4vMUe3jp1NLJrbAvzM74uE1+oMd7b3mnoMiWJVZ\n vowT0aQrtqRs204mqw3LJaXvvTqI/8iT6DzZ8z/26XEVMWqS1ozqUBIEr0jb3vXhnV0MwWDiBG2\n dvX0vPFFts6R1Hfyk10XZ5ZIwfgyZR","X-Received":"by 2002:a05:6000:24c3:b0:43d:77a8:3bb6 with SMTP id\n ffacd0b85a97d-43d77a83df5mr16050485f8f.47.1776228407310;\n Tue, 14 Apr 2026 21:46:47 -0700 (PDT)","To":"ltp@lists.linux.it","Date":"Wed, 15 Apr 2026 06:46:36 +0200","Message-ID":"<20260415044641.97806-1-avinesh.kumar@suse.com>","X-Mailer":"git-send-email 2.53.0","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,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":"[LTP] [PATCH] ima_kexec.sh: Use %s in printf to prevent evaluating\n cmdline backslashes","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":"Avinesh Kumar via ltp <ltp@lists.linux.it>","Reply-To":"Avinesh Kumar <avinesh.kumar@suse.com>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it","Sender":"\"ltp\" <ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>"},"content":"On systemd-boot systems, the kernel command line contains EFI paths\nwith backslashes (e.g., `initrd=\\opensuse...\\6.19...`).\n\nWriting this to a file using `printf \"$cmdline\"` inadvertently evaluates\nthese backslashes as escape sequences, corrupting the expected digest\nand causing a false test failure:\n\n  + printf 'initrd=\\opensuse-tumbleweed\\6.19.11-1-default\\initrd-...'\n  + cat -v file1\n  initrd=\\opensuse-tumbleweed^F.19.11-1-default\\initrd-...\n\n  ima_kexec 1 TINFO: testing kexec -s -l /boot/Image-6.19.11-1-default --reuse-cmdline\n  ima_kexec 1 TFAIL: unable to find a correct measurement\n\nFix this by using `printf \"%s\" \"$cmdline\"` to ensure the command line\nis treated as literal data.\n\nSigned-off-by: Avinesh Kumar <avinesh.kumar@suse.com>\n---\n testcases/kernel/security/integrity/ima/tests/ima_kexec.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)","diff":"diff --git a/testcases/kernel/security/integrity/ima/tests/ima_kexec.sh b/testcases/kernel/security/integrity/ima/tests/ima_kexec.sh\nindex 4732df653..bbc82f30c 100755\n--- a/testcases/kernel/security/integrity/ima/tests/ima_kexec.sh\n+++ b/testcases/kernel/security/integrity/ima/tests/ima_kexec.sh\n@@ -24,7 +24,7 @@ measure()\n \tlocal cmdline=\"$1\"\n \tlocal algorithm digest expected_digest found\n \n-\tprintf \"$cmdline\" > file1\n+\tprintf \"%s\" \"$cmdline\" > file1\n \tgrep \"kexec-cmdline\" $ASCII_MEASUREMENTS > file2\n \n \twhile read found\n","prefixes":[]}