1. 06 1月, 2022 1 次提交
  2. 07 11月, 2021 1 次提交
  3. 07 10月, 2021 2 次提交
  4. 04 9月, 2021 1 次提交
  5. 03 8月, 2021 2 次提交
    • M
      arm64: kasan: mte: remove redundant mte_report_once logic · 76721503
      Mark Rutland 提交于
      We have special logic to suppress MTE tag check fault reporting, based
      on a global `mte_report_once` and `reported` variables. These can be
      used to suppress calling kasan_report() when taking a tag check fault,
      but do not prevent taking the fault in the first place, nor does they
      affect the way we disable tag checks upon taking a fault.
      
      The core KASAN code already defaults to reporting a single fault, and
      has a `multi_shot` control to permit reporting multiple faults. The only
      place we transiently alter `mte_report_once` is in lib/test_kasan.c,
      where we also the `multi_shot` state as the same time. Thus
      `mte_report_once` and `reported` are redundant, and can be removed.
      
      When a tag check fault is taken, tag checking will be disabled by
      `do_tag_recovery` and must be explicitly re-enabled if desired. The test
      code does this by calling kasan_enable_tagging_sync().
      
      This patch removes the redundant mte_report_once() logic and associated
      variables.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Andrey Konovalov <andreyknvl@gmail.com>
      Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
      Reviewed-by: NCatalin Marinas <catalin.marinas@arm.com>
      Reviewed-by: NAndrey Konovalov <andreyknvl@gmail.com>
      Tested-by: NAndrey Konovalov <andreyknvl@gmail.com>
      Link: https://lore.kernel.org/r/20210714143843.56537-4-mark.rutland@arm.comSigned-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      76721503
    • M
      arm64: kasan: mte: use a constant kernel GCR_EL1 value · 82868247
      Mark Rutland 提交于
      When KASAN_HW_TAGS is selected, KASAN is enabled at boot time, and the
      hardware supports MTE, we'll initialize `kernel_gcr_excl` with a value
      dependent on KASAN_TAG_MAX. While the resulting value is a constant
      which depends on KASAN_TAG_MAX, we have to perform some runtime work to
      generate the value, and have to read the value from memory during the
      exception entry path. It would be better if we could generate this as a
      constant at compile-time, and use it as such directly.
      
      Early in boot within __cpu_setup(), we initialize GCR_EL1 to a safe
      value, and later override this with the value required by KASAN. If
      CONFIG_KASAN_HW_TAGS is not selected, or if KASAN is disabeld at boot
      time, the kernel will not use IRG instructions, and so the initial value
      of GCR_EL1 is does not matter to the kernel. Thus, we can instead have
      __cpu_setup() initialize GCR_EL1 to a value consistent with
      KASAN_TAG_MAX, and avoid the need to re-initialize it during hotplug and
      resume form suspend.
      
      This patch makes arem64 use a compile-time constant KERNEL_GCR_EL1
      value, which is compatible with KASAN_HW_TAGS when this is selected.
      This removes the need to re-initialize GCR_EL1 dynamically, and acts as
      an optimization to the entry assembly, which no longer needs to load
      this value from memory. The redundant initialization hooks are removed.
      
      In order to do this, KASAN_TAG_MAX needs to be visible outside of the
      core KASAN code. To do this, I've moved the KASAN_TAG_* values into
      <linux/kasan-tags.h>.
      
      There should be no functional change as a result of this patch.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Andrey Konovalov <andreyknvl@gmail.com>
      Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Peter Collingbourne <pcc@google.com>
      Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Reviewed-by: NCatalin Marinas <catalin.marinas@arm.com>
      Reviewed-by: NAndrey Konovalov <andreyknvl@gmail.com>
      Tested-by: NAndrey Konovalov <andreyknvl@gmail.com>
      Link: https://lore.kernel.org/r/20210714143843.56537-3-mark.rutland@arm.comSigned-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      82868247
  6. 16 7月, 2021 1 次提交
  7. 30 6月, 2021 3 次提交
  8. 07 5月, 2021 1 次提交
  9. 01 5月, 2021 4 次提交
  10. 17 4月, 2021 1 次提交
  11. 11 4月, 2021 3 次提交
  12. 27 2月, 2021 3 次提交
  13. 25 2月, 2021 4 次提交
  14. 06 2月, 2021 1 次提交
  15. 23 12月, 2020 12 次提交