]> git.ipfire.org Git - thirdparty/qemu.git/commit
x86/loader: only patch linux kernels
authorGerd Hoffmann <kraxel@redhat.com>
Thu, 5 Sep 2024 14:12:07 +0000 (16:12 +0200)
committerMichael Tokarev <mjt@tls.msk.ru>
Tue, 17 Dec 2024 11:18:12 +0000 (14:18 +0300)
commit3f73fe11188307773ab6bce481a977c7a11e367e
treee1d71c5d2256fab510010f2cdf4a5c1199745c61
parent52f2e73f7febfa7898de9a6816d9335de7581bec
x86/loader: only patch linux kernels

If the binary loaded via -kernel is *not* a linux kernel (in which
case protocol == 0), do not patch the linux kernel header fields.

It's (a) pointless and (b) might break binaries by random patching
and (c) changes the binary hash which in turn breaks secure boot
verification.

Background: OVMF happily loads and runs not only linux kernels but
any efi binary via direct kernel boot.

Note: Breaking the secure boot verification is a problem for linux
kernels too, but fixed that is left for another day ...

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-ID: <20240905141211.1253307-3-kraxel@redhat.com>
(cherry picked from commit 57e2cc9abf5da38f600354fe920ff20e719607b4)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(Mjt: it is in hw/i386/x86.c not hw/i386/x86-common.c in 8.2.x)
hw/i386/x86.c