Skip to content

Commit 2a29770

Browse files
committed
Merge remote-tracking branch 'stable/linux-5.10.y' into rpi-5.10.y
2 parents bad3872 + 09df347 commit 2a29770

Some content is hidden

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

78 files changed

+771
-398
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 = 5
33
PATCHLEVEL = 10
4-
SUBLEVEL = 76
4+
SUBLEVEL = 77
55
EXTRAVERSION =
66
NAME = Dare mighty things
77

arch/arm/boot/compressed/decompress.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ extern char * strchrnul(const char *, int);
4747
#endif
4848

4949
#ifdef CONFIG_KERNEL_XZ
50+
/* Prevent KASAN override of string helpers in decompressor */
51+
#undef memmove
5052
#define memmove memmove
53+
#undef memcpy
5154
#define memcpy memcpy
5255
#include "../../../../lib/decompress_unxz.c"
5356
#endif

arch/arm/include/asm/uaccess.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ extern int __get_user_64t_4(void *);
200200
register unsigned long __l asm("r1") = __limit; \
201201
register int __e asm("r0"); \
202202
unsigned int __ua_flags = uaccess_save_and_enable(); \
203+
int __tmp_e; \
203204
switch (sizeof(*(__p))) { \
204205
case 1: \
205206
if (sizeof((x)) >= 8) \
@@ -227,9 +228,10 @@ extern int __get_user_64t_4(void *);
227228
break; \
228229
default: __e = __get_user_bad(); break; \
229230
} \
231+
__tmp_e = __e; \
230232
uaccess_restore(__ua_flags); \
231233
x = (typeof(*(p))) __r2; \
232-
__e; \
234+
__tmp_e; \
233235
})
234236

235237
#define get_user(x, p) \

arch/arm/kernel/vmlinux-xip.lds.S

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ SECTIONS
4040
ARM_DISCARD
4141
*(.alt.smp.init)
4242
*(.pv_table)
43+
#ifndef CONFIG_ARM_UNWIND
44+
*(.ARM.exidx) *(.ARM.exidx.*)
45+
*(.ARM.extab) *(.ARM.extab.*)
46+
#endif
4347
}
4448

4549
. = XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR);
@@ -172,7 +176,7 @@ ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined")
172176
ASSERT((_end - __bss_start) >= 12288, ".bss too small for CONFIG_XIP_DEFLATED_DATA")
173177
#endif
174178

175-
#ifdef CONFIG_ARM_MPU
179+
#if defined(CONFIG_ARM_MPU) && !defined(CONFIG_COMPILE_TEST)
176180
/*
177181
* Due to PMSAv7 restriction on base address and size we have to
178182
* enforce minimal alignment restrictions. It was seen that weaker

arch/arm/mm/proc-macros.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ ENTRY(\name\()_cache_fns)
342342

343343
.macro define_tlb_functions name:req, flags_up:req, flags_smp
344344
.type \name\()_tlb_fns, #object
345+
.align 2
345346
ENTRY(\name\()_tlb_fns)
346347
.long \name\()_flush_user_tlb_range
347348
.long \name\()_flush_kern_tlb_range

arch/arm/probes/kprobes/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ static struct undef_hook kprobes_arm_break_hook = {
462462

463463
#endif /* !CONFIG_THUMB2_KERNEL */
464464

465-
int __init arch_init_kprobes()
465+
int __init arch_init_kprobes(void)
466466
{
467467
arm_probes_decode_init();
468468
#ifdef CONFIG_THUMB2_KERNEL

arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo2.dts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
pinctrl-0 = <&emac_rgmii_pins>;
7676
phy-supply = <&reg_gmac_3v3>;
7777
phy-handle = <&ext_rgmii_phy>;
78-
phy-mode = "rgmii";
78+
phy-mode = "rgmii-id";
7979
status = "okay";
8080
};
8181

arch/arm64/lib/copy_from_user.S

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,32 +29,34 @@
2929
.endm
3030

3131
.macro ldrh1 reg, ptr, val
32-
uao_user_alternative 9998f, ldrh, ldtrh, \reg, \ptr, \val
32+
uao_user_alternative 9997f, ldrh, ldtrh, \reg, \ptr, \val
3333
.endm
3434

3535
.macro strh1 reg, ptr, val
3636
strh \reg, [\ptr], \val
3737
.endm
3838

3939
.macro ldr1 reg, ptr, val
40-
uao_user_alternative 9998f, ldr, ldtr, \reg, \ptr, \val
40+
uao_user_alternative 9997f, ldr, ldtr, \reg, \ptr, \val
4141
.endm
4242

4343
.macro str1 reg, ptr, val
4444
str \reg, [\ptr], \val
4545
.endm
4646

4747
.macro ldp1 reg1, reg2, ptr, val
48-
uao_ldp 9998f, \reg1, \reg2, \ptr, \val
48+
uao_ldp 9997f, \reg1, \reg2, \ptr, \val
4949
.endm
5050

5151
.macro stp1 reg1, reg2, ptr, val
5252
stp \reg1, \reg2, [\ptr], \val
5353
.endm
5454

5555
end .req x5
56+
srcin .req x15
5657
SYM_FUNC_START(__arch_copy_from_user)
5758
add end, x0, x2
59+
mov srcin, x1
5860
#include "copy_template.S"
5961
mov x0, #0 // Nothing to copy
6062
ret
@@ -63,6 +65,11 @@ EXPORT_SYMBOL(__arch_copy_from_user)
6365

6466
.section .fixup,"ax"
6567
.align 2
68+
9997: cmp dst, dstin
69+
b.ne 9998f
70+
// Before being absolutely sure we couldn't copy anything, try harder
71+
USER(9998f, ldtrb tmp1w, [srcin])
72+
strb tmp1w, [dst], #1
6673
9998: sub x0, end, dst // bytes not copied
6774
ret
6875
.previous

arch/arm64/lib/copy_in_user.S

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,33 +30,34 @@
3030
.endm
3131

3232
.macro ldrh1 reg, ptr, val
33-
uao_user_alternative 9998f, ldrh, ldtrh, \reg, \ptr, \val
33+
uao_user_alternative 9997f, ldrh, ldtrh, \reg, \ptr, \val
3434
.endm
3535

3636
.macro strh1 reg, ptr, val
37-
uao_user_alternative 9998f, strh, sttrh, \reg, \ptr, \val
37+
uao_user_alternative 9997f, strh, sttrh, \reg, \ptr, \val
3838
.endm
3939

4040
.macro ldr1 reg, ptr, val
41-
uao_user_alternative 9998f, ldr, ldtr, \reg, \ptr, \val
41+
uao_user_alternative 9997f, ldr, ldtr, \reg, \ptr, \val
4242
.endm
4343

4444
.macro str1 reg, ptr, val
45-
uao_user_alternative 9998f, str, sttr, \reg, \ptr, \val
45+
uao_user_alternative 9997f, str, sttr, \reg, \ptr, \val
4646
.endm
4747

4848
.macro ldp1 reg1, reg2, ptr, val
49-
uao_ldp 9998f, \reg1, \reg2, \ptr, \val
49+
uao_ldp 9997f, \reg1, \reg2, \ptr, \val
5050
.endm
5151

5252
.macro stp1 reg1, reg2, ptr, val
53-
uao_stp 9998f, \reg1, \reg2, \ptr, \val
53+
uao_stp 9997f, \reg1, \reg2, \ptr, \val
5454
.endm
5555

5656
end .req x5
57-
57+
srcin .req x15
5858
SYM_FUNC_START(__arch_copy_in_user)
5959
add end, x0, x2
60+
mov srcin, x1
6061
#include "copy_template.S"
6162
mov x0, #0
6263
ret
@@ -65,6 +66,12 @@ EXPORT_SYMBOL(__arch_copy_in_user)
6566

6667
.section .fixup,"ax"
6768
.align 2
69+
9997: cmp dst, dstin
70+
b.ne 9998f
71+
// Before being absolutely sure we couldn't copy anything, try harder
72+
USER(9998f, ldtrb tmp1w, [srcin])
73+
USER(9998f, sttrb tmp1w, [dst])
74+
add dst, dst, #1
6875
9998: sub x0, end, dst // bytes not copied
6976
ret
7077
.previous

arch/arm64/lib/copy_to_user.S

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,30 @@
3232
.endm
3333

3434
.macro strh1 reg, ptr, val
35-
uao_user_alternative 9998f, strh, sttrh, \reg, \ptr, \val
35+
uao_user_alternative 9997f, strh, sttrh, \reg, \ptr, \val
3636
.endm
3737

3838
.macro ldr1 reg, ptr, val
3939
ldr \reg, [\ptr], \val
4040
.endm
4141

4242
.macro str1 reg, ptr, val
43-
uao_user_alternative 9998f, str, sttr, \reg, \ptr, \val
43+
uao_user_alternative 9997f, str, sttr, \reg, \ptr, \val
4444
.endm
4545

4646
.macro ldp1 reg1, reg2, ptr, val
4747
ldp \reg1, \reg2, [\ptr], \val
4848
.endm
4949

5050
.macro stp1 reg1, reg2, ptr, val
51-
uao_stp 9998f, \reg1, \reg2, \ptr, \val
51+
uao_stp 9997f, \reg1, \reg2, \ptr, \val
5252
.endm
5353

5454
end .req x5
55+
srcin .req x15
5556
SYM_FUNC_START(__arch_copy_to_user)
5657
add end, x0, x2
58+
mov srcin, x1
5759
#include "copy_template.S"
5860
mov x0, #0
5961
ret
@@ -62,6 +64,12 @@ EXPORT_SYMBOL(__arch_copy_to_user)
6264

6365
.section .fixup,"ax"
6466
.align 2
67+
9997: cmp dst, dstin
68+
b.ne 9998f
69+
// Before being absolutely sure we couldn't copy anything, try harder
70+
ldrb tmp1w, [srcin]
71+
USER(9998f, sttrb tmp1w, [dst])
72+
add dst, dst, #1
6573
9998: sub x0, end, dst // bytes not copied
6674
ret
6775
.previous

arch/nios2/platform/Kconfig.platform

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ config NIOS2_DTB_PHYS_ADDR
3737

3838
config NIOS2_DTB_SOURCE_BOOL
3939
bool "Compile and link device tree into kernel image"
40+
depends on !COMPILE_TEST
4041
help
4142
This allows you to specify a dts (device tree source) file
4243
which will be compiled and linked into the kernel image.

arch/powerpc/net/bpf_jit_comp64.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,14 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
415415
case BPF_ALU64 | BPF_DIV | BPF_K: /* dst /= imm */
416416
if (imm == 0)
417417
return -EINVAL;
418-
else if (imm == 1)
419-
goto bpf_alu32_trunc;
418+
if (imm == 1) {
419+
if (BPF_OP(code) == BPF_DIV) {
420+
goto bpf_alu32_trunc;
421+
} else {
422+
EMIT(PPC_RAW_LI(dst_reg, 0));
423+
break;
424+
}
425+
}
420426

421427
PPC_LI32(b2p[TMP_REG_1], imm);
422428
switch (BPF_CLASS(code)) {

arch/riscv/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,12 @@ config PAGE_OFFSET
138138
default 0xffffffff80000000 if 64BIT && MAXPHYSMEM_2GB
139139
default 0xffffffe000000000 if 64BIT && MAXPHYSMEM_128GB
140140

141+
config KASAN_SHADOW_OFFSET
142+
hex
143+
depends on KASAN_GENERIC
144+
default 0xdfffffc800000000 if 64BIT
145+
default 0xffffffff if 32BIT
146+
141147
config ARCH_FLATMEM_ENABLE
142148
def_bool y
143149

arch/riscv/include/asm/kasan.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
#define KASAN_SHADOW_START KERN_VIRT_START /* 2^64 - 2^38 */
1515
#define KASAN_SHADOW_END (KASAN_SHADOW_START + KASAN_SHADOW_SIZE)
1616

17-
#define KASAN_SHADOW_OFFSET (KASAN_SHADOW_END - (1ULL << \
18-
(64 - KASAN_SHADOW_SCALE_SHIFT)))
17+
#define KASAN_SHADOW_OFFSET _AC(CONFIG_KASAN_SHADOW_OFFSET, UL)
1918

2019
void kasan_init(void);
2120
asmlinkage void kasan_early_init(void);

arch/riscv/kernel/head.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ setup_trap_vector:
175175
csrw CSR_SCRATCH, zero
176176
ret
177177

178+
.align 2
178179
.Lsecondary_park:
179180
/* We lack SMP support or have too many harts, so park this hart */
180181
wfi

arch/riscv/mm/kasan_init.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ asmlinkage void __init kasan_early_init(void)
1616
uintptr_t i;
1717
pgd_t *pgd = early_pg_dir + pgd_index(KASAN_SHADOW_START);
1818

19+
BUILD_BUG_ON(KASAN_SHADOW_OFFSET !=
20+
KASAN_SHADOW_END - (1UL << (64 - KASAN_SHADOW_SCALE_SHIFT)));
21+
1922
for (i = 0; i < PTRS_PER_PTE; ++i)
2023
set_pte(kasan_early_shadow_pte + i,
2124
mk_pte(virt_to_page(kasan_early_shadow_page),

arch/riscv/net/bpf_jit_core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
125125

126126
if (i == NR_JIT_ITERATIONS) {
127127
pr_err("bpf-jit: image did not converge in <%d passes!\n", i);
128-
bpf_jit_binary_free(jit_data->header);
128+
if (jit_data->header)
129+
bpf_jit_binary_free(jit_data->header);
129130
prog = orig_prog;
130131
goto out_offset;
131132
}

arch/s390/kvm/interrupt.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3053,13 +3053,14 @@ static void __airqs_kick_single_vcpu(struct kvm *kvm, u8 deliverable_mask)
30533053
int vcpu_idx, online_vcpus = atomic_read(&kvm->online_vcpus);
30543054
struct kvm_s390_gisa_interrupt *gi = &kvm->arch.gisa_int;
30553055
struct kvm_vcpu *vcpu;
3056+
u8 vcpu_isc_mask;
30563057

30573058
for_each_set_bit(vcpu_idx, kvm->arch.idle_mask, online_vcpus) {
30583059
vcpu = kvm_get_vcpu(kvm, vcpu_idx);
30593060
if (psw_ioint_disabled(vcpu))
30603061
continue;
3061-
deliverable_mask &= (u8)(vcpu->arch.sie_block->gcr[6] >> 24);
3062-
if (deliverable_mask) {
3062+
vcpu_isc_mask = (u8)(vcpu->arch.sie_block->gcr[6] >> 24);
3063+
if (deliverable_mask & vcpu_isc_mask) {
30633064
/* lately kicked but not yet running */
30643065
if (test_and_set_bit(vcpu_idx, gi->kicked_mask))
30653066
return;

arch/s390/kvm/kvm-s390.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3312,6 +3312,7 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu)
33123312

33133313
int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu)
33143314
{
3315+
clear_bit(vcpu->vcpu_idx, vcpu->kvm->arch.gisa_int.kicked_mask);
33153316
return kvm_s390_vcpu_has_irq(vcpu, 0);
33163317
}
33173318

drivers/ata/sata_mv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3892,8 +3892,8 @@ static int mv_chip_id(struct ata_host *host, unsigned int board_idx)
38923892
break;
38933893

38943894
default:
3895-
dev_err(host->dev, "BUG: invalid board index %u\n", board_idx);
3896-
return 1;
3895+
dev_alert(host->dev, "BUG: invalid board index %u\n", board_idx);
3896+
return -EINVAL;
38973897
}
38983898

38993899
hpriv->hp_flags = hp_flags;

drivers/base/regmap/regcache-rbtree.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,14 +281,14 @@ static int regcache_rbtree_insert_to_block(struct regmap *map,
281281
if (!blk)
282282
return -ENOMEM;
283283

284+
rbnode->block = blk;
285+
284286
if (BITS_TO_LONGS(blklen) > BITS_TO_LONGS(rbnode->blklen)) {
285287
present = krealloc(rbnode->cache_present,
286288
BITS_TO_LONGS(blklen) * sizeof(*present),
287289
GFP_KERNEL);
288-
if (!present) {
289-
kfree(blk);
290+
if (!present)
290291
return -ENOMEM;
291-
}
292292

293293
memset(present + BITS_TO_LONGS(rbnode->blklen), 0,
294294
(BITS_TO_LONGS(blklen) - BITS_TO_LONGS(rbnode->blklen))
@@ -305,7 +305,6 @@ static int regcache_rbtree_insert_to_block(struct regmap *map,
305305
}
306306

307307
/* update the rbnode block, its size and the base register */
308-
rbnode->block = blk;
309308
rbnode->blklen = blklen;
310309
rbnode->base_reg = base_reg;
311310
rbnode->cache_present = present;

drivers/gpio/gpio-xgs-iproc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ static int iproc_gpio_probe(struct platform_device *pdev)
224224
}
225225

226226
chip->gc.label = dev_name(dev);
227-
if (of_property_read_u32(dn, "ngpios", &num_gpios))
227+
if (!of_property_read_u32(dn, "ngpios", &num_gpios))
228228
chip->gc.ngpio = num_gpios;
229229

230230
irq = platform_get_irq(pdev, 0);

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ static ssize_t dp_link_settings_write(struct file *f, const char __user *buf,
264264
if (!wr_buf)
265265
return -ENOSPC;
266266

267-
if (parse_write_buffer_into_params(wr_buf, size,
267+
if (parse_write_buffer_into_params(wr_buf, wr_buf_size,
268268
(long *)param, buf,
269269
max_param_num,
270270
&param_nums)) {

0 commit comments

Comments
 (0)