Skip to content

Commit 3f11c40

Browse files
committed
Merge remote-tracking branch 'stable/linux-6.6.y' into rpi-6.6.y
2 parents d88807c + 9b5aad3 commit 3f11c40

File tree

154 files changed

+1653
-771
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+1653
-771
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
VERSION = 6
33
PATCHLEVEL = 6
4-
SUBLEVEL = 59
4+
SUBLEVEL = 60
55
EXTRAVERSION =
66
NAME = Pinguïn Aangedreven
77

arch/arm64/boot/dts/freescale/imx8ulp.dtsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@
352352
};
353353

354354
flexspi2: spi@29810000 {
355-
compatible = "nxp,imx8mm-fspi";
355+
compatible = "nxp,imx8ulp-fspi";
356356
reg = <0x29810000 0x10000>, <0x60000000 0x10000000>;
357357
reg-names = "fspi_base", "fspi_mmap";
358358
#address-cells = <1>;

arch/riscv/kernel/acpi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,15 +204,15 @@ void __init __iomem *__acpi_map_table(unsigned long phys, unsigned long size)
204204
if (!size)
205205
return NULL;
206206

207-
return early_ioremap(phys, size);
207+
return early_memremap(phys, size);
208208
}
209209

210210
void __init __acpi_unmap_table(void __iomem *map, unsigned long size)
211211
{
212212
if (!map || !size)
213213
return;
214214

215-
early_iounmap(map, size);
215+
early_memunmap(map, size);
216216
}
217217

218218
void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)

arch/riscv/kernel/asm-offsets.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* Copyright (C) 2017 SiFive
55
*/
66

7-
#define GENERATING_ASM_OFFSETS
8-
97
#include <linux/kbuild.h>
108
#include <linux/mm.h>
119
#include <linux/sched.h>

arch/riscv/kernel/cpu-hotplug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void arch_cpuhp_cleanup_dead_cpu(unsigned int cpu)
6565
if (cpu_ops[cpu]->cpu_is_stopped)
6666
ret = cpu_ops[cpu]->cpu_is_stopped(cpu);
6767
if (ret)
68-
pr_warn("CPU%d may not have stopped: %d\n", cpu, ret);
68+
pr_warn("CPU%u may not have stopped: %d\n", cpu, ret);
6969
}
7070

7171
/*

arch/riscv/kernel/efi-header.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ extra_header_fields:
6464
.long efi_header_end - _start // SizeOfHeaders
6565
.long 0 // CheckSum
6666
.short IMAGE_SUBSYSTEM_EFI_APPLICATION // Subsystem
67-
.short 0 // DllCharacteristics
67+
.short IMAGE_DLL_CHARACTERISTICS_NX_COMPAT // DllCharacteristics
6868
.quad 0 // SizeOfStackReserve
6969
.quad 0 // SizeOfStackCommit
7070
.quad 0 // SizeOfHeapReserve

arch/riscv/kernel/traps_misaligned.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@
132132
#define REG_PTR(insn, pos, regs) \
133133
(ulong *)((ulong)(regs) + REG_OFFSET(insn, pos))
134134

135-
#define GET_RM(insn) (((insn) >> 12) & 7)
136-
137135
#define GET_RS1(insn, regs) (*REG_PTR(insn, SH_RS1, regs))
138136
#define GET_RS2(insn, regs) (*REG_PTR(insn, SH_RS2, regs))
139137
#define GET_RS1S(insn, regs) (*REG_PTR(RVC_RS1S(insn), 0, regs))

arch/riscv/kernel/vdso/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ obj-vdso = $(patsubst %, %.o, $(vdso-syms)) note.o
1818

1919
ccflags-y := -fno-stack-protector
2020
ccflags-y += -DDISABLE_BRANCH_PROFILING
21+
ccflags-y += -fno-builtin
2122

2223
ifneq ($(c-gettimeofday-y),)
2324
CFLAGS_vgettimeofday.o += -fPIC -include $(c-gettimeofday-y)

arch/x86/include/asm/bug.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@
1313
#define INSN_UD2 0x0b0f
1414
#define LEN_UD2 2
1515

16+
/*
17+
* In clang we have UD1s reporting UBSAN failures on X86, 64 and 32bit.
18+
*/
19+
#define INSN_ASOP 0x67
20+
#define OPCODE_ESCAPE 0x0f
21+
#define SECOND_BYTE_OPCODE_UD1 0xb9
22+
#define SECOND_BYTE_OPCODE_UD2 0x0b
23+
24+
#define BUG_NONE 0xffff
25+
#define BUG_UD1 0xfffe
26+
#define BUG_UD2 0xfffd
27+
1628
#ifdef CONFIG_GENERIC_BUG
1729

1830
#ifdef CONFIG_X86_32

arch/x86/kernel/traps.c

Lines changed: 60 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include <linux/hardirq.h>
4242
#include <linux/atomic.h>
4343
#include <linux/iommu.h>
44+
#include <linux/ubsan.h>
4445

4546
#include <asm/stacktrace.h>
4647
#include <asm/processor.h>
@@ -89,6 +90,47 @@ __always_inline int is_valid_bugaddr(unsigned long addr)
8990
return *(unsigned short *)addr == INSN_UD2;
9091
}
9192

93+
/*
94+
* Check for UD1 or UD2, accounting for Address Size Override Prefixes.
95+
* If it's a UD1, get the ModRM byte to pass along to UBSan.
96+
*/
97+
__always_inline int decode_bug(unsigned long addr, u32 *imm)
98+
{
99+
u8 v;
100+
101+
if (addr < TASK_SIZE_MAX)
102+
return BUG_NONE;
103+
104+
v = *(u8 *)(addr++);
105+
if (v == INSN_ASOP)
106+
v = *(u8 *)(addr++);
107+
if (v != OPCODE_ESCAPE)
108+
return BUG_NONE;
109+
110+
v = *(u8 *)(addr++);
111+
if (v == SECOND_BYTE_OPCODE_UD2)
112+
return BUG_UD2;
113+
114+
if (!IS_ENABLED(CONFIG_UBSAN_TRAP) || v != SECOND_BYTE_OPCODE_UD1)
115+
return BUG_NONE;
116+
117+
/* Retrieve the immediate (type value) for the UBSAN UD1 */
118+
v = *(u8 *)(addr++);
119+
if (X86_MODRM_RM(v) == 4)
120+
addr++;
121+
122+
*imm = 0;
123+
if (X86_MODRM_MOD(v) == 1)
124+
*imm = *(u8 *)addr;
125+
else if (X86_MODRM_MOD(v) == 2)
126+
*imm = *(u32 *)addr;
127+
else
128+
WARN_ONCE(1, "Unexpected MODRM_MOD: %u\n", X86_MODRM_MOD(v));
129+
130+
return BUG_UD1;
131+
}
132+
133+
92134
static nokprobe_inline int
93135
do_trap_no_signal(struct task_struct *tsk, int trapnr, const char *str,
94136
struct pt_regs *regs, long error_code)
@@ -214,30 +256,37 @@ static inline void handle_invalid_op(struct pt_regs *regs)
214256
static noinstr bool handle_bug(struct pt_regs *regs)
215257
{
216258
bool handled = false;
259+
int ud_type;
260+
u32 imm;
217261

218-
/*
219-
* Normally @regs are unpoisoned by irqentry_enter(), but handle_bug()
220-
* is a rare case that uses @regs without passing them to
221-
* irqentry_enter().
222-
*/
223-
kmsan_unpoison_entry_regs(regs);
224-
if (!is_valid_bugaddr(regs->ip))
262+
ud_type = decode_bug(regs->ip, &imm);
263+
if (ud_type == BUG_NONE)
225264
return handled;
226265

227266
/*
228267
* All lies, just get the WARN/BUG out.
229268
*/
230269
instrumentation_begin();
270+
/*
271+
* Normally @regs are unpoisoned by irqentry_enter(), but handle_bug()
272+
* is a rare case that uses @regs without passing them to
273+
* irqentry_enter().
274+
*/
275+
kmsan_unpoison_entry_regs(regs);
231276
/*
232277
* Since we're emulating a CALL with exceptions, restore the interrupt
233278
* state to what it was at the exception site.
234279
*/
235280
if (regs->flags & X86_EFLAGS_IF)
236281
raw_local_irq_enable();
237-
if (report_bug(regs->ip, regs) == BUG_TRAP_TYPE_WARN ||
238-
handle_cfi_failure(regs) == BUG_TRAP_TYPE_WARN) {
239-
regs->ip += LEN_UD2;
240-
handled = true;
282+
if (ud_type == BUG_UD2) {
283+
if (report_bug(regs->ip, regs) == BUG_TRAP_TYPE_WARN ||
284+
handle_cfi_failure(regs) == BUG_TRAP_TYPE_WARN) {
285+
regs->ip += LEN_UD2;
286+
handled = true;
287+
}
288+
} else if (IS_ENABLED(CONFIG_UBSAN_TRAP)) {
289+
pr_crit("%s at %pS\n", report_ubsan_failure(regs, imm), (void *)regs->ip);
241290
}
242291
if (regs->flags & X86_EFLAGS_IF)
243292
raw_local_irq_disable();

0 commit comments

Comments
 (0)