@@ -13,6 +13,7 @@ config ARM64
1313 select ARCH_WANT_OPTIONAL_GPIOLIB
1414 select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
1515 select ARCH_WANT_FRAME_POINTERS
16+ select ARCH_HAS_UBSAN_SANITIZE_ALL
1617 select ARM_AMBA
1718 select ARM_ARCH_TIMER
1819 select ARM_GIC
@@ -48,6 +49,7 @@ config ARM64
4849 select HAVE_ALIGNED_STRUCT_PAGE if SLUB
4950 select HAVE_ARCH_AUDITSYSCALL
5051 select HAVE_ARCH_BITREVERSE
52+ select HAVE_ARCH_HUGE_VMAP
5153 select HAVE_ARCH_JUMP_LABEL
5254 select HAVE_ARCH_KASAN if SPARSEMEM_VMEMMAP && !(ARM64_16K_PAGES && ARM64_VA_BITS_48)
5355 select HAVE_ARCH_KGDB
@@ -70,6 +72,7 @@ config ARM64
7072 select HAVE_FUNCTION_GRAPH_TRACER
7173 select HAVE_GENERIC_DMA_COHERENT
7274 select HAVE_HW_BREAKPOINT if PERF_EVENTS
75+ select HAVE_IRQ_TIME_ACCOUNTING
7376 select HAVE_MEMBLOCK
7477 select HAVE_PATA_PLATFORM
7578 select HAVE_PERF_EVENTS
@@ -362,6 +365,7 @@ config ARM64_ERRATUM_843419
362365 bool "Cortex-A53: 843419: A load or store might access an incorrect address"
363366 depends on MODULES
364367 default y
368+ select ARM64_MODULE_CMODEL_LARGE
365369 help
366370 This option builds kernel modules using the large memory model in
367371 order to avoid the use of the ADRP instruction, which can cause
@@ -506,6 +510,9 @@ config HOTPLUG_CPU
506510source kernel/Kconfig.preempt
507511source kernel/Kconfig.hz
508512
513+ config ARCH_SUPPORTS_DEBUG_PAGEALLOC
514+ def_bool y
515+
509516config ARCH_HAS_HOLES_MEMORYMODEL
510517 def_bool y if SPARSEMEM
511518
@@ -529,9 +536,6 @@ config HW_PERF_EVENTS
529536config SYS_SUPPORTS_HUGETLBFS
530537 def_bool y
531538
532- config ARCH_WANT_GENERAL_HUGETLB
533- def_bool y
534-
535539config ARCH_WANT_HUGE_PMD_SHARE
536540 def_bool y if ARM64_4K_PAGES || (ARM64_16K_PAGES && !ARM64_VA_BITS_36)
537541
@@ -704,10 +708,93 @@ config ARM64_LSE_ATOMICS
704708
705709endmenu
706710
711+ config ARM64_UAO
712+ bool "Enable support for User Access Override (UAO)"
713+ default y
714+ help
715+ User Access Override (UAO; part of the ARMv8.2 Extensions)
716+ causes the 'unprivileged' variant of the load/store instructions to
717+ be overriden to be privileged.
718+
719+ This option changes get_user() and friends to use the 'unprivileged'
720+ variant of the load/store instructions. This ensures that user-space
721+ really did have access to the supplied memory. When addr_limit is
722+ set to kernel memory the UAO bit will be set, allowing privileged
723+ access to kernel memory.
724+
725+ Choosing this option will cause copy_to_user() et al to use user-space
726+ memory permissions.
727+
728+ The feature is detected at runtime, the kernel will use the
729+ regular load/store instructions if the cpu does not implement the
730+ feature.
731+
732+ config ARM64_MODULE_CMODEL_LARGE
733+ bool
734+
735+ config ARM64_MODULE_PLTS
736+ bool
737+ select ARM64_MODULE_CMODEL_LARGE
738+ select HAVE_MOD_ARCH_SPECIFIC
739+
740+ config RELOCATABLE
741+ bool
742+ help
743+ This builds the kernel as a Position Independent Executable (PIE),
744+ which retains all relocation metadata required to relocate the
745+ kernel binary at runtime to a different virtual address than the
746+ address it was linked at.
747+ Since AArch64 uses the RELA relocation format, this requires a
748+ relocation pass at runtime even if the kernel is loaded at the
749+ same address it was linked at.
750+
751+ config RANDOMIZE_BASE
752+ bool "Randomize the address of the kernel image"
753+ select ARM64_MODULE_PLTS
754+ select RELOCATABLE
755+ help
756+ Randomizes the virtual address at which the kernel image is
757+ loaded, as a security feature that deters exploit attempts
758+ relying on knowledge of the location of kernel internals.
759+
760+ It is the bootloader's job to provide entropy, by passing a
761+ random u64 value in /chosen/kaslr-seed at kernel entry.
762+
763+ When booting via the UEFI stub, it will invoke the firmware's
764+ EFI_RNG_PROTOCOL implementation (if available) to supply entropy
765+ to the kernel proper. In addition, it will randomise the physical
766+ location of the kernel Image as well.
767+
768+ If unsure, say N.
769+
770+ config RANDOMIZE_MODULE_REGION_FULL
771+ bool "Randomize the module region independently from the core kernel"
772+ depends on RANDOMIZE_BASE
773+ default y
774+ help
775+ Randomizes the location of the module region without considering the
776+ location of the core kernel. This way, it is impossible for modules
777+ to leak information about the location of core kernel data structures
778+ but it does imply that function calls between modules and the core
779+ kernel will need to be resolved via veneers in the module PLT.
780+
781+ When this option is not set, the module region will be randomized over
782+ a limited range that contains the [_stext, _etext] interval of the
783+ core kernel, so branch relocations are always in range.
784+
707785endmenu
708786
709787menu "Boot options"
710788
789+ config ARM64_ACPI_PARKING_PROTOCOL
790+ bool "Enable support for the ARM64 ACPI parking protocol"
791+ depends on ACPI
792+ help
793+ Enable support for the ARM64 ACPI parking protocol. If disabled
794+ the kernel will not allow booting through the ARM64 ACPI parking
795+ protocol even if the corresponding data is present in the ACPI
796+ MADT table.
797+
711798config CMDLINE
712799 string "Default kernel command string"
713800 default ""
0 commit comments