From: Petr Vorel <pvorel@suse.cz>
To: Avinesh Kumar <avinesh.kumar@suse.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] ima_kexec.sh: Use %s in printf to prevent evaluating cmdline backslashes
Date: Thu, 16 Apr 2026 20:39:47 +0200 [thread overview]
Message-ID: <20260416183947.GC303991@pevik> (raw)
In-Reply-To: <20260415044641.97806-1-avinesh.kumar@suse.com>
Hi Avinesh,
> On systemd-boot systems, the kernel command line contains EFI paths
> with backslashes (e.g., `initrd=\opensuse...\6.19...`).
> Writing this to a file using `printf "$cmdline"` inadvertently evaluates
> these backslashes as escape sequences, corrupting the expected digest
> and causing a false test failure:
> + printf 'initrd=\opensuse-tumbleweed\6.19.11-1-default\initrd-...'
> + cat -v file1
> initrd=\opensuse-tumbleweed^F.19.11-1-default\initrd-...
> ima_kexec 1 TINFO: testing kexec -s -l /boot/Image-6.19.11-1-default --reuse-cmdline
> ima_kexec 1 TFAIL: unable to find a correct measurement
> Fix this by using `printf "%s" "$cmdline"` to ensure the command line
> is treated as literal data.
Thanks a lot, merged!
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
prev parent reply other threads:[~2026-04-16 18:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-15 4:46 [LTP] [PATCH] ima_kexec.sh: Use %s in printf to prevent evaluating cmdline backslashes Avinesh Kumar via ltp
2026-04-15 5:29 ` [LTP] " linuxtestproject.agent
2026-04-16 18:39 ` Petr Vorel [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260416183947.GC303991@pevik \
--to=pvorel@suse.cz \
--cc=avinesh.kumar@suse.com \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox