Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
18015b7
UBUNTU: [Packaging] initialize linux-hwe-6.2
May 10, 2023
2212435
UBUNTU: [Packaging] update variants
May 10, 2023
93e1771
UBUNTU: [Packaging] update update.conf
May 10, 2023
a2a52e1
UBUNTU: [Packaging] import and update copy-files and local-mangle
May 10, 2023
5169412
UBUNTU: [Config] import annotations from master
May 10, 2023
2eb7ede
UBUNTU: Start new release
May 10, 2023
1cadfc6
UBUNTU: link-to-tracker: update tracking bug
May 10, 2023
2c785f6
UBUNTU: Ubuntu-hwe-6.2-6.2.0-21.21~22.04.2
May 10, 2023
a07bd8b
UBUNTU: [Packaging] update variants
May 11, 2023
02ce1dc
UBUNTU: [Packaging] update Ubuntu.md
May 11, 2023
fb19899
Revert "UBUNTU: SAUCE: modpost: support arbitrary symbol length in mo…
May 24, 2023
748add8
UBUNTU: Start new release
May 30, 2023
e52edba
UBUNTU: link-to-tracker: update tracking bug
May 30, 2023
8037e24
UBUNTU: Ubuntu-hwe-6.2-6.2.0-23.23~22.04.1
May 30, 2023
9c81f82
UBUNTU: [Packaging] Update local-mangle to override gcc version
LukeNow Jun 27, 2023
c998a85
UBUNTU: [Packaging] update local-mangle to not include rust
LukeNow Jun 27, 2023
661f6ca
UBUNTU: [Config] Update annotations after change to gcc-11
LukeNow Jun 27, 2023
4d9a3ea
UBUNTU: Start new release
LukeNow Jun 27, 2023
5fb7e61
UBUNTU: [Packaging] Replace miscellaneous changelog entries
LukeNow Jun 27, 2023
bd6e4bc
UBUNTU: link-to-tracker: update tracking bug
LukeNow Jun 27, 2023
d74d3d2
UBUNTU: Ubuntu-hwe-6.2-6.2.0-25.25~22.04.1
LukeNow Jun 27, 2023
6c26e8c
UBUNTU: [Config] Do not override RUST_IS_AVAILABLE
smb49 Jun 28, 2023
214e6eb
UBUNTU: Ubuntu-hwe-6.2-6.2.0-25.25~22.04.2
smb49 Jun 28, 2023
f9447fc
UBUNTU: [Packaging] Convert getabis to hwe-6.2
smb49 Jul 13, 2023
7af925c
UBUNTU: Start new release
smb49 Jul 13, 2023
40a846b
UBUNTU: link-to-tracker: update tracking bug
smb49 Jul 13, 2023
94174b5
UBUNTU: Ubuntu-hwe-6.2-6.2.0-26.26~22.04.1
smb49 Jul 13, 2023
ab043ba
UBUNTU: [Packaging] update variants
smb49 Aug 16, 2023
757e3b6
UBUNTU: [Config] Keep Rust disabled
smb49 Aug 16, 2023
6264e99
UBUNTU: [Config] Drop CONFIG_PAHOLE_HAS_LANG_EXCLUDE deviation
smb49 Aug 16, 2023
7450cf8
UBUNTU: Start new release
smb49 Aug 16, 2023
6d50b1f
UBUNTU: link-to-tracker: update tracking bug
smb49 Aug 16, 2023
fc01c01
UBUNTU: Ubuntu-hwe-6.2-6.2.0-31.31~22.04.1
smb49 Aug 16, 2023
4f4cbdb
UBUNTU: Start new release
smb49 Aug 18, 2023
a2951dc
UBUNTU: link-to-tracker: update tracking bug
smb49 Aug 18, 2023
9d2221b
UBUNTU: Ubuntu-hwe-6.2-6.2.0-32.32~22.04.1
smb49 Aug 18, 2023
fa6c95b
UBUNTU: Start new release
smb49 Sep 7, 2023
ef609be
UBUNTU: link-to-tracker: update tracking bug
smb49 Sep 7, 2023
49b9033
UBUNTU: Ubuntu-hwe-6.2-6.2.0-34.34~22.04.1
smb49 Sep 7, 2023
e481946
UBUNTU: Start new release
smb49 Oct 6, 2023
43344f7
UBUNTU: link-to-tracker: update tracking bug
smb49 Oct 6, 2023
6ef7394
UBUNTU: [Config] hwe-6.2: Mark cls_rsv[p,p6] gone
smb49 Oct 6, 2023
5c1aa74
UBUNTU: Ubuntu-hwe-6.2-6.2.0-35.35~22.04.1
smb49 Oct 6, 2023
1d40ec1
UBUNTU: Start new release
smb49 Oct 9, 2023
0829d01
UBUNTU: link-to-tracker: update tracking bug
smb49 Oct 9, 2023
2ce7058
UBUNTU: Ubuntu-hwe-6.2-6.2.0-36.37~22.04.1
smb49 Oct 9, 2023
fa2e7a8
UBUNTU: [Packaging] Initialize linux-nvidia-6.2
ianmay81 Apr 6, 2023
05589a5
UBUNTU: [Packaging] update variants
ianmay81 May 3, 2023
dd9ccba
UBUNTU: [Packaging] update Ubuntu.md
ianmay81 May 3, 2023
d3e18a3
UBUNTU: [Packaging] update update.conf
ianmay81 May 3, 2023
2cf5c7e
UBUNTU: Start new release
ianmay81 May 3, 2023
9c5ebf9
UBUNTU: Ubuntu-nvidia-6.2-6.2.0-1002.2~22.04.1
ianmay81 May 3, 2023
f9c6be5
UBUNTU: [Packaging] fix Vcs-Git url
ianmay81 May 4, 2023
99b8c7a
UBUNTU: [Packaging] update helper script
ianmay81 May 31, 2023
9a202c8
UBUNTU: Start new release
ianmay81 May 31, 2023
30f4a6a
UBUNTU: link-to-tracker: update tracking bug
ianmay81 May 31, 2023
d95827f
UBUNTU: Ubuntu-nvidia-6.2-6.2.0-1003.3~22.04.1
ianmay81 May 31, 2023
94924e0
spi: Add TPM HW flow flag
kkyarlagadda Apr 21, 2023
b7e22dc
spi: tegra210-quad: Enable TPM wait polling
kkyarlagadda Apr 21, 2023
8a66fe3
spi: tegra210-quad: set half duplex flag
kkyarlagadda Feb 23, 2023
5e60752
genirq: Use hlist for managing resend handlers
shankerd04 May 19, 2023
d82c89b
genirq: Encapsulate sparse bitmap handling
shankerd04 May 19, 2023
eb19689
genirq: Use a maple tree for interrupt descriptor management
shankerd04 May 19, 2023
5c10ded
tpm_tis-spi: Add hardware wait polling
kkyarlagadda Apr 21, 2023
9da368d
arm64: kaslr: don't pretend KASLR is enabled if offset < MIN_KIMG_ALIGN
ardbiesheuvel Feb 23, 2023
cdf53b7
arm64: module: remove old !KASAN_VMALLOC logic
mrutland-arm May 30, 2023
3453146
arm64: kasan: remove !KASAN_VMALLOC remnants
mrutland-arm May 30, 2023
ed71b1f
arm64: kaslr: split kaslr/module initialization
mrutland-arm May 30, 2023
e452344
arm64: module: move module randomization to module.c
mrutland-arm May 30, 2023
c2bdecd
arm64: module: mandate MODULE_PLTS
mrutland-arm May 30, 2023
807d82a
arm64: module: rework module VA range selection
mrutland-arm May 30, 2023
53d848a
UBUNTU: [Packaging] resync getabis
nvidia-bfigg Jun 28, 2023
39ef130
UBUNTU: [Packaging] update helper scripts
nvidia-bfigg Jun 28, 2023
3b6e034
UBUNTU: [Packaging] resync getabis
nvidia-bfigg Jun 29, 2023
f41a855
UBUNTU: [Packaging] update helper scripts
nvidia-bfigg Jun 29, 2023
9e1a7f4
UBUNTU: Start new release
nvidia-bfigg Jun 29, 2023
a519320
UBUNTU: link-to-tracker: update tracking bug
nvidia-bfigg Jun 29, 2023
72b10a4
UBUNTU: CONFIG: CONFIG_ARM64_MODULE_PLTS added, CC VERSION changed
nvidia-bfigg Jun 30, 2023
dcbd00f
UBUNTU: Ubuntu-nvidia-6.2-6.2.0-1004.4~22.04.1
nvidia-bfigg Jun 30, 2023
48bf6c4
mm, slab/slub: Ensure kmem_cache_alloc_bulk() is available early
KAGA-KOKO Feb 7, 2023
b5f5773
UBUNTU: [Packaging] nvidia-6.2: remove tools-common package
ianmay81 Jul 26, 2023
6960806
UBUNTU: [Packaging] update variants
ianmay81 Jul 26, 2023
75becc0
UBUNTU: Start new release
ianmay81 Jul 26, 2023
5af636d
UBUNTU: link-to-tracker: update tracking bug
ianmay81 Jul 26, 2023
dfe86f3
UBUNTU: Ubuntu-nvidia-6.2-6.2.0-1006.6~22.04.2
ianmay81 Jul 26, 2023
d375892
NVIDIA: SAUCE: Add NVMe Patches to enable GDS
sourabgupta3 Jul 27, 2023
5ca5cf5
UBUNTU: [Packaging] update variants
ianmay81 Aug 5, 2023
8b733d7
UBUNTU: [Packaging] update update.conf
ianmay81 Aug 5, 2023
e7f901a
UBUNTU: Start new release
ianmay81 Aug 5, 2023
7d13b60
UBUNTU: [Config] nvidia-6.2: update annotations
ianmay81 Aug 5, 2023
c8d7ddd
NVIDIA: [Config] Overriding CONFIG_PREEMPT_NONE, CONFIG_CPU_FREQ_DEFA…
ianmay81 Aug 5, 2023
128b88f
NVIDIA: SAUCE: NFS: Patch NFS driver to support GDS with 6.2 Kernel
sourabgupta3 Jul 19, 2023
24e070e
UBUNTU: link-to-tracker: update tracking bug
ianmay81 Aug 5, 2023
4b5c12b
UBUNTU: debian/dkms-versions -- update from kernel-versions (main/d20…
ianmay81 Aug 5, 2023
4811ae1
UBUNTU: debian/dkms-versions -- add nvidia-fs and mstflint
ianmay81 Aug 5, 2023
d1cb72a
UBUNTU: [Packaging] add nvidia build depends for nvidia-fs-dkms
ianmay81 Aug 5, 2023
b3421e4
UBUNTU: Ubuntu-nvidia-6.2-6.2.0-1007.7
ianmay81 Aug 6, 2023
c4697c9
UBUNTU: Start new release
ianmay81 Aug 7, 2023
4b3264a
UBUNTU: [Packaging] nvidia-6.2: remove nvidia-fs module
ianmay81 Aug 7, 2023
6c10570
UBUNTU: link-to-tracker: update tracking bug
ianmay81 Aug 7, 2023
9fa59dd
UBUNTU: Ubuntu-nvidia-6.2-6.2.0-1008.8
ianmay81 Aug 7, 2023
b40f800
Revert "NVIDIA: SAUCE: Add NVMe Patches to enable GDS"
nvidia-bfigg Aug 10, 2023
15fd29f
NVMe/MVMEeOF: Patch NVMe/NVMeOF driver to support GDS on Linux 6.2 Ke…
sourabgupta3 Jul 19, 2023
0b619f0
NVIDIA: SAUCE: iommu/arm-smmu-v3: Allow default substream bypass with…
nicolinc Jun 22, 2023
34a7470
UBUNTU: Start new release
ianmay81 Aug 14, 2023
5936b1a
UBUNTU: link-to-tracker: update tracking bug
ianmay81 Aug 14, 2023
1e0b2fa
NVIDIA: [Config] CONFIG_NR_CPUS=512 for Grace
nvidia-bfigg Aug 9, 2023
8263303
NVIDIA: [Config] CONFIG_MTD_SPI_NOR=y for Grace
nvidia-bfigg Aug 9, 2023
668948e
UBUNTU: Ubuntu-nvidia-6.2-6.2.0-1009.9
ianmay81 Aug 14, 2023
348c9fd
NVMeoF driver patch: Minor fix to free up sg table on error path
sourabgupta3 Aug 16, 2023
e652e13
UBUNTU: [Packaging] resync update-dkms-versions helper
nvidia-bfigg Aug 25, 2023
8e76c3e
UBUNTU: [Packaging] resync getabis
nvidia-bfigg Aug 25, 2023
cd2e408
NVIDIA: [dkms] updating mstflint to the 4.25 version
nvidia-bfigg Aug 25, 2023
bc6e0b1
UBUNTU: Start new release
nvidia-bfigg Aug 25, 2023
22b0c48
UBUNTU: link-to-tracker: update tracking bug
nvidia-bfigg Aug 28, 2023
102e7c4
UBUNTU: Ubuntu-nvidia-6.2-6.2.0-1010.10
nvidia-bfigg Aug 28, 2023
360787b
perf: arm_cspmu: Fix variable dereference warning
bwicaksononv Mar 2, 2023
ef5de79
ACPI/APMT: Don't register invalid resource
rmurphy-arm Jun 5, 2023
6bc8b2a
perf/arm_cspmu: Clean up ACPI dependency
rmurphy-arm Jun 5, 2023
76b1055
perf/arm_cspmu: Decouple APMT dependency
rmurphy-arm Jun 5, 2023
ae04300
perf: arm_cspmu: Add missing MODULE_DEVICE_TABLE
ilkka-koskinen Jun 15, 2023
a7ebb39
NVIDIA: [Config]: Ensure the TPM is available before IMA initializes
jamieNguyenNVIDIA Sep 28, 2023
32eb51f
NVIDIA: [Packaging] debian/dkms-versions: add in nvidia-fs to dkms-ve…
nvidia-bfigg Sep 29, 2023
ee5b72f
UBUNTU: [Packaging] nvidia-6.2: update getabis for nvidia ppas
ianmay81 Oct 10, 2023
ddc4ec8
UBUNTU: [Packaging] resync update-dkms-versions helper
ianmay81 Oct 10, 2023
3af01c7
UBUNTU: [Packaging] resync getabis
ianmay81 Oct 10, 2023
f1fc033
UBUNTU: Start new release
ianmay81 Oct 10, 2023
7b5c426
UBUNTU: link-to-tracker: update tracking bug
ianmay81 Oct 10, 2023
52566ec
UBUNTU: [Config] nvidia-6.2: update annotations
ianmay81 Oct 10, 2023
6012fc1
UBUNTU: [Packaging] nvidia-6.2: dkms-versions standalone provides sup…
ianmay81 Oct 10, 2023
5eee014
UBUNTU: Ubuntu-nvidia-6.2-6.2.0-1011.11
ianmay81 Oct 10, 2023
5a312be
ACPI: processor: Reorder acpi_processor_driver_init()
rafaeljw Mar 17, 2023
604d864
thermal: core: Introduce thermal_cooling_device_present()
rafaeljw Mar 17, 2023
d8e92ac
thermal: core: Introduce thermal_cooling_device_update()
rafaeljw Mar 17, 2023
a816806
ACPI: processor: thermal: Update CPU cooling devices on cpufreq polic…
rafaeljw Mar 17, 2023
33ce203
thermal: core: Drop excessive lockdep_assert_held() calls
rafaeljw Mar 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Documentation/arm64/memory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ AArch64 Linux memory layout with 4KB pages + 4 levels (48-bit)::
0000000000000000 0000ffffffffffff 256TB user
ffff000000000000 ffff7fffffffffff 128TB kernel logical memory map
[ffff600000000000 ffff7fffffffffff] 32TB [kasan shadow region]
ffff800000000000 ffff800007ffffff 128MB modules
ffff800008000000 fffffbffefffffff 124TB vmalloc
ffff800000000000 ffff80007fffffff 2GB modules
ffff800080000000 fffffbffefffffff 124TB vmalloc
fffffbfff0000000 fffffbfffdffffff 224MB fixed mappings (top down)
fffffbfffe000000 fffffbfffe7fffff 8MB [guard region]
fffffbfffe800000 fffffbffff7fffff 16MB PCI I/O space
Expand All @@ -50,8 +50,8 @@ AArch64 Linux memory layout with 64KB pages + 3 levels (52-bit with HW support):
0000000000000000 000fffffffffffff 4PB user
fff0000000000000 ffff7fffffffffff ~4PB kernel logical memory map
[fffd800000000000 ffff7fffffffffff] 512TB [kasan shadow region]
ffff800000000000 ffff800007ffffff 128MB modules
ffff800008000000 fffffbffefffffff 124TB vmalloc
ffff800000000000 ffff80007fffffff 2GB modules
ffff800080000000 fffffbffefffffff 124TB vmalloc
fffffbfff0000000 fffffbfffdffffff 224MB fixed mappings (top down)
fffffbfffe000000 fffffbfffe7fffff 8MB [guard region]
fffffbfffe800000 fffffbffff7fffff 16MB PCI I/O space
Expand Down
10 changes: 5 additions & 5 deletions Ubuntu.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Name: linux
Version: 6.1.0
Series: 23.04 (lunar)
Name: linux-nvidia-6.2
Version: 6.2.0
Series: 22.04 (jammy)
Description:
This is the source code for the Ubuntu linux kernel for the 23.04 series. This
source tree is used to produce the flavours: generic, generic-64k, generic-lpae.
This is the source code for the Ubuntu linux kernel for the 22.04 series. This
source tree is used to produce the flavours: nvidia, nvidia-64k.
This kernel is configured to support the widest range of desktop, laptop and
server configurations.
28 changes: 3 additions & 25 deletions arch/arm64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ config ARM64
select HAVE_IOREMAP_PROT
select HAVE_IRQ_TIME_ACCOUNTING
select HAVE_KVM
select HAVE_MOD_ARCH_SPECIFIC
select HAVE_NMI
select HAVE_PERF_EVENTS
select HAVE_PERF_REGS
Expand Down Expand Up @@ -572,7 +573,6 @@ config ARM64_ERRATUM_845719
config ARM64_ERRATUM_843419
bool "Cortex-A53: 843419: A load or store might access an incorrect address"
default y
select ARM64_MODULE_PLTS if MODULES
help
This option links the kernel with '--fix-cortex-a53-843419' and
enables PLT support to replace certain ADRP instructions, which can
Expand Down Expand Up @@ -2085,26 +2085,6 @@ config ARM64_SME
register state capable of holding two dimensional matrix tiles to
enable various matrix operations.

config ARM64_MODULE_PLTS
bool "Use PLTs to allow module memory to spill over into vmalloc area"
depends on MODULES
select HAVE_MOD_ARCH_SPECIFIC
help
Allocate PLTs when loading modules so that jumps and calls whose
targets are too far away for their relative offsets to be encoded
in the instructions themselves can be bounced via veneers in the
module's PLT. This allows modules to be allocated in the generic
vmalloc area after the dedicated module memory area has been
exhausted.

When running with address space randomization (KASLR), the module
region itself may be too far away for ordinary relative jumps and
calls, and so in that case, module PLTs are required and cannot be
disabled.

Specific errata workaround(s) might also force module PLTs to be
enabled (ARM64_ERRATUM_843419).

config ARM64_PSEUDO_NMI
bool "Support for NMI-like interrupts"
select ARM_GIC_V3
Expand Down Expand Up @@ -2145,7 +2125,6 @@ config RELOCATABLE

config RANDOMIZE_BASE
bool "Randomize the address of the kernel image"
select ARM64_MODULE_PLTS if MODULES
select RELOCATABLE
help
Randomizes the virtual address at which the kernel image is
Expand Down Expand Up @@ -2176,9 +2155,8 @@ config RANDOMIZE_MODULE_REGION_FULL
When this option is not set, the module region will be randomized over
a limited range that contains the [_stext, _etext] interval of the
core kernel, so branch relocations are almost always in range unless
ARM64_MODULE_PLTS is enabled and the region is exhausted. In this
particular case of region exhaustion, modules might be able to fall
back to a larger 2GB area.
the region is exhausted. In this particular case of region
exhaustion, modules might be able to fall back to a larger 2GB area.

config CC_HAVE_STACKPROTECTOR_SYSREG
def_bool $(cc-option,-mstack-protector-guard=sysreg -mstack-protector-guard-reg=sp_el0 -mstack-protector-guard-offset=0)
Expand Down
15 changes: 14 additions & 1 deletion arch/arm64/include/asm/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#define KIMAGE_VADDR (MODULES_END)
#define MODULES_END (MODULES_VADDR + MODULES_VSIZE)
#define MODULES_VADDR (_PAGE_END(VA_BITS_MIN))
#define MODULES_VSIZE (SZ_128M)
#define MODULES_VSIZE (SZ_2G)
#define VMEMMAP_START (-(UL(1) << (VA_BITS - VMEMMAP_SHIFT)))
#define VMEMMAP_END (VMEMMAP_START + VMEMMAP_SIZE)
#define PCI_IO_END (VMEMMAP_START - SZ_8M)
Expand Down Expand Up @@ -180,6 +180,7 @@
#include <linux/compiler.h>
#include <linux/mmdebug.h>
#include <linux/types.h>
#include <asm/boot.h>
#include <asm/bug.h>

#if VA_BITS > 48
Expand All @@ -203,6 +204,18 @@ static inline unsigned long kaslr_offset(void)
return kimage_vaddr - KIMAGE_VADDR;
}

#ifdef CONFIG_RANDOMIZE_BASE
void kaslr_init(void);
static inline bool kaslr_enabled(void)
{
extern bool __kaslr_is_enabled;
return __kaslr_is_enabled;
}
#else
static inline void kaslr_init(void) { }
static inline bool kaslr_enabled(void) { return false; }
#endif

/*
* Allow all memory at the discovery stage. We will clip it later.
*/
Expand Down
8 changes: 0 additions & 8 deletions arch/arm64/include/asm/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#include <asm-generic/module.h>

#ifdef CONFIG_ARM64_MODULE_PLTS
struct mod_plt_sec {
int plt_shndx;
int plt_num_entries;
Expand All @@ -21,7 +20,6 @@ struct mod_arch_specific {
/* for CONFIG_DYNAMIC_FTRACE */
struct plt_entry *ftrace_trampolines;
};
#endif

u64 module_emit_plt_entry(struct module *mod, Elf64_Shdr *sechdrs,
void *loc, const Elf64_Rela *rela,
Expand All @@ -30,12 +28,6 @@ u64 module_emit_plt_entry(struct module *mod, Elf64_Shdr *sechdrs,
u64 module_emit_veneer_for_adrp(struct module *mod, Elf64_Shdr *sechdrs,
void *loc, u64 val);

#ifdef CONFIG_RANDOMIZE_BASE
extern u64 module_alloc_base;
#else
#define module_alloc_base ((u64)_etext - MODULES_VSIZE)
#endif

struct plt_entry {
/*
* A program that conforms to the AArch64 Procedure Call Standard
Expand Down
2 changes: 0 additions & 2 deletions arch/arm64/include/asm/module.lds.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
SECTIONS {
#ifdef CONFIG_ARM64_MODULE_PLTS
.plt 0 : { BYTE(0) }
.init.plt 0 : { BYTE(0) }
.text.ftrace_trampoline 0 : { BYTE(0) }
#endif

#ifdef CONFIG_KASAN_SW_TAGS
/*
Expand Down
3 changes: 1 addition & 2 deletions arch/arm64/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ obj-$(CONFIG_COMPAT) += sigreturn32.o
obj-$(CONFIG_COMPAT_ALIGNMENT_FIXUPS) += compat_alignment.o
obj-$(CONFIG_KUSER_HELPERS) += kuser32.o
obj-$(CONFIG_FUNCTION_TRACER) += ftrace.o entry-ftrace.o
obj-$(CONFIG_MODULES) += module.o
obj-$(CONFIG_ARM64_MODULE_PLTS) += module-plts.o
obj-$(CONFIG_MODULES) += module.o module-plts.o
obj-$(CONFIG_PERF_EVENTS) += perf_regs.o perf_callchain.o
obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o
obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/kernel/cpufeature.c
Original file line number Diff line number Diff line change
Expand Up @@ -1622,7 +1622,7 @@ bool kaslr_requires_kpti(void)
return false;
}

return kaslr_offset() > 0;
return kaslr_enabled();
}

static bool __meltdown_safe = true;
Expand Down
8 changes: 3 additions & 5 deletions arch/arm64/kernel/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ int ftrace_update_ftrace_func(ftrace_func_t func)

static struct plt_entry *get_ftrace_plt(struct module *mod, unsigned long addr)
{
#ifdef CONFIG_ARM64_MODULE_PLTS
#ifdef CONFIG_MODULES
struct plt_entry *plt = mod->arch.ftrace_trampolines;

if (addr == FTRACE_ADDR)
Expand Down Expand Up @@ -145,7 +145,7 @@ static bool ftrace_find_callable_addr(struct dyn_ftrace *rec,
* must use a PLT to reach it. We can only place PLTs for modules, and
* only when module PLT support is built-in.
*/
if (!IS_ENABLED(CONFIG_ARM64_MODULE_PLTS))
if (!IS_ENABLED(CONFIG_MODULES))
return false;

/*
Expand Down Expand Up @@ -249,10 +249,8 @@ int ftrace_make_nop(struct module *mod, struct dyn_ftrace *rec,
*
* Note: 'mod' is only set at module load time.
*/
if (!IS_ENABLED(CONFIG_DYNAMIC_FTRACE_WITH_ARGS) &&
IS_ENABLED(CONFIG_ARM64_MODULE_PLTS) && mod) {
if (!IS_ENABLED(CONFIG_DYNAMIC_FTRACE_WITH_ARGS) && mod)
return aarch64_insn_patch_text_nosync((void *)pc, new);
}

if (!ftrace_find_callable_addr(rec, mod, &addr))
return -EINVAL;
Expand Down
83 changes: 14 additions & 69 deletions arch/arm64/kernel/kaslr.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,90 +4,35 @@
*/

#include <linux/cache.h>
#include <linux/crc32.h>
#include <linux/init.h>
#include <linux/libfdt.h>
#include <linux/mm_types.h>
#include <linux/sched.h>
#include <linux/types.h>
#include <linux/pgtable.h>
#include <linux/random.h>
#include <linux/printk.h>

#include <asm/fixmap.h>
#include <asm/kernel-pgtable.h>
#include <asm/cpufeature.h>
#include <asm/memory.h>
#include <asm/mmu.h>
#include <asm/sections.h>
#include <asm/setup.h>

u64 __ro_after_init module_alloc_base;
u16 __initdata memstart_offset_seed;

struct arm64_ftr_override kaslr_feature_override __initdata;

static int __init kaslr_init(void)
{
u64 module_range;
u32 seed;

/*
* Set a reasonable default for module_alloc_base in case
* we end up running with module randomization disabled.
*/
module_alloc_base = (u64)_etext - MODULES_VSIZE;
bool __ro_after_init __kaslr_is_enabled = false;

void __init kaslr_init(void)
{
if (kaslr_feature_override.val & kaslr_feature_override.mask & 0xf) {
pr_info("KASLR disabled on command line\n");
return 0;
}

if (!kaslr_offset()) {
pr_warn("KASLR disabled due to lack of seed\n");
return 0;
return;
}

pr_info("KASLR enabled\n");

/*
* KASAN without KASAN_VMALLOC does not expect the module region to
* intersect the vmalloc region, since shadow memory is allocated for
* each module at load time, whereas the vmalloc region will already be
* shadowed by KASAN zero pages.
* The KASLR offset modulo MIN_KIMG_ALIGN is taken from the physical
* placement of the image rather than from the seed, so a displacement
* of less than MIN_KIMG_ALIGN means that no seed was provided.
*/
BUILD_BUG_ON((IS_ENABLED(CONFIG_KASAN_GENERIC) ||
IS_ENABLED(CONFIG_KASAN_SW_TAGS)) &&
!IS_ENABLED(CONFIG_KASAN_VMALLOC));

seed = get_random_u32();

if (IS_ENABLED(CONFIG_RANDOMIZE_MODULE_REGION_FULL)) {
/*
* Randomize the module region over a 2 GB window covering the
* kernel. This reduces the risk of modules leaking information
* about the address of the kernel itself, but results in
* branches between modules and the core kernel that are
* resolved via PLTs. (Branches between modules will be
* resolved normally.)
*/
module_range = SZ_2G - (u64)(_end - _stext);
module_alloc_base = max((u64)_end - SZ_2G, (u64)MODULES_VADDR);
} else {
/*
* Randomize the module region by setting module_alloc_base to
* a PAGE_SIZE multiple in the range [_etext - MODULES_VSIZE,
* _stext) . This guarantees that the resulting region still
* covers [_stext, _etext], and that all relative branches can
* be resolved without veneers unless this region is exhausted
* and we fall back to a larger 2GB window in module_alloc()
* when ARM64_MODULE_PLTS is enabled.
*/
module_range = MODULES_VSIZE - (u64)(_etext - _stext);
if (kaslr_offset() < MIN_KIMG_ALIGN) {
pr_warn("KASLR disabled due to lack of seed\n");
return;
}

/* use the lower 21 bits to randomize the base of the module region */
module_alloc_base += (module_range * (seed & ((1 << 21) - 1))) >> 21;
module_alloc_base &= PAGE_MASK;

return 0;
pr_info("KASLR enabled\n");
__kaslr_is_enabled = true;
}
subsys_initcall(kaslr_init)
Loading