lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 1 May 2022 12:28:18 +0100
From:   "Russell King (Oracle)" <linux@...linux.org.uk>
To:     Huacai Chen <chenhuacai@...il.com>
Cc:     Arnd Bergmann <arnd@...db.de>,
        Huacai Chen <chenhuacai@...ngson.cn>,
        Andy Lutomirski <luto@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Peter Zijlstra <peterz@...radead.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        David Airlie <airlied@...ux.ie>,
        Jonathan Corbet <corbet@....net>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        linux-arch <linux-arch@...r.kernel.org>,
        "open list:DOCUMENTATION" <linux-doc@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Xuefeng Li <lixuefeng@...ngson.cn>,
        Yanteng Si <siyanteng@...ngson.cn>,
        Guo Ren <guoren@...nel.org>, Xuerui Wang <kernel@...0n.name>,
        Jiaxun Yang <jiaxun.yang@...goat.com>,
        Linux ARM <linux-arm-kernel@...ts.infradead.org>,
        Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will@...nel.org>,
        linux-riscv <linux-riscv@...ts.infradead.org>,
        Paul Walmsley <paul.walmsley@...ive.com>,
        Palmer Dabbelt <palmer@...belt.com>,
        Albert Ou <aou@...s.berkeley.edu>,
        Ard Biesheuvel <ardb@...nel.org>,
        linux-efi <linux-efi@...r.kernel.org>
Subject: Re: [PATCH V9 21/24] LoongArch: Add zboot (compressed kernel) support

On Sun, May 01, 2022 at 04:46:50PM +0800, Huacai Chen wrote:
> Hi, Russell,
> 
> On Sun, May 1, 2022 at 2:35 PM Russell King (Oracle)
> <linux@...linux.org.uk> wrote:
> >
> > On Sun, May 01, 2022 at 01:22:25PM +0800, Huacai Chen wrote:
> > > Hi, Arnd,
> > >
> > > On Sat, Apr 30, 2022 at 7:02 PM Arnd Bergmann <arnd@...db.de> wrote:
> > > >
> > > > On Sat, Apr 30, 2022 at 11:05 AM Huacai Chen <chenhuacai@...ngson.cn> wrote:
> > > > >
> > > > > This patch adds zboot (self-extracting compressed kernel) support, all
> > > > > existing in-kernel compressing algorithm and efistub are supported.
> > > > >
> > > > > Signed-off-by: Huacai Chen <chenhuacai@...ngson.cn>
> > > >
> > > > I have no objections to adding a decompressor in principle, and
> > > > the implementation seems reasonable. However, I think we should try to
> > > > be consistent between architectures. On both arm64 and riscv, the
> > > > maintainers decided to not include a decompressor and instead leave
> > > > it up to the boot loader to decompress the kernel and enter it from there.
> > > X86, ARM32 and MIPS already support self-extracting kernel, and in
> > > 5.17 we even support self-extracting modules. So I think a
> > > self-extracting kernel is better than a pure compressed kernel.
> >
> > FYI, kernel modules are not self-extracting. They don't contain the code
> > to do the decompression - that is contained within the kernel, and it is
> > the kernel that does the decompression. The userspace tooling tells the
> > kernel that the module is compressed.
> I call "self-extracting" here means we don't need out-of-kernel help:
> kernel decompress doesn't need the bootloader, module decompress
> doesn't need kmod.

As I understand it, it does require out-of-kernel help. The module
loading program needs to pass in to the finit_module syscall a flag
to tell the kernel to decompress it. See the
MODULE_INIT_COMPRESSED_FILE flag.

So it's definitely not "self-extracting" by any sense of "self". My
definition of "self-extracting" is where a program contains the
extractor inside the same image, and when the program is run, it
performs the extraction using code contained within the image itself.

Your definition would mean a gzipped kernel binary would be able to
be called "self-extracting" if the boot loader decompresses it. This
is definitely not "self-extracting" in my book.

Sorry to be such a pedant.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ