Merge ~rathore4u/ubuntu/+source/linux/+git/version-seeds:LP2069534-140-char-fix into ~ubuntu-kernel/ubuntu/+source/linux/+git/noble:master

Proposed by Shantur Rathore
Status: Needs review
Proposed branch: ~rathore4u/ubuntu/+source/linux/+git/version-seeds:LP2069534-140-char-fix
Merge into: ~ubuntu-kernel/ubuntu/+source/linux/+git/noble:master
Diff against target: 62 lines (+11/-17)
1 file modified
arch/arm64/kernel/idreg-override.c (+11/-17)
Reviewer Review Type Date Requested Status
Ubuntu Kernel Repositories Pending
Review via email: mp+469973@code.launchpad.net
To post a comment you must log in.

Unmerged commits

a16c19a... by Shantur Rathore <email address hidden>

LP2069534 - ARM64 doesn't boot if command line param is more than 140 chars

The bug was introduced in v6.8-rc1 with the commit reverted below.
It got fixed with Mini C runtime in v6.9-rc1. For now in v6.8 revert the
commit to fix the issue.

Revert "arm64: idreg-override: Avoid parameq() and parameqn()"

This reverts commit dc3f5aae06381b43bc9d0d416bd15ee1682940e9.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/arch/arm64/kernel/idreg-override.c b/arch/arm64/kernel/idreg-override.c
2index e30fd9e..c2ea804 100644
3--- a/arch/arm64/kernel/idreg-override.c
4+++ b/arch/arm64/kernel/idreg-override.c
5@@ -185,8 +185,8 @@ static const struct {
6 char alias[FTR_ALIAS_NAME_LEN];
7 char feature[FTR_ALIAS_OPTION_LEN];
8 } aliases[] __initconst = {
9- { "kvm_arm.mode=nvhe", "id_aa64mmfr1.vh=0" },
10- { "kvm_arm.mode=protected", "id_aa64mmfr1.vh=0" },
11+ { "kvm-arm.mode=nvhe", "id_aa64mmfr1.vh=0" },
12+ { "kvm-arm.mode=protected", "id_aa64mmfr1.vh=0" },
13 { "arm64.nosve", "id_aa64pfr0.sve=0" },
14 { "arm64.nosme", "id_aa64pfr1.sme=0" },
15 { "arm64.nobti", "id_aa64pfr1.bt=0" },
16@@ -223,7 +223,7 @@ static int __init find_field(const char *cmdline, char *opt, int len,
17 len += flen;
18 opt[len++] = '=';
19
20- if (memcmp(cmdline, opt, len))
21+ if (!parameqn(cmdline, opt, len))
22 return -1;
23
24 return parse_hexdigit(cmdline + len, v);
25@@ -286,29 +286,23 @@ static __init void __parse_cmdline(const char *cmdline, bool parse_aliases)
26
27 cmdline = skip_spaces(cmdline);
28
29- /* terminate on "--" appearing on the command line by itself */
30- if (cmdline[0] == '-' && cmdline[1] == '-' && isspace(cmdline[2]))
31- return;
32-
33- for (len = 0; cmdline[len] && !isspace(cmdline[len]); len++) {
34- if (len >= sizeof(buf) - 1)
35- break;
36- if (cmdline[len] == '-')
37- buf[len] = '_';
38- else
39- buf[len] = cmdline[len];
40- }
41+ for (len = 0; cmdline[len] && !isspace(cmdline[len]); len++);
42 if (!len)
43 return;
44
45- buf[len] = 0;
46+ len = min(len, ARRAY_SIZE(buf) - 1);
47+ memcpy(buf, cmdline, len);
48+ buf[len] = '\0';
49+
50+ if (strcmp(buf, "--") == 0)
51+ return;
52
53 cmdline += len;
54
55 match_options(buf);
56
57 for (i = 0; parse_aliases && i < ARRAY_SIZE(aliases); i++)
58- if (!memcmp(buf, aliases[i].alias, len + 1))
59+ if (parameq(buf, aliases[i].alias))
60 __parse_cmdline(aliases[i].feature, false);
61 } while (1);
62 }

Subscribers

People subscribed via source and target branches