Skip to content
  • Ard Biesheuvel's avatar
    ANDROID: fips140: add kernel crypto module · 8a99ad0b
    Ard Biesheuvel authored
    
    
    To meet FIPS 140 requirements, add support for building a kernel module
    "fips140.ko" that contains various cryptographic algorithms built from
    existing kernel source files.  At load time, the module checks its own
    integrity and self-tests its algorithms, then registers the algorithms
    with the crypto API to supersede the original algorithms provided by the
    kernel itself.
    
    [ebiggers: this commit originated from "ANDROID: crypto: fips140 -
     perform load time integrity check", but I've folded many later commits
     into it to make forward porting easier.  See below]
    
    Original commits:
      android12-5.10:
        6be141eb ("ANDROID: crypto: fips140 - perform load time integrity check")
        868be244 ("ANDROID: inject correct HMAC digest into fips140.ko at build time")
        091338cb ("ANDROID: fips140: add missing static keyword to fips140_init()")
        c799c664 ("ANDROID: fips140: adjust some log messages")
        92de5347 ("ANDROID: fips140: log already-live algorithms")
        0af06624 ("ANDROID: fips140: check for errors from initcalls")
        634445a6 ("ANDROID: fips140: fix deadlock in unregister_existing_fips140_algos()")
        e886dd4c ("ANDROID: fips140: unregister existing DRBG algorithms")
        b7397e89 ("ANDROID: fips140: add power-up cryptographic self-tests")
        50661975 ("ANDROID: fips140: add/update module help text")
        b397a038 ("ANDROID: fips140: test all implementations")
        17ccefe1 ("ANDROID: fips140: use full 16-byte IV")
        1be58af0 ("ANDROID: fips140: remove non-prediction-resistant DRBG test")
        2b5843ae ("ANDROID: fips140: add AES-CBC-CTS")
        2ee56aad ("ANDROID: fips140: add AES-CMAC")
        960ebb2b ("ANDROID: fips140: add jitterentropy to fips140 module")
        e5b14396 ("ANDROID: fips140: take into account AES-GCM not being approvable")
        52b70d49 ("ANDROID: fips140: use FIPS140_CFLAGS when compiling fips140-selftests.c")
        6b995f5a ("ANDROID: fips140: preserve RELA sections without relying on the module loader")
        e45108ec ("ANDROID: fips140: block crypto operations until tests complete")
        ecf93411 ("ANDROID: fips140: remove in-place updating of live algorithms")
        482b0323 ("ANDROID: fips140: zeroize temporary values from integrity check")
        64d769e5 ("ANDROID: fips140: add service indicators")
        8d7f609c ("ANDROID: fips140: add name and version, and a function to retrieve them")
        6b7c37f6 ("ANDROID: fips140: use UTS_RELEASE as FIPS version")
        903e97a0 ("ANDROID: fips140: refactor evaluation testing support")
        97fb2104 ("ANDROID: fips140: add support for injecting integrity error")
        109f31ac ("ANDROID: fips140: add userspace interface for evaluation testing")
      android14-5.15:
        84572a0c ("ANDROID: fips140: split dump-section+add-section into 2 ops")
        b0f88738 ("ANDROID: kleaf: convert fips140 to kleaf")
        2535deae ("ANDROID: GKI: Source GKI_BUILD_CONFIG_FRAGMENT after setting all variables")
        685a2ade ("ANDROID: fips140: add crypto_memneq() back to the module")
        320dfca5 ("ANDROID: fips140: fix in-tree builds")
        d4966a82 ("ANDROID: fips140: remove CONFIG_CRYPTO_FIPS140 option")
        6da26b87 ("ANDROID: fips140: require 'm' to enable CRYPTO_FIPS140_MOD")
        bfcfcce3 ("ANDROID: fips140: unapply ABS32 relocations generated by KCFI")
        63f46b45 ("ANDROID: fips140: eliminate crypto-fips.a build step")
        ae4ca7a0 ("ANDROID: fips140: allow building without LTO")
        e8b59bcd ("ANDROID: fips140: fix the error injection module parameters")
        9cef46f3 ("ANDROID: remove LTO check from build.config.gki.aarch64.fips140")
        b1f8c250 ("ANDROID: fips140 - add option for debugging the integrity check")
        7b301c70 ("ANDROID: fips140 - fix integrity check by unapplying dynamic SCS")
      android14-6.1:
        3f5807c5 ("ANDROID: fips140: change linker script guard")
    
    Bug: 153614920
    Bug: 188620248
    Test: Tested that the module builds and can be loaded on a device.
    Change-Id: I3fde49dbc3d16b149b072a27ba5b4c6219015c94
    Signed-off-by: default avatarArd Biesheuvel <ardb@google.com>
    Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
    8a99ad0b
Loading