[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aW_m5eRzqRJzFWnF@smile.fi.intel.com>
Date: Tue, 20 Jan 2026 22:34:45 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: David Disseldorp <ddiss@...e.de>
Cc: Christian Brauner <brauner@...nel.org>, Petr Mladek <pmladek@...e.com>,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
Al Viro <viro@...iv.linux.org.uk>, Jan Kara <jack@...e.cz>,
Steven Rostedt <rostedt@...dmis.org>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH v1 2/4] initramfs: Refactor to use hex2bin() instead of
custom approach
On Wed, Jan 21, 2026 at 07:12:50AM +1100, David Disseldorp wrote:
> On Mon, 19 Jan 2026 21:38:39 +0100, Andy Shevchenko wrote:
>
> > + ret = hex2bin((u8 *)header, s + 6, sizeof(header));
> > + if (ret)
> > + error("damaged header");
>
> The changes look reasonable to me on first glance, but I think we really
> should improve the error handling to abort the state machine on
> malformed header here.
>
> One further issue that we have is simple_strntoul()'s acceptance of
> "0x" prefixes for the hex strings - any initramfs which carries such
> prefixes will now result in an error.
> It's a pretty obscure corner case, but cpio is really easy to generate
> from printf(), so maybe there are some images out there which rely on
> this.
>
> I've written an initramfs_test regression test for the "0x" prefix
> handling. I'll send it to the list.
Is it specified?
The standard refers to octal numbers, we seem to use hexadecimal.
I don't believe the 0x will ever appear here.
Otherwise, please point out to the specifications.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists