arm64: Drop unneeded __nocfi attributes
authorSami Tolvanen <samitolvanen@google.com>
Thu, 8 Sep 2022 21:54:53 +0000 (14:54 -0700)
committerKees Cook <keescook@chromium.org>
Mon, 26 Sep 2022 17:13:14 +0000 (10:13 -0700)
With -fsanitize=kcfi, CONFIG_CFI_CLANG no longer has issues
with address space confusion in functions that switch to linear
mapping. Now that the indirectly called assembly functions have
type annotations, drop the __nocfi attributes.

Suggested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Tested-by: Kees Cook <keescook@chromium.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20220908215504.3686827-12-samitolvanen@google.com
arch/arm64/include/asm/mmu_context.h
arch/arm64/kernel/alternative.c
arch/arm64/kernel/cpufeature.c

index c7ccd82db1d24bb3b8a3dfe7b95ff25bde59dc70..bba0e630c8bc074f787d49d180b5aae017bf51d6 100644 (file)
@@ -147,7 +147,7 @@ static inline void cpu_install_ttbr0(phys_addr_t ttbr0, unsigned long t0sz)
  * Atomically replaces the active TTBR1_EL1 PGD with a new VA-compatible PGD,
  * avoiding the possibility of conflicting TLB entries being allocated.
  */
-static inline void __nocfi cpu_replace_ttbr1(pgd_t *pgdp, pgd_t *idmap)
+static inline void cpu_replace_ttbr1(pgd_t *pgdp, pgd_t *idmap)
 {
        typedef void (ttbr_replace_func)(phys_addr_t);
        extern ttbr_replace_func idmap_cpu_replace_ttbr1;
index 9bcaa5eacf16cf1ccf76d64f1886f52c54caef77..d2c66507398d7567512578cb7a2dfd9ac4760d22 100644 (file)
@@ -133,7 +133,7 @@ static void clean_dcache_range_nopatch(u64 start, u64 end)
        } while (cur += d_size, cur < end);
 }
 
-static void __nocfi __apply_alternatives(struct alt_region *region, bool is_module,
+static void __apply_alternatives(struct alt_region *region, bool is_module,
                                 unsigned long *feature_mask)
 {
        struct alt_instr *alt;
index af4de817d7123a3608fdcab8b2c1dc42bcdc42aa..ca6e5ca7104eda1d1bd6e01403ccc58f0ffeb838 100644 (file)
@@ -1685,7 +1685,7 @@ static phys_addr_t kpti_ng_pgd_alloc(int shift)
        return kpti_ng_temp_alloc;
 }
 
-static void __nocfi
+static void
 kpti_install_ng_mappings(const struct arm64_cpu_capabilities *__unused)
 {
        typedef void (kpti_remap_fn)(int, int, phys_addr_t, unsigned long);