Skip to content

Commit 5ad6e7b

Browse files
committed
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fixes from Catalin Marinas: - Another fix for rodata=full. Since rodata= is not a simple boolean on arm64 (accepting 'full' as well), it got inadvertently broken by changes in the core code. If rodata=on is the default and rodata=off is passed on the kernel command line, rodata_full is never disabled - Fix gcc compiler warning of shifting 0xc0 into bits 31:24 without an explicit conversion to u32 (triggered by the AMPERE1 MIDR definition) - Include asm/ptrace.h in asm/syscall_wrapper.h to fix an incomplete struct pt_regs type causing the BPF verifier to refuse to load a tracing program which accesses pt_regs * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64/syscall: Include asm/ptrace.h in syscall_wrapper header. arm64: Fix bit-shifting UB in the MIDR_CPU_MODEL() macro arm64: fix rodata=full again
2 parents b0b6e2c + acfc35c commit 5ad6e7b

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

arch/arm64/include/asm/cputype.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
(((midr) & MIDR_IMPLEMENTOR_MASK) >> MIDR_IMPLEMENTOR_SHIFT)
4242

4343
#define MIDR_CPU_MODEL(imp, partnum) \
44-
(((imp) << MIDR_IMPLEMENTOR_SHIFT) | \
44+
((_AT(u32, imp) << MIDR_IMPLEMENTOR_SHIFT) | \
4545
(0xf << MIDR_ARCHITECTURE_SHIFT) | \
4646
((partnum) << MIDR_PARTNUM_SHIFT))
4747

arch/arm64/include/asm/syscall_wrapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#ifndef __ASM_SYSCALL_WRAPPER_H
99
#define __ASM_SYSCALL_WRAPPER_H
1010

11-
struct pt_regs;
11+
#include <asm/ptrace.h>
1212

1313
#define SC_ARM64_REGS_TO_ARGS(x, ...) \
1414
__MAP(x,__SC_ARGS \

arch/arm64/mm/pageattr.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ bool can_set_direct_map(void)
2626
* mapped at page granularity, so that it is possible to
2727
* protect/unprotect single pages.
2828
*/
29-
return rodata_full || debug_pagealloc_enabled() ||
29+
return (rodata_enabled && rodata_full) || debug_pagealloc_enabled() ||
3030
IS_ENABLED(CONFIG_KFENCE);
3131
}
3232

@@ -102,7 +102,8 @@ static int change_memory_common(unsigned long addr, int numpages,
102102
* If we are manipulating read-only permissions, apply the same
103103
* change to the linear mapping of the pages that back this VM area.
104104
*/
105-
if (rodata_full && (pgprot_val(set_mask) == PTE_RDONLY ||
105+
if (rodata_enabled &&
106+
rodata_full && (pgprot_val(set_mask) == PTE_RDONLY ||
106107
pgprot_val(clear_mask) == PTE_RDONLY)) {
107108
for (i = 0; i < area->nr_pages; i++) {
108109
__change_memory_common((u64)page_address(area->pages[i]),

0 commit comments

Comments
 (0)