linux-stable/arch/arc/kernel
Eugeniy Paltsev 2296eedef0 ARC: u-boot args: check that magic number is correct
[ Upstream commit edb64bca50 ]

In case of devboards we really often disable bootloader and load
Linux image in memory via JTAG. Even if kernel tries to verify
uboot_tag and uboot_arg there is sill a chance that we treat some
garbage in registers as valid u-boot arguments in JTAG case.
E.g. it is enough to have '1' in r0 to treat any value in r2 as
a boot command line.

So check that magic number passed from u-boot is correct and drop
u-boot arguments otherwise. That helps to reduce the possibility
of using garbage as u-boot arguments in JTAG case.

We can safely check U-boot magic value (0x0) in linux passed via
r1 register as U-boot pass it from the beginning. So there is no
backward-compatibility issues.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-04-20 09:15:54 +02:00
..
.gitignore ARC: Add some .gitignore entries 2013-08-26 09:40:24 +05:30
arc_hostlink.c ARC: Hostlink Pseudo-Driver for Metaware Debugger 2013-02-15 23:16:10 +05:30
arcksyms.c ARC: export __udivdi3 for modules 2016-08-19 14:09:33 -07:00
asm-offsets.c ARCv2: [vdk] dts files and defconfig for HS38 VDK 2015-06-25 06:00:21 +05:30
ctx_sw.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/debug.h> 2017-03-02 08:42:34 +01:00
ctx_sw_asm.S ARC: dw2 unwind: enable cfi pseudo ops in string lib 2016-09-30 14:48:22 -07:00
devtree.c ARC: [plat-hsdk] initial port for HSDK board 2017-09-01 11:26:28 -07:00
disasm.c ARC: rename kconfig option for unaligned emulation 2014-10-13 14:46:15 +05:30
entry-arcv2.S ARCv2: support manual regfile save on interrupts 2019-03-23 20:09:51 +01:00
entry-compact.S ARC: typos fix in kernel/entry-compact.S 2017-08-28 15:17:36 -07:00
entry.S ARC: Re-enable MMU upon Machine Check exception 2017-09-01 11:29:05 -07:00
fpu.c ARC: Process-creation/scheduling/idle-loop 2013-02-11 20:00:38 +05:30
head.S ARC: u-boot args: check that magic number is correct 2019-04-20 09:15:54 +02:00
intc-arcv2.c ARCv2: support manual regfile save on interrupts 2019-03-23 20:09:51 +01:00
intc-compact.c ARCv2: SMP: Mask only private-per-core IRQ lines on boot at core intc 2017-08-28 16:11:15 -07:00
irq.c ARC: Enable machine_desc->init_per_cpu for !CONFIG_SMP 2018-06-20 16:12:06 -07:00
kgdb.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/task_stack.h> 2017-03-02 08:42:36 +01:00
kprobes.c bpf/error-inject/kprobes: Clear current_kprobe and enable preempt in kprobe 2018-06-21 12:33:19 +02:00
Makefile ARC: Remove empty kernel/pcibios.c 2017-08-02 14:53:35 -05:00
mcip.c ARC: mcip: update MCIP debug mask when the new cpu came online 2018-02-28 10:45:31 -08:00
module.c ARC: module: Fix !CONFIG_ARC_DW2_UNWIND builds 2017-01-18 11:17:44 -08:00
perf_event.c ARCv2: perf: optimize given that num counters <= 32 2017-11-21 15:20:55 -08:00
process.c ARC: clone syscall to setp r25 as thread pointer 2018-10-05 14:33:29 -07:00
ptrace.c ARCv2: ptrace: provide regset for accumulator/r30 regs 2017-05-03 11:21:31 -07:00
reset.c arc: export symbol for pm_power_off in reset.c 2013-11-06 10:41:44 +05:30
setup.c ARC: u-boot args: check that magic number is correct 2019-04-20 09:15:54 +02:00
signal.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/task_stack.h> 2017-03-02 08:42:36 +01:00
smp.c ARC: setup cpu possible mask according to possible-cpus dts property 2018-02-28 10:45:32 -08:00
stacktrace.c arc: do not use __print_symbol() 2017-12-20 12:41:43 -08:00
sys.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
traps.c Merge branch 'siginfo-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2018-01-30 14:18:52 -08:00
troubleshoot.c ARC: show_regs: lockdep: avoid page allocator... 2019-03-05 17:58:48 +01:00
unaligned.c ARC: [arcompact] brown paper bag bug in unaligned access delay slot fixup 2017-02-07 10:02:01 -08:00
unwind.c treewide/trivial: Remove ';;$' typo noise 2018-02-22 10:59:33 +01:00
vmlinux.lds.S nmi_backtrace: generate one-line reports for idle cpus 2016-10-07 18:46:30 -07:00