Skip to content
Snippets Groups Projects
  1. Jun 16, 2022
    • Christian Göttsche's avatar
      selinux: free contexts previously transferred in selinux_add_opt() · cad140d0
      Christian Göttsche authored
      
      `selinux_add_opt()` stopped taking ownership of the passed context since
      commit 70f4169a ("selinux: parse contexts for mount options early").
      
          unreferenced object 0xffff888114dfd140 (size 64):
            comm "mount", pid 15182, jiffies 4295687028 (age 796.340s)
            hex dump (first 32 bytes):
              73 79 73 74 65 6d 5f 75 3a 6f 62 6a 65 63 74 5f  system_u:object_
              72 3a 74 65 73 74 5f 66 69 6c 65 73 79 73 74 65  r:test_filesyste
            backtrace:
              [<ffffffffa07dbef4>] kmemdup_nul+0x24/0x80
              [<ffffffffa0d34253>] selinux_sb_eat_lsm_opts+0x293/0x560
              [<ffffffffa0d13f08>] security_sb_eat_lsm_opts+0x58/0x80
              [<ffffffffa0af1eb2>] generic_parse_monolithic+0x82/0x180
              [<ffffffffa0a9c1a5>] do_new_mount+0x1f5/0x550
              [<ffffffffa0a9eccb>] path_mount+0x2ab/0x1570
              [<ffffffffa0aa019e>] __x64_sys_mount+0x20e/0x280
              [<ffffffffa1f47124>] do_syscall_64+0x34/0x80
              [<ffffffffa200007e>] entry_SYSCALL_64_after_hwframe+0x46/0xb0
      
          unreferenced object 0xffff888108e71640 (size 64):
            comm "fsmount", pid 7607, jiffies 4295044974 (age 1601.016s)
            hex dump (first 32 bytes):
              73 79 73 74 65 6d 5f 75 3a 6f 62 6a 65 63 74 5f  system_u:object_
              72 3a 74 65 73 74 5f 66 69 6c 65 73 79 73 74 65  r:test_filesyste
            backtrace:
              [<ffffffff861dc2b1>] memdup_user+0x21/0x90
              [<ffffffff861dc367>] strndup_user+0x47/0xa0
              [<ffffffff864f6965>] __do_sys_fsconfig+0x485/0x9f0
              [<ffffffff87940124>] do_syscall_64+0x34/0x80
              [<ffffffff87a0007e>] entry_SYSCALL_64_after_hwframe+0x46/0xb0
      
      Cc: stable@vger.kernel.org
      Fixes: 70f4169a ("selinux: parse contexts for mount options early")
      Signed-off-by: default avatarChristian Göttsche <cgzones@googlemail.com>
      Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
      cad140d0
  2. Jun 08, 2022
    • David Safford's avatar
      KEYS: trusted: tpm2: Fix migratable logic · dda53843
      David Safford authored
      
      When creating (sealing) a new trusted key, migratable
      trusted keys have the FIXED_TPM and FIXED_PARENT attributes
      set, and non-migratable keys don't. This is backwards, and
      also causes creation to fail when creating a migratable key
      under a migratable parent. (The TPM thinks you are trying to
      seal a non-migratable blob under a migratable parent.)
      
      The following simple patch fixes the logic, and has been
      tested for all four combinations of migratable and non-migratable
      trusted keys and parent storage keys. With this logic, you will
      get a proper failure if you try to create a non-migratable
      trusted key under a migratable parent storage key, and all other
      combinations work correctly.
      
      Cc: stable@vger.kernel.org # v5.13+
      Fixes: e5fb5d2c ("security: keys: trusted: Make sealed key properly interoperable")
      Signed-off-by: default avatarDavid Safford <david.safford@gmail.com>
      Reviewed-by: default avatarAhmad Fatoum <a.fatoum@pengutronix.de>
      Reviewed-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
      Signed-off-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
      dda53843
  3. May 24, 2022
  4. May 23, 2022
  5. May 20, 2022
  6. May 17, 2022
  7. May 16, 2022
  8. May 15, 2022
    • Aditya Garg's avatar
      efi: Do not import certificates from UEFI Secure Boot for T2 Macs · 155ca952
      Aditya Garg authored
      
      On Apple T2 Macs, when Linux attempts to read the db and dbx efi variables
      at early boot to load UEFI Secure Boot certificates, a page fault occurs
      in Apple firmware code and EFI runtime services are disabled with the
      following logs:
      
      [Firmware Bug]: Page fault caused by firmware at PA: 0xffffb1edc0068000
      WARNING: CPU: 3 PID: 104 at arch/x86/platform/efi/quirks.c:735 efi_crash_gracefully_on_page_fault+0x50/0xf0
      (Removed some logs from here)
      Call Trace:
       <TASK>
       page_fault_oops+0x4f/0x2c0
       ? search_bpf_extables+0x6b/0x80
       ? search_module_extables+0x50/0x80
       ? search_exception_tables+0x5b/0x60
       kernelmode_fixup_or_oops+0x9e/0x110
       __bad_area_nosemaphore+0x155/0x190
       bad_area_nosemaphore+0x16/0x20
       do_kern_addr_fault+0x8c/0xa0
       exc_page_fault+0xd8/0x180
       asm_exc_page_fault+0x1e/0x30
      (Removed some logs from here)
       ? __efi_call+0x28/0x30
       ? switch_mm+0x20/0x30
       ? efi_call_rts+0x19a/0x8e0
       ? process_one_work+0x222/0x3f0
       ? worker_thread+0x4a/0x3d0
       ? kthread+0x17a/0x1a0
       ? process_one_work+0x3f0/0x3f0
       ? set_kthread_struct+0x40/0x40
       ? ret_from_fork+0x22/0x30
       </TASK>
      ---[ end trace 1f82023595a5927f ]---
      efi: Froze efi_rts_wq and disabled EFI Runtime Services
      integrity: Couldn't get size: 0x8000000000000015
      integrity: MODSIGN: Couldn't get UEFI db list
      efi: EFI Runtime Services are disabled!
      integrity: Couldn't get size: 0x8000000000000015
      integrity: Couldn't get UEFI dbx list
      integrity: Couldn't get size: 0x8000000000000015
      integrity: Couldn't get mokx list
      integrity: Couldn't get size: 0x80000000
      
      So we avoid reading these UEFI variables and thus prevent the crash.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarAditya Garg <gargaditya08@live.com>
      Reviewed-by: default avatarMimi Zohar <zohar@linux.ibm.com>
      Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
      155ca952
  9. May 13, 2022
  10. May 09, 2022
  11. May 08, 2022
  12. May 05, 2022
    • Mimi Zohar's avatar
      ima: support fs-verity file digest based version 3 signatures · 398c42e2
      Mimi Zohar authored
      
      IMA may verify a file's integrity against a "good" value stored in the
      'security.ima' xattr or as an appended signature, based on policy.  When
      the "good value" is stored in the xattr, the xattr may contain a file
      hash or signature.  In either case, the "good" value is preceded by a
      header.  The first byte of the xattr header indicates the type of data
      - hash, signature - stored in the xattr.  To support storing fs-verity
      signatures in the 'security.ima' xattr requires further differentiating
      the fs-verity signature from the existing IMA signature.
      
      In addition the signatures stored in 'security.ima' xattr, need to be
      disambiguated.  Instead of directly signing the fs-verity digest, a new
      signature format version 3 is defined as the hash of the ima_file_id
      structure, which identifies the type of signature and the digest.
      
      The IMA policy defines "which" files are to be measured, verified, and/or
      audited.  For those files being verified, the policy rules indicate "how"
      the file should be verified.  For example to require a file be signed,
      the appraise policy rule must include the 'appraise_type' option.
      
      	appraise_type:= [imasig] | [imasig|modsig] | [sigv3]
                 where 'imasig' is the original or signature format v2 (default),
                 where 'modsig' is an appended signature,
                 where 'sigv3' is the signature format v3.
      
      The policy rule must also indicate the type of digest, if not the IMA
      default, by first specifying the digest type:
      
      	digest_type:= [verity]
      
      The following policy rule requires fsverity signatures.  The rule may be
      constrained, for example based on a fsuuid or LSM label.
      
            appraise func=BPRM_CHECK digest_type=verity appraise_type=sigv3
      
      Acked-by: default avatarStefan Berger <stefanb@linux.ibm.com>
      Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
      398c42e2
    • Mimi Zohar's avatar
      ima: permit fsverity's file digests in the IMA measurement list · 54f03916
      Mimi Zohar authored
      
      Permit fsverity's file digest (a hash of struct fsverity_descriptor) to
      be included in the IMA measurement list, based on the new measurement
      policy rule 'digest_type=verity' option.
      
      To differentiate between a regular IMA file hash from an fsverity's
      file digest, use the new d-ngv2 format field included in the ima-ngv2
      template.
      
      The following policy rule requires fsverity file digests and specifies
      the new 'ima-ngv2' template, which contains the new 'd-ngv2' field.  The
      policy rule may be constrained, for example based on a fsuuid or LSM
      label.
      
      measure func=FILE_CHECK digest_type=verity template=ima-ngv2
      
      Acked-by: default avatarStefan Berger <stefanb@linux.ibm.com>
      Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
      54f03916
    • Mimi Zohar's avatar
      ima: define a new template field named 'd-ngv2' and templates · 989dc725
      Mimi Zohar authored
      
      In preparation to differentiate between unsigned regular IMA file
      hashes and fs-verity's file digests in the IMA measurement list,
      define a new template field named 'd-ngv2'.
      
      Also define two new templates named 'ima-ngv2' and 'ima-sigv2', which
      include the new 'd-ngv2' field.
      
      Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
      989dc725
  13. May 03, 2022
Loading