Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
212719e
UBUNTU: [Packaging] Initialize linux-nvidia
ianmay81 Mar 24, 2023
d9d5ada
UBUNTU: [Packaging] update variants
ianmay81 Apr 25, 2023
b331f75
UBUNTU: [Packaging] update Ubuntu.md
ianmay81 Apr 25, 2023
ad3e5f1
UBUNTU: Start new release
ianmay81 Apr 25, 2023
fc0f843
UBUNTU: [config] linux-nvidia: update annotations for derivative
ianmay81 Apr 25, 2023
489d50a
UBUNTU: [config] linux-nvidia: update dkms modules for derivative
ianmay81 Apr 25, 2023
ed1ffed
UBUNTU: Ubuntu-nvidia-6.2.0-1001.1
ianmay81 Apr 25, 2023
6bb0e90
UBUNTU: Start new release
ianmay81 Apr 25, 2023
3649c15
UBUNTU: [Config] nvidia: disable rust
ianmay81 May 3, 2023
946d540
UBUNTU: Ubuntu-nvidia-6.2.0-1002.2
ianmay81 May 3, 2023
2bdc331
UBUNTU: [Packaging] fix Vcs-Git url
ianmay81 May 4, 2023
d7f2304
UBUNTU: Start new release
ianmay81 May 30, 2023
0030967
UBUNTU: [Config] nvidia: update configs
ianmay81 May 30, 2023
1f21bc4
UBUNTU: Ubuntu-nvidia-6.2.0-1003.3
ianmay81 May 30, 2023
f2c7f1e
UBUNTU: [Packaging] resync update-dkms-versions helper
ianmay81 Jun 29, 2023
dfa134e
UBUNTU: Start new release
ianmay81 Jun 29, 2023
4389b13
UBUNTU: Ubuntu-nvidia-6.2.0-1004.4
ianmay81 Jun 29, 2023
5fb9c7a
UBUNTU: [Packaging] Initialize linux-nvidia-6.2
ianmay81 Apr 6, 2023
4dabbdc
UBUNTU: [Packaging] update variants
ianmay81 May 3, 2023
e791285
UBUNTU: [Packaging] update Ubuntu.md
ianmay81 May 3, 2023
8e3dda4
UBUNTU: [Packaging] update update.conf
ianmay81 May 3, 2023
e1c40ba
UBUNTU: Start new release
ianmay81 May 3, 2023
683a459
UBUNTU: Ubuntu-nvidia-6.2-6.2.0-1002.2~22.04.1
ianmay81 May 3, 2023
19641c7
UBUNTU: [Packaging] fix Vcs-Git url
ianmay81 May 4, 2023
b2c0980
UBUNTU: [Packaging] update helper script
ianmay81 May 31, 2023
8e9b31e
UBUNTU: Start new release
ianmay81 May 31, 2023
ff4de40
UBUNTU: link-to-tracker: update tracking bug
ianmay81 May 31, 2023
e4fc6ae
UBUNTU: Ubuntu-nvidia-6.2-6.2.0-1003.3~22.04.1
ianmay81 May 31, 2023
8ab3253
drm/ast: Fix ARM compatibility
jammyaspeed Apr 21, 2023
268ad03
i2c: tegra: Fix PEC support for SMBUS block read
Apr 27, 2023
1b21abb
irqchip/gicv3: Workaround for NVIDIA erratum T241-FABRIC-4
shankerd04 Mar 19, 2023
4f183f2
spi: Add TPM HW flow flag
kkyarlagadda Apr 21, 2023
c5c70b8
spi: tegra210-quad: Enable TPM wait polling
kkyarlagadda Apr 21, 2023
6ca7f01
spi: tegra210-quad: set half duplex flag
kkyarlagadda Feb 23, 2023
7cda0e5
genirq: Use hlist for managing resend handlers
shankerd04 May 19, 2023
34f0b67
genirq: Encapsulate sparse bitmap handling
shankerd04 May 19, 2023
cbaeb4f
genirq: Use a maple tree for interrupt descriptor management
shankerd04 May 19, 2023
1fe5f04
tpm_tis-spi: Add hardware wait polling
kkyarlagadda Apr 21, 2023
68c42e5
arm64: kaslr: don't pretend KASLR is enabled if offset < MIN_KIMG_ALIGN
ardbiesheuvel Feb 23, 2023
9f5dacd
arm64: module: remove old !KASAN_VMALLOC logic
mrutland-arm May 30, 2023
a576170
arm64: kasan: remove !KASAN_VMALLOC remnants
mrutland-arm May 30, 2023
d4be6da
arm64: kaslr: split kaslr/module initialization
mrutland-arm May 30, 2023
1f615c7
arm64: module: move module randomization to module.c
mrutland-arm May 30, 2023
9527aa7
arm64: module: mandate MODULE_PLTS
mrutland-arm May 30, 2023
c654379
arm64: module: rework module VA range selection
mrutland-arm May 30, 2023
d73ddec
UBUNTU: [Packaging] resync getabis
nvidia-bfigg Jun 28, 2023
f76c71a
UBUNTU: [Packaging] update helper scripts
nvidia-bfigg Jun 28, 2023
739ecfc
UBUNTU: [Packaging] resync getabis
nvidia-bfigg Jun 29, 2023
9e73c82
UBUNTU: [Packaging] update helper scripts
nvidia-bfigg Jun 29, 2023
a819ec2
UBUNTU: Start new release
nvidia-bfigg Jun 29, 2023
651917b
UBUNTU: link-to-tracker: update tracking bug
nvidia-bfigg Jun 29, 2023
e4df2d5
UBUNTU: CONFIG: CONFIG_ARM64_MODULE_PLTS added, CC VERSION changed
nvidia-bfigg Jun 30, 2023
3d28f6c
UBUNTU: Ubuntu-nvidia-6.2-6.2.0-1004.4~22.04.1
nvidia-bfigg Jun 30, 2023
28d352f
mm, slab/slub: Ensure kmem_cache_alloc_bulk() is available early
KAGA-KOKO Feb 7, 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
2 changes: 2 additions & 0 deletions Documentation/arm64/silicon-errata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ stable kernels.
+----------------+-----------------+-----------------+-----------------------------+
| NVIDIA | Carmel Core | N/A | NVIDIA_CARMEL_CNP_ERRATUM |
+----------------+-----------------+-----------------+-----------------------------+
| NVIDIA | T241 GICv3/4.x | T241-FABRIC-4 | N/A |
+----------------+-----------------+-----------------+-----------------------------+
+----------------+-----------------+-----------------+-----------------------------+
| Freescale/NXP | LS2080A/LS1043A | A-008585 | FSL_ERRATUM_A008585 |
+----------------+-----------------+-----------------+-----------------------------+
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 @@ -552,7 +553,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 @@ -2065,26 +2065,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 @@ -2125,7 +2105,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 @@ -2156,9 +2135,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