]> Git Repo - linux.git/commitdiff
Merge tag 'integrity-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar...
authorLinus Torvalds <[email protected]>
Tue, 24 May 2022 20:50:39 +0000 (13:50 -0700)
committerLinus Torvalds <[email protected]>
Tue, 24 May 2022 20:50:39 +0000 (13:50 -0700)
Pull IMA updates from Mimi Zohar:
 "New is IMA support for including fs-verity file digests and signatures
  in the IMA measurement list as well as verifying the fs-verity file
  digest based signatures, both based on policy.

  In addition, are two bug fixes:

   - avoid reading UEFI variables, which cause a page fault, on Apple
     Macs with T2 chips.

   - remove the original "ima" template Kconfig option to address a boot
     command line ordering issue.

  The rest is a mixture of code/documentation cleanup"

* tag 'integrity-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity:
  integrity: Fix sparse warnings in keyring_handler
  evm: Clean up some variables
  evm: Return INTEGRITY_PASS for enum integrity_status value '0'
  efi: Do not import certificates from UEFI Secure Boot for T2 Macs
  fsverity: update the documentation
  ima: support fs-verity file digest based version 3 signatures
  ima: permit fsverity's file digests in the IMA measurement list
  ima: define a new template field named 'd-ngv2' and templates
  fs-verity: define a function to return the integrity protected file digest
  ima: use IMA default hash algorithm for integrity violations
  ima: fix 'd-ng' comments and documentation
  ima: remove the IMA_TEMPLATE Kconfig option
  ima: remove redundant initialization of pointer 'file'.

1  2 
Documentation/admin-guide/kernel-parameters.txt
fs/verity/fsverity_private.h
security/integrity/platform_certs/keyring_handler.c

index a1a0eba0a2e5b0e523ad3868c68857ff14f10f06,5e866be89f5d06641ab83c66e1977af5284b4750..2d67cdfbf9c9ac7cc78b56ab182391ad66189ac8
                        Defaults to zero when built as a module and to
                        10 seconds when built into the kernel.
  
 -      clearcpuid=BITNUM[,BITNUM...] [X86]
 +      clearcpuid=X[,X...] [X86]
                        Disable CPUID feature X for the kernel. See
                        arch/x86/include/asm/cpufeatures.h for the valid bit
 -                      numbers. Note the Linux specific bits are not necessarily
 -                      stable over kernel options, but the vendor specific
 +                      numbers X. Note the Linux-specific bits are not necessarily
 +                      stable over kernel options, but the vendor-specific
                        ones should be.
 +                      X can also be a string as appearing in the flags: line
 +                      in /proc/cpuinfo which does not have the above
 +                      instability issue. However, not all features have names
 +                      in /proc/cpuinfo.
 +                      Note that using this option will taint your kernel.
                        Also note that user programs calling CPUID directly
                        or using the feature without checking anything
                        will still see it. This just prevents it from
                        Documentation/admin-guide/kdump/kdump.rst for an example.
  
        crashkernel=size[KMG],high
 -                      [KNL, X86-64] range could be above 4G. Allow kernel
 +                      [KNL, X86-64, ARM64] range could be above 4G. Allow kernel
                        to allocate physical memory region from top, so could
                        be above 4G if system have more than 4G ram installed.
                        Otherwise memory region will be allocated below 4G, if
                        that require some amount of low memory, e.g. swiotlb
                        requires at least 64M+32K low memory, also enough extra
                        low memory is needed to make sure DMA buffers for 32-bit
 -                      devices won't run out. Kernel would try to allocate at
 +                      devices won't run out. Kernel would try to allocate
                        at least 256M below 4G automatically.
 -                      This one let user to specify own low range under 4G
 +                      This one lets the user specify own low range under 4G
                        for second kernel instead.
                        0: to disable low allocation.
                        It will be ignored when crashkernel=X,high is not used
                        or memory reserved is below 4G.
  
 +                      [KNL, ARM64] range in low memory.
 +                      This one lets the user specify a low range in the
 +                      DMA zone for the crash dump kernel.
 +                      It will be ignored when crashkernel=X,high is not used
 +                      or memory reserved is located in the DMA zones.
 +
        cryptomgr.notests
                        [KNL] Disable crypto self-tests
  
  
        ima_template=   [IMA]
                        Select one of defined IMA measurements template formats.
-                       Formats: { "ima" | "ima-ng" | "ima-sig" }
+                       Formats: { "ima" | "ima-ng" | "ima-ngv2" | "ima-sig" |
+                                  "ima-sigv2" }
                        Default: "ima-ng"
  
        ima_template_fmt=
                        when set.
                        Format: <int>
  
 -      libata.force=   [LIBATA] Force configurations.  The format is comma-
 -                      separated list of "[ID:]VAL" where ID is
 -                      PORT[.DEVICE].  PORT and DEVICE are decimal numbers
 -                      matching port, link or device.  Basically, it matches
 -                      the ATA ID string printed on console by libata.  If
 -                      the whole ID part is omitted, the last PORT and DEVICE
 -                      values are used.  If ID hasn't been specified yet, the
 -                      configuration applies to all ports, links and devices.
 +      libata.force=   [LIBATA] Force configurations.  The format is comma-
 +                      separated list of "[ID:]VAL" where ID is PORT[.DEVICE].
 +                      PORT and DEVICE are decimal numbers matching port, link
 +                      or device.  Basically, it matches the ATA ID string
 +                      printed on console by libata.  If the whole ID part is
 +                      omitted, the last PORT and DEVICE values are used.  If
 +                      ID hasn't been specified yet, the configuration applies
 +                      to all ports, links and devices.
  
                        If only DEVICE is omitted, the parameter applies to
                        the port and all links and devices behind it.  DEVICE
                        host link and device attached to it.
  
                        The VAL specifies the configuration to force.  As long
 -                      as there's no ambiguity shortcut notation is allowed.
 +                      as there is no ambiguity, shortcut notation is allowed.
                        For example, both 1.5 and 1.5G would work for 1.5Gbps.
                        The following configurations can be forced.
  
                          udma[/][16,25,33,44,66,100,133] notation is also
                          allowed.
  
 +                      * nohrst, nosrst, norst: suppress hard, soft and both
 +                        resets.
 +
 +                      * rstonce: only attempt one reset during hot-unplug
 +                        link recovery.
 +
 +                      * [no]dbdelay: Enable or disable the extra 200ms delay
 +                        before debouncing a link PHY and device presence
 +                        detection.
 +
                        * [no]ncq: Turn on or off NCQ.
  
 -                      * [no]ncqtrim: Turn off queued DSM TRIM.
 +                      * [no]ncqtrim: Enable or disable queued DSM TRIM.
 +
 +                      * [no]ncqati: Enable or disable NCQ trim on ATI chipset.
 +
 +                      * [no]trim: Enable or disable (unqueued) TRIM.
 +
 +                      * trim_zero: Indicate that TRIM command zeroes data.
 +
 +                      * max_trim_128m: Set 128M maximum trim size limit.
 +
 +                      * [no]dma: Turn on or off DMA transfers.
 +
 +                      * atapi_dmadir: Enable ATAPI DMADIR bridge support.
 +
 +                      * atapi_mod16_dma: Enable the use of ATAPI DMA for
 +                        commands that are not a multiple of 16 bytes.
 +
 +                      * [no]dmalog: Enable or disable the use of the
 +                        READ LOG DMA EXT command to access logs.
 +
 +                      * [no]iddevlog: Enable or disable access to the
 +                        identify device data log.
  
 -                      * nohrst, nosrst, norst: suppress hard, soft
 -                        and both resets.
 +                      * [no]logdir: Enable or disable access to the general
 +                        purpose log directory.
  
 -                      * rstonce: only attempt one reset during
 -                        hot-unplug link recovery
 +                      * max_sec_128: Set transfer size limit to 128 sectors.
  
 -                      * dump_id: dump IDENTIFY data.
 +                      * max_sec_1024: Set or clear transfer size limit to
 +                        1024 sectors.
  
 -                      * atapi_dmadir: Enable ATAPI DMADIR bridge support
 +                      * max_sec_lba48: Set or clear transfer size limit to
 +                        65535 sectors.
 +
 +                      * [no]lpm: Enable or disable link power management.
 +
 +                      * [no]setxfer: Indicate if transfer speed mode setting
 +                        should be skipped.
 +
 +                      * dump_id: Dump IDENTIFY data.
  
                        * disable: Disable this device.
  
                                               mds=off [X86]
                                               tsx_async_abort=off [X86]
                                               kvm.nx_huge_pages=off [X86]
 +                                             srbds=off [X86,INTEL]
                                               no_entry_flush [PPC]
                                               no_uaccess_flush [PPC]
  
  
        nocache         [ARM]
  
 -      noclflush       [BUGS=X86] Don't use the CLFLUSH instruction
 -
        delayacct       [KNL] Enable per-task delay accounting
  
        nodsp           [SH] Disable hardware DSP at boot time.
  
        noexec          [IA-64]
  
 -      noexec          [X86]
 -                      On X86-32 available only on PAE configured kernels.
 -                      noexec=on: enable non-executable mappings (default)
 -                      noexec=off: disable non-executable mappings
 -
 -      nosmap          [X86,PPC]
 +      nosmap          [PPC]
                        Disable SMAP (Supervisor Mode Access Prevention)
                        even if it is supported by processor.
  
 -      nosmep          [X86,PPC64s]
 +      nosmep          [PPC64s]
                        Disable SMEP (Supervisor Mode Execution Prevention)
                        even if it is supported by processor.
  
  
        nosbagart       [IA-64]
  
 -      nosep           [BUGS=X86-32] Disables x86 SYSENTER/SYSEXIT support.
 -
        nosgx           [X86-64,SGX] Disables Intel SGX kernel support.
  
        nosmp           [SMP] Tells an SMP kernel to act as a UP kernel,
  
        rcupdate.rcu_cpu_stall_timeout= [KNL]
                        Set timeout for RCU CPU stall warning messages.
 +                      The value is in seconds and the maximum allowed
 +                      value is 300 seconds.
 +
 +      rcupdate.rcu_exp_cpu_stall_timeout= [KNL]
 +                      Set timeout for expedited RCU CPU stall warning
 +                      messages.  The value is in milliseconds
 +                      and the maximum allowed value is 21000
 +                      milliseconds. Please note that this value is
 +                      adjusted to an arch timer tick resolution.
 +                      Setting this to zero causes the value from
 +                      rcupdate.rcu_cpu_stall_timeout to be used (after
 +                      conversion from seconds to milliseconds).
  
        rcupdate.rcu_expedited= [KNL]
                        Use expedited grace-period primitives, for
                        number avoids disturbing real-time workloads,
                        but lengthens grace periods.
  
 +      rcupdate.rcu_task_stall_info= [KNL]
 +                      Set initial timeout in jiffies for RCU task stall
 +                      informational messages, which give some indication
 +                      of the problem for those not patient enough to
 +                      wait for ten minutes.  Informational messages are
 +                      only printed prior to the stall-warning message
 +                      for a given grace period. Disable with a value
 +                      less than or equal to zero.  Defaults to ten
 +                      seconds.  A change in value does not take effect
 +                      until the beginning of the next grace period.
 +
 +      rcupdate.rcu_task_stall_info_mult= [KNL]
 +                      Multiplier for time interval between successive
 +                      RCU task stall informational messages for a given
 +                      RCU tasks grace period.  This value is clamped
 +                      to one through ten, inclusive.  It defaults to
 +                      the value three, so that the first informational
 +                      message is printed 10 seconds into the grace
 +                      period, the second at 40 seconds, the third at
 +                      160 seconds, and then the stall warning at 600
 +                      seconds would prevent a fourth at 640 seconds.
 +
        rcupdate.rcu_task_stall_timeout= [KNL]
 -                      Set timeout in jiffies for RCU task stall warning
 -                      messages.  Disable with a value less than or equal
 -                      to zero.
 +                      Set timeout in jiffies for RCU task stall
 +                      warning messages.  Disable with a value less
 +                      than or equal to zero.  Defaults to ten minutes.
 +                      A change in value does not take effect until
 +                      the beginning of the next grace period.
  
        rcupdate.rcu_self_test= [KNL]
                        Run the RCU early boot self tests
  
        serialnumber    [BUGS=X86-32]
  
 +      sev=option[,option...] [X86-64] See Documentation/x86/x86_64/boot-options.rst
 +
        shapers=        [NET]
                        Maximal number of shapers.
  
        smart2=         [HW]
                        Format: <io1>[,<io2>[,...,<io8>]]
  
 +      smp.csd_lock_timeout= [KNL]
 +                      Specify the period of time in milliseconds
 +                      that smp_call_function() and friends will wait
 +                      for a CPU to release the CSD lock.  This is
 +                      useful when diagnosing bugs involving CPUs
 +                      disabling interrupts for extended periods
 +                      of time.  Defaults to 5,000 milliseconds, and
 +                      setting a value of zero disables this feature.
 +                      This feature may be more efficiently disabled
 +                      using the csdlock_debug- kernel parameter.
 +
        smsc-ircc2.nopnp        [HW] Don't use PNP to discover SMC devices
        smsc-ircc2.ircc_cfg=    [HW] Device configuration I/O port
        smsc-ircc2.ircc_sir=    [HW] SIR base I/O port
                        off:    Disable mitigation and remove
                                performance impact to RDRAND and RDSEED
  
 +      srcutree.big_cpu_lim [KNL]
 +                      Specifies the number of CPUs constituting a
 +                      large system, such that srcu_struct structures
 +                      should immediately allocate an srcu_node array.
 +                      This kernel-boot parameter defaults to 128,
 +                      but takes effect only when the low-order four
 +                      bits of srcutree.convert_to_big is equal to 3
 +                      (decide at boot).
 +
 +      srcutree.convert_to_big [KNL]
 +                      Specifies under what conditions an SRCU tree
 +                      srcu_struct structure will be converted to big
 +                      form, that is, with an rcu_node tree:
 +
 +                                 0:  Never.
 +                                 1:  At init_srcu_struct() time.
 +                                 2:  When rcutorture decides to.
 +                                 3:  Decide at boot time (default).
 +                              0x1X:  Above plus if high contention.
 +
 +                      Either way, the srcu_node tree will be sized based
 +                      on the actual runtime number of CPUs (nr_cpu_ids)
 +                      instead of the compile-time CONFIG_NR_CPUS.
 +
        srcutree.counter_wrap_check [KNL]
                        Specifies how frequently to check for
                        grace-period sequence counter wrap for the
                        expediting.  Set to zero to disable automatic
                        expediting.
  
 +      srcutree.small_contention_lim [KNL]
 +                      Specifies the number of update-side contention
 +                      events per jiffy will be tolerated before
 +                      initiating a conversion of an srcu_struct
 +                      structure to big form.  Note that the value of
 +                      srcutree.convert_to_big must have the 0x10 bit
 +                      set for contention-based conversions to occur.
 +
        ssbd=           [ARM64,HW]
                        Speculative Store Bypass Disable control
  
                        sources:
                        - "tpm"
                        - "tee"
 +                      - "caam"
                        If not specified then it defaults to iterating through
                        the trust source list starting with TPM and assigns the
                        first trust source as a backend which is initialized
                        successfully during iteration.
  
 +      trusted.rng=    [KEYS]
 +                      Format: <string>
 +                      The RNG used to generate key material for trusted keys.
 +                      Can be one of:
 +                      - "kernel"
 +                      - the same value as trusted.source: "tpm" or "tee"
 +                      - "default"
 +                      If not specified, "default" is used. In this case,
 +                      the RNG's choice is left to each individual trust source.
 +
        tsc=            Disable clocksource stability checks for TSC.
                        Format: <string>
                        [x86] reliable: mark tsc clocksource as reliable, this
index caf9d248ec2de7c542c067f67d33907827b430ee,c6fb62e0ef1ac8a0ef4472b6cd6f9af5c6412057..629785c95007641865a2b32165f382774ac18753
@@@ -14,7 -14,6 +14,6 @@@
  
  #define pr_fmt(fmt) "fs-verity: " fmt
  
- #include <crypto/sha2.h>
  #include <linux/fsverity.h>
  #include <linux/mempool.h>
  
@@@ -26,12 -25,6 +25,6 @@@ struct ahash_request
   */
  #define FS_VERITY_MAX_LEVELS          8
  
- /*
-  * Largest digest size among all hash algorithms supported by fs-verity.
-  * Currently assumed to be <= size of fsverity_descriptor::root_hash.
-  */
- #define FS_VERITY_MAX_DIGEST_SIZE     SHA512_DIGEST_SIZE
  /* A hash algorithm supported by fs-verity */
  struct fsverity_hash_alg {
        struct crypto_ahash *tfm; /* hash tfm, allocated on demand */
@@@ -122,14 -115,16 +115,14 @@@ int fsverity_init_merkle_tree_params(st
                                     const u8 *salt, size_t salt_size);
  
  struct fsverity_info *fsverity_create_info(const struct inode *inode,
 -                                         struct fsverity_descriptor *desc,
 -                                         size_t desc_size);
 +                                         struct fsverity_descriptor *desc);
  
  void fsverity_set_info(struct inode *inode, struct fsverity_info *vi);
  
  void fsverity_free_info(struct fsverity_info *vi);
  
  int fsverity_get_descriptor(struct inode *inode,
 -                          struct fsverity_descriptor **desc_ret,
 -                          size_t *desc_size_ret);
 +                          struct fsverity_descriptor **desc_ret);
  
  int __init fsverity_init_info_cache(void);
  void __init fsverity_exit_info_cache(void);
index a2464f3e66ccf386dd1630a096185850409ccf27,6cc90ce0056d78f59ad740e856dad3726700fe5d..8a1124e4d769602ec6a0d990a132e304b7ea7eac
@@@ -16,13 -16,35 +16,13 @@@ static efi_guid_t efi_cert_x509_sha256_
        EFI_CERT_X509_SHA256_GUID;
  static efi_guid_t efi_cert_sha256_guid __initdata = EFI_CERT_SHA256_GUID;
  
 -/*
 - * Blacklist a hash.
 - */
 -static __init void uefi_blacklist_hash(const char *source, const void *data,
 -                                     size_t len, const char *type,
 -                                     size_t type_len)
 -{
 -      char *hash, *p;
 -
 -      hash = kmalloc(type_len + len * 2 + 1, GFP_KERNEL);
 -      if (!hash)
 -              return;
 -      p = memcpy(hash, type, type_len);
 -      p += type_len;
 -      bin2hex(p, data, len);
 -      p += len * 2;
 -      *p = 0;
 -
 -      mark_hash_blacklisted(hash);
 -      kfree(hash);
 -}
 -
  /*
   * Blacklist an X509 TBS hash.
   */
  static __init void uefi_blacklist_x509_tbs(const char *source,
                                           const void *data, size_t len)
  {
 -      uefi_blacklist_hash(source, data, len, "tbs:", 4);
 +      mark_hash_blacklisted(data, len, BLACKLIST_HASH_X509_TBS);
  }
  
  /*
@@@ -31,7 -53,7 +31,7 @@@
  static __init void uefi_blacklist_binary(const char *source,
                                         const void *data, size_t len)
  {
 -      uefi_blacklist_hash(source, data, len, "bin:", 4);
 +      mark_hash_blacklisted(data, len, BLACKLIST_HASH_BINARY);
  }
  
  /*
@@@ -51,7 -73,7 +51,7 @@@ __init efi_element_handler_t get_handle
  {
        if (efi_guidcmp(*sig_type, efi_cert_x509_guid) == 0)
                return add_to_platform_keyring;
-       return 0;
+       return NULL;
  }
  
  /*
@@@ -66,7 -88,7 +66,7 @@@ __init efi_element_handler_t get_handle
                else
                        return add_to_platform_keyring;
        }
-       return 0;
+       return NULL;
  }
  
  /*
@@@ -81,5 -103,5 +81,5 @@@ __init efi_element_handler_t get_handle
                return uefi_blacklist_binary;
        if (efi_guidcmp(*sig_type, efi_cert_x509_guid) == 0)
                return uefi_revocation_list_x509;
-       return 0;
+       return NULL;
  }
This page took 0.086121 seconds and 4 git commands to generate.