OpenCloudOS-Kernel/arch/riscv/kernel/pi
Christophe JAILLET a720833e6b riscv: Fix an off-by-one in get_early_cmdline()
[ Upstream commit adb1f95d388a43c4c564ef3e436f18900dde978e ]

The ending NULL is not taken into account by strncat(), so switch to
strlcat() to correctly compute the size of the available memory when
appending CONFIG_CMDLINE to 'early_cmdline'.

Fixes: 26e7aacb83 ("riscv: Allow to downgrade paging mode from the command line")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Link: https://lore.kernel.org/r/9f66d2b58c8052d4055e90b8477ee55d9a0914f9.1698564026.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-01-31 16:18:48 -08:00
..
Makefile riscv: Introduce virtual kernel mapping KASLR 2023-09-05 19:49:27 -07:00
cmdline_early.c riscv: Fix an off-by-one in get_early_cmdline() 2024-01-31 16:18:48 -08:00
fdt_early.c riscv: Introduce virtual kernel mapping KASLR 2023-09-05 19:49:27 -07:00