[Security] Meltdown and Spectre vulnerabilities in ARM

https://meltdownattack.com/

Meltdown and Spectre exploit critical vulnerabilities in modern processors. These hardware bugs allow programs to steal data which is currently processed on the computer. While programs are typically not permitted to read data from other programs, a malicious program can exploit Meltdown and Spectre to get hold of secrets stored in the memory of other running programs. This might include your passwords stored in a password manager or browser, your personal photos, emails, instant messages and even business-critical documents.

Does anyone working on patches for LEDE/OpenWRT?

Linux kernel developers. This is a kernel-level issue.
Once the patches get into the Linux releases, it will get patched automatically here, too.
Openwrt/LEDE is a Linux after all.

2 Likes

It will require some time and effort to port all nescessary fixes to LEDE but we certainly plan to do so.

The entirety of the situation is still unfolding, but so far it seems that we need to patch both toolchain (http://git.infradead.org/users/dwmw2/gcc-retpoline.git/shortlog/refs/heads/gcc-7_2_0-retpoline-20171219) and kernel (https://lkml.org/lkml/2018/1/4/174) to address Spectre.

Meltdown already received kernel fixes in the form of the new Kernel Page Table Isolation (KPTI) infrastructure (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5aa90a84589282b87666f92b6c3c917c8080a9bf).

The need to backport the various kernel and toolchain fixes to the older versions used by LEDE will delay the process somewhat and the toolchain patches will force us to recompile the entire stable release which will take between 7 to 10 days after preparing the source tree.

3 Likes

Sure but from what I read only Linux 4.15 is receiving patches. Patches for Linux 4.14.1 are being backported, however LEDE-17.01 is running on Linux 4.4. I don't think it will get patches as automatically as you say.

Second thing. Which CPU models are actually affected?
I think the IPQ806x is and the ones based on Marvell 88F6820 as affected too but what about WR1043NDv4 which is QCA9563.

I don't think the patches should be activated on all routers. Only the ones that are affected so we don't unnecessary cripple performance.

they will backport them

Sure but from what I read only Linux 4.15 is receiving patches. Patches for
Linux 4.14.1 are being backported, however LEDE-17.01 is running on Linux 4.4.
I don't think it will get patches as automatically as you say.

the LEDE/OpenWRT developers would backport the fixes (or move to the new kernel)

Second thing. Which CPU models are actually affected?

At this point, everything that does speculative execution (pretty much
everything x86 or ARM at least) suffers from at least some of the problems

I think the IPQ806x is and the ones based on Marvell 88F6820 as affected too but what about WR1043NDv4 which is QCA9563.

I don't think the patches should be activated on all routers. Only the ones that are affected so we don't unnecessary cripple performance.

Well, it can be argued that embedded systems like this that aren't running
arbitrary code can get away without applying these changes at all (if you don't
have a hostile person running code on your CPU, there is no way for these things
to be exploited)

but these patches are to low-level processor specific code, so they will only
ever be applied to devices running the affected CPUs.

The kernel developers are still figuring out the patches, the performance
implications, and which CPUs are affected, so it's far too early to be asking
about LEDE getting the fixes.

There was a post a few hours ago talking about Intel possibly being about to
release updated microcode for their CPUs to address some of this (and the bad
performance implications of this, along with other options), which just shows
how dynamic the situation is right now.

1 Like

Guidance from the US Department of Homeland Security CERT...

https://www.us-cert.gov/ncas/alerts/TA18-004A

Not just isolated to ARM.

Both kernel 4.4 and 4.9 release candidates with the KPTI fixes are out right now so there will be no need to backport specifically for LEDE. Once the kernels are updated to 4.4.110 and 4.9.75 respectively, the fix is in.

And as noted by dlang above the official security model for these routers is that there are no "users" so the impact is typically nonexistent. The security risk is to any CPU that allows arbitrary user code to run.

1 Like

will there be a new lede release?

i am asking because i build the image myself. i usually checkout latest stable tag. currently, thats 17.01.4 - will there be a 17.01.5 which i can build?

Yes, a 17.01.5 is planned soon. Probably within the next two to three weeks.

2 Likes

Spectre hit most cpus no matter the architecture. Meltdown affect only intel and partialy amd/arm. Its here the most dangerous vulnerability from both. And meltdown workaround will probably consume way more cpu speed than spectre.

Not according to ARM, some arm cores are also listed as susceptible to meltdown, (see https://developer.arm.com/support/security-update and https://developer.arm.com/support/security-update/download-the-whitepaper)

1 Like

Thy for correcting me

My WRT1900ACS hat this CPU:

model name : ARMv7 Processor rev 1 (v7l)
BogoMIPS : 50.00
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpd32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x4
CPU part : 0xc09
CPU revision : 1

Hardware : Marvell Armada 380/385 (Device Tree)

So, i cannot find the ARM v7 in this list:

This means, that the cpu and so finally my router is not vulnerable, right?

Regards,
Andreas

I can't say 100%, but I would expect the answer is that it's not vulnerable.

The CPU features that cause these vulnerabilities are complex things that only
exist on fairly high-end CPUs. Thinks used in most routers (and the Raspberry Pi
level of devices) are too cheap and simple to have these features, and so are
not vulnerable.

The very high-end ARM chips do have these features, and are vulnerable, but I
very much doubt that any router has these chips.

Remember, to be explited, you have to allow the attacker to run their code on
your system. There is not much that happens in LEDE (especially a standard
router deployment) that does this.

David Lang

1 Like

According to https://wikidevi.com/wiki/Linksys_WRT1900ACS
you have a Marvell 88F6820 (1.6 GHz, 2 cores) CPU, According to http://www.marvell.com/embedded-processors/armada-38x/assets/ARMADA-38x-Hardware-Spec.pdf the 88F6820 has dual cortex A9 CPUs, And according to https://developer.arm.com/support/security-update the A9 is susceptible to both variants of spectre, but not to meltdown.
ARMv7 refers to the version of the ISA (see http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka13706.html), and at each version there could be multiple different CPUs (see https://en.wikipedia.org/wiki/ARM_architecture)

But as @dlang noted susceptibility to the attack does not mean that the attack is actually feasible on your router. (Put differently, for the remote attacker to run the exploit code he would first need to get root on your router (many routers only have the root user, so getting a login is equivalent to becoming root), but at that point it is game-over already...

3 Likes

Thank you so much - awsome answer!

I have read, that the KPTI-patch from 4.14.11 was backported to 4.9.75 - so it will be soon in the development snapshots, i guess ... actual kernel there is 4.9.73 ...

4.9.75 has been committed to trunk but I'm not sure it actually enables the fix for x86. The x86 patches have been backported but there is a config flag that must be enabled (and is not part of the OpenWrt trunk commit).

Ref: http://kroah.com/log/blog/2018/01/06/meltdown-status/

Any patches for ARM CPUs are still to come.

CONFIG_PAGE_TABLE_ISOLATION gets enabled by default, even if the linked commit does not explicitely set it in target/linux/x86/64/config-default.

config PAGE_TABLE_ISOLATION
        bool "Remove the kernel mapping in user mode"
        default y
        depends on X86_64 && SMP