1. 13 Feb, 2023 4 commits
    • Thomas Weißschuh's avatar
      KEYS: Add new function key_create() · 6c1976ad
      Thomas Weißschuh authored
      key_create() works like key_create_or_update() but does not allow
      updating an existing key, instead returning ERR_PTR(-EEXIST).
      
      key_create() will be used by the blacklist keyring which should not
      create duplicate entries or update existing entries.
      Instead a dedicated message with appropriate severity will be logged.
      Signed-off-by: default avatarThomas Weißschuh <linux@weissschuh.net>
      Signed-off-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
      6c1976ad
    • Thomas Weißschuh's avatar
      certs: make blacklisted hash available in klog · 06b53b02
      Thomas Weißschuh authored
      One common situation triggering this log statement are duplicate hashes
      reported by the system firmware.
      
      These duplicates should be removed from the firmware.
      
      Without logging the blacklisted hash triggering the issue however the users
      can not report it properly to the firmware vendors and the firmware vendors
      can not easily see which specific hash is duplicated.
      
      While changing the log message also use the dedicated ERR_PTR format
      placeholder for the returned error value.
      Signed-off-by: default avatarThomas Weißschuh <linux@weissschuh.net>
      Reviewed-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
      Signed-off-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
      06b53b02
    • Matthew Garrett's avatar
      tpm_crb: Add support for CRB devices based on Pluton · 4d273288
      Matthew Garrett authored
      Pluton is an integrated security processor present in some recent Ryzen
      parts. If it's enabled, it presents two devices - an MSFT0101 ACPI device
      that's broadly an implementation of a Command Response Buffer TPM2, and an
      MSFT0200 ACPI device whose functionality I haven't examined in detail yet.
      This patch only attempts to add support for the TPM device.
      
      There's a few things that need to be handled here. The first is that the
      TPM2 ACPI table uses a previously undefined start method identifier. The
      table format appears to include 16 bytes of startup data, which corresponds
      to one 64-bit address for a start message and one 64-bit address for a
      completion response. The second is that the ACPI tables on the Thinkpad Z13
      I'm testing this on don't define any memory windows in _CRS (or, more
      accurately, there are two empty memory windows). This check doesn't seem
      strictly necessary, so I've skipped that.
      
      Finally, it seems like chip needs to be explicitly asked to transition into
      ready status on every command. Failing to do this means that if two
      commands are sent in succession without an idle/ready transition in
      between, everything will appear to work fine but the response is simply the
      original command. I'm working without any docs here, so I'm not sure if
      this is actually the required behaviour or if I'm missing something
      somewhere else, but doing this results in the chip working reliably.
      Reviewed-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
      Signed-off-by: default avatarMatthew Garrett <mjg59@srcf.ucam.org>
      Signed-off-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
      4d273288
    • Arnd Bergmann's avatar
      crypto: certs: fix FIPS selftest dependency · 0f5d4a0b
      Arnd Bergmann authored
      The selftest code is built into the x509_key_parser module, and depends
      on the pkcs7_message_parser module, which in turn has a dependency on
      the key parser, creating a dependency loop and a resulting link
      failure when the pkcs7 code is a loadable module:
      
      ld: crypto/asymmetric_keys/selftest.o: in function `fips_signature_selftest':
      crypto/asymmetric_keys/selftest.c:205: undefined reference to `pkcs7_parse_message'
      ld: crypto/asymmetric_keys/selftest.c:209: undefined reference to `pkcs7_supply_detached_data'
      ld: crypto/asymmetric_keys/selftest.c:211: undefined reference to `pkcs7_verify'
      ld: crypto/asymmetric_keys/selftest.c:215: undefined reference to `pkcs7_validate_trust'
      ld: crypto/asymmetric_keys/selftest.c:219: undefined reference to `pkcs7_free_message'
      
      Avoid this by only allowing the selftest to be enabled when either
      both parts are loadable modules, or both are built-in.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reviewed-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
      Signed-off-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
      0f5d4a0b
  2. 12 Feb, 2023 10 commits
  3. 11 Feb, 2023 5 commits
  4. 10 Feb, 2023 16 commits
  5. 09 Feb, 2023 5 commits