• Thiago Jung Bauermann's avatar
    powerpc: ima: get the kexec buffer passed by the previous kernel · 467d2782
    Thiago Jung Bauermann authored
    Patch series "ima: carry the measurement list across kexec", v8.
    
    The TPM PCRs are only reset on a hard reboot.  In order to validate a
    TPM's quote after a soft reboot (eg.  kexec -e), the IMA measurement
    list of the running kernel must be saved and then restored on the
    subsequent boot, possibly of a different architecture.
    
    The existing securityfs binary_runtime_measurements file conveniently
    provides a serialized format of the IMA measurement list.  This patch
    set serializes the measurement list in this format and restores it.
    
    Up to now, the binary_runtime_measurements was defined as architecture
    native format.  The assumption being that userspace could and would
    handle any architecture conversions.  With the ability of carrying the
    measurement list across kexec, possibly from one architecture to a
    different one, the per boot architecture information is lost and with it
    the ability of recalculating the template digest hash.  To resolve this
    problem, without breaking the existing ABI, this patch set introduces
    the boot command line option "ima_canonical_fmt", which is arbitrarily
    defined as little endian.
    
    The need for this boot command line option will be limited to the
    existing version 1 format of the binary_runtime_measurements.
    Subsequent formats will be defined as canonical format (eg.  TPM 2.0
    support for larger digests).
    
    A simplified method of Thiago Bauermann's "kexec buffer handover" patch
    series for carrying the IMA measurement list across kexec is included in
    this patch set.  The simplified method requires all file measurements be
    taken prior to executing the kexec load, as subsequent measurements will
    not be carried across the kexec and restored.
    
    This patch (of 10):
    
    The IMA kexec buffer allows the currently running kernel to pass the
    measurement list via a kexec segment to the kernel that will be kexec'd.
    The second kernel can check whether the previous kernel sent the buffer
    and retrieve it.
    
    This is the architecture-specific part which enables IMA to receive the
    measurement list passed by the previous kernel.  It will be used in the
    next patch.
    
    The change in machine_kexec_64.c is to factor out the logic of removing
    an FDT memory reservation so that it can be used by remove_ima_buffer.
    
    Link: http://lkml.kernel.org/r/1480554346-29071-2-git-send-email-zohar@linux.vnet.ibm.comSigned-off-by: default avatarThiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
    Signed-off-by: default avatarMimi Zohar <zohar@linux.vnet.ibm.com>
    Acked-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
    Cc: Andreas Steffen <andreas.steffen@strongswan.org>
    Cc: Dmitry Kasatkin <dmitry.kasatkin@gmail.com>
    Cc: Josh Sklar <sklar@linux.vnet.ibm.com>
    Cc: Dave Young <dyoung@redhat.com>
    Cc: Vivek Goyal <vgoyal@redhat.com>
    Cc: Baoquan He <bhe@redhat.com>
    Cc: Michael Ellerman <mpe@ellerman.id.au>
    Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Stewart Smith <stewart@linux.vnet.ibm.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    467d2782
Kconfig 23.2 KB