Forwarding this here since the final intent here is an IMA related
change to see if anyone has any suggestions.
-------- Forwarded Message --------
Subject: How to extract linux kernel version information from a kernel
image?
Date: Fri, 18 Sep 2020 12:47:13 -0700
From: Raphael Gianotti <raphgi@xxxxxxxxxxxxxxxxxxx>
To: linux-kernel@xxxxxxxxxxxxxxx
Hi,
I have been investigating a way to extract the version strong from a
kernel image (e.g., vmlinux). The version string I've been looking at is
essentially the linux_banner symbol.
We'll use IMA to measure the version string on the kexec system call,
providing a way for an attestation service, for instance, to attest to
what version of the kernel is running on the client.
I haven't found a way to extract the version from the image that isn't
simply searching the whole image for it. I was hoping someone here may
be able to point me to a better approach to retrieve the linux_banner
symbol value from an image or any existing kernel code that does
similar parsing.
If that matters for any suggestions, my current focus is on ARM64 images
(if the code ends up having to be arch specific).
Thanks,
-Raphael