Skip to content
  1. Feb 17, 2021
  2. Jan 17, 2021
  3. Nov 13, 2020
  4. Oct 01, 2020
  5. Sep 29, 2020
  6. Sep 14, 2020
    • Amit Daniel Kachhap's avatar
      arm64: cpufeature: Modify address authentication cpufeature to exact · ba9d1d3e
      Amit Daniel Kachhap authored
      
      
      The current address authentication cpufeature levels are set as LOWER_SAFE
      which is not compatible with the different configurations added for Armv8.3
      ptrauth enhancements as the different levels have different behaviour and
      there is no tunable to enable the lower safe versions. This is rectified
      by setting those cpufeature type as EXACT.
      
      The current cpufeature framework also does not interfere in the booting of
      non-exact secondary cpus but rather marks them as tainted. As a workaround
      this is fixed by replacing the generic match handler with a new handler
      specific to ptrauth.
      
      After this change, if there is any variation in ptrauth configurations in
      secondary cpus from boot cpu then those mismatched cpus are parked in an
      infinite loop.
      
      Following ptrauth crash log is observed in Arm fastmodel with simulated
      mismatched cpus without this fix,
      
       CPU features: SANITY CHECK: Unexpected variation in SYS_ID_AA64ISAR1_EL1. Boot CPU: 0x11111110211402, CPU4: 0x11111110211102
       CPU features: Unsupported CPU feature variation detected.
       GICv3: CPU4: found redistributor 100 region 0:0x000000002f180000
       CPU4: Booted secondary processor 0x0000000100 [0x410fd0f0]
       Unable to handle kernel paging request at virtual address bfff800010dadf3c
       Mem abort info:
         ESR = 0x86000004
         EC = 0x21: IABT (current EL), IL = 32 bits
         SET = 0, FnV = 0
         EA = 0, S1PTW = 0
       [bfff800010dadf3c] address between user and kernel address ranges
       Internal error: Oops: 86000004 [#1] PREEMPT SMP
       Modules linked in:
       CPU: 4 PID: 29 Comm: migration/4 Tainted: G S                5.8.0-rc4-00005-ge658591d66d1-dirty #158
       Hardware name: Foundation-v8A (DT)
       pstate: 60000089 (nZCv daIf -PAN -UAO BTYPE=--)
       pc : 0xbfff800010dadf3c
       lr : __schedule+0x2b4/0x5a8
       sp : ffff800012043d70
       x29: ffff800012043d70 x28: 0080000000000000
       x27: ffff800011cbe000 x26: ffff00087ad37580
       x25: ffff00087ad37000 x24: ffff800010de7d50
       x23: ffff800011674018 x22: 0784800010dae2a8
       x21: ffff00087ad37000 x20: ffff00087acb8000
       x19: ffff00087f742100 x18: 0000000000000030
       x17: 0000000000000000 x16: 0000000000000000
       x15: ffff800011ac1000 x14: 00000000000001bd
       x13: 0000000000000000 x12: 0000000000000000
       x11: 0000000000000000 x10: 71519a147ddfeb82
       x9 : 825d5ec0fb246314 x8 : ffff00087ad37dd8
       x7 : 0000000000000000 x6 : 00000000fffedb0e
       x5 : 00000000ffffffff x4 : 0000000000000000
       x3 : 0000000000000028 x2 : ffff80086e11e000
       x1 : ffff00087ad37000 x0 : ffff00087acdc600
       Call trace:
        0xbfff800010dadf3c
        schedule+0x78/0x110
        schedule_preempt_disabled+0x24/0x40
        __kthread_parkme+0x68/0xd0
        kthread+0x138/0x160
        ret_from_fork+0x10/0x34
       Code: bad PC value
      
      After this fix, the mismatched CPU4 is parked as,
       CPU features: CPU4: Detected conflict for capability 39 (Address authentication (IMP DEF algorithm)), System: 1, CPU: 0
       CPU4: will not boot
       CPU4: failed to come online
       CPU4: died during early boot
      
      [Suzuki: Introduce new matching function for address authentication]
      
      Suggested-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
      Signed-off-by: default avatarAmit Daniel Kachhap <amit.kachhap@arm.com>
      Reviewed-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
      Reviewed-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Link: https://lore.kernel.org/r/20200914083656.21428-5-amit.kachhap@arm.com
      
      
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      ba9d1d3e
  7. Sep 04, 2020
  8. Aug 24, 2020
  9. Jul 15, 2020
  10. Jul 07, 2020
  11. Jul 03, 2020
  12. Jul 02, 2020
  13. Jun 24, 2020
  14. May 29, 2020
  15. May 27, 2020
  16. May 21, 2020
  17. May 20, 2020
  18. May 08, 2020
    • Mark Brown's avatar
      arm64: Set GP bit in kernel page tables to enable BTI for the kernel · c8027285
      Mark Brown authored
      
      
      Now that the kernel is built with BTI annotations enable the feature by
      setting the GP bit in the stage 1 translation tables.  This is done
      based on the features supported by the boot CPU so that we do not need
      to rewrite the translation tables.
      
      In order to avoid potential issues on big.LITTLE systems when there are
      a mix of BTI and non-BTI capable CPUs in the system when we have enabled
      kernel mode BTI we change BTI to be a _STRICT_BOOT_CPU_FEATURE when we
      have kernel BTI.  This will prevent any CPUs that don't support BTI
      being started if the boot CPU supports BTI rather than simply not using
      BTI as we do when supporting BTI only in userspace.  The main concern is
      the possibility of BTYPE being preserved by a CPU that does not
      implement BTI when a thread is migrated to it resulting in an incorrect
      state which could generate an exception when the thread migrates back to
      a CPU that does support BTI.  If we encounter practical systems which
      mix BTI and non-BTI CPUs we will need to revisit this implementation.
      
      Since we currently do not generate landing pads in the BPF JIT we only
      map the base kernel text in this way.
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Reviewed-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Link: https://lore.kernel.org/r/20200506195138.22086-5-broonie@kernel.org
      
      
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      c8027285
  19. May 05, 2020