Skip to content

Commit ca9c7ab

Browse files
committed
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fixes from Will Deacon: "The main one is a fix for a broken strscpy() conversion that landed in the merge window and broke early parsing of the kernel command line. - Fix an incorrect mask in the CXL PMU driver - Fix a regression in early parsing of the kernel command line - Fix an IP checksum OoB access reported by syzbot" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: csum: Fix OoB access in IP checksum code for negative lengths arm64/sysreg: Fix broken strncpy() -> strscpy() conversion perf: CXL: fix mismatched number of counters mask
2 parents 12952b6 + 8bd795f commit ca9c7ab

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

arch/arm64/kernel/idreg-override.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,9 @@ static __init void __parse_cmdline(const char *cmdline, bool parse_aliases)
262262
if (!len)
263263
return;
264264

265-
len = strscpy(buf, cmdline, ARRAY_SIZE(buf));
266-
if (len == -E2BIG)
267-
len = ARRAY_SIZE(buf) - 1;
265+
len = min(len, ARRAY_SIZE(buf) - 1);
266+
memcpy(buf, cmdline, len);
267+
buf[len] = '\0';
268268

269269
if (strcmp(buf, "--") == 0)
270270
return;

arch/arm64/lib/csum.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ unsigned int __no_sanitize_address do_csum(const unsigned char *buff, int len)
2424
const u64 *ptr;
2525
u64 data, sum64 = 0;
2626

27-
if (unlikely(len == 0))
27+
if (unlikely(len <= 0))
2828
return 0;
2929

3030
offset = (unsigned long)buff & 7;

drivers/perf/cxl_pmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include "../cxl/pmu.h"
2626

2727
#define CXL_PMU_CAP_REG 0x0
28-
#define CXL_PMU_CAP_NUM_COUNTERS_MSK GENMASK_ULL(4, 0)
28+
#define CXL_PMU_CAP_NUM_COUNTERS_MSK GENMASK_ULL(5, 0)
2929
#define CXL_PMU_CAP_COUNTER_WIDTH_MSK GENMASK_ULL(15, 8)
3030
#define CXL_PMU_CAP_NUM_EVN_CAP_REG_SUP_MSK GENMASK_ULL(24, 20)
3131
#define CXL_PMU_CAP_FILTERS_SUP_MSK GENMASK_ULL(39, 32)

0 commit comments

Comments
 (0)