Spectre / meltdown?

Post Reply
butch
Posts: 11
Joined: Fri Sep 22, 2017 2:04 am
languages_spoken: english
ODROIDs: u3
Has thanked: 0
Been thanked: 0
Contact:

Spectre / meltdown?

Unread post by butch » Sat Jan 13, 2018 5:42 am

Hi,

What about spectre and meltdown? Is the xu4 vulnerable? using arch linux

Schnitzelbrain
Posts: 21
Joined: Sun Oct 29, 2017 4:13 pm
languages_spoken: german, english
Has thanked: 0
Been thanked: 0
Contact:

Re: Spectre / meltdown?

Unread post by Schnitzelbrain » Sat Jan 13, 2018 8:10 am

The A7 core no (little cores)

A15 core yes (big cores)
Spectre yes, meltdown yes

Patches possible, but still as on all CPUs. Hardware is the problem and remains to be.

Greetz


Schnitzelbrain

User avatar
memeka
Posts: 4290
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 0
Been thanked: 8 times
Contact:

Re: Spectre / meltdown?

Unread post by memeka » Sat Jan 13, 2018 9:00 am

Schnitzelbrain wrote:
A15 core yes (big cores)
Spectre yes, meltdown yes
Umm, no
Just read the other 2-3 threads.

Schnitzelbrain
Posts: 21
Joined: Sun Oct 29, 2017 4:13 pm
languages_spoken: german, english
Has thanked: 0
Been thanked: 0
Contact:

Re: Spectre / meltdown?

Unread post by Schnitzelbrain » Sat Jan 13, 2018 3:53 pm

memeka wrote:
Schnitzelbrain wrote:
A15 core yes (big cores)
Spectre yes, meltdown yes
Umm, no
Just read the other 2-3 threads.
If I read here correct
https://developer.arm.com/support/security-update

Then A15 is vulnerable to 3a what is a variant of Variant 3: rogue data cache load (CVE-2017-5754), what is meltdown.

Or do I take this wrong?

Greetz


Schnitzelbrain

Nominal Animal
Posts: 73
Joined: Sat Sep 16, 2017 12:51 pm
languages_spoken: English, Finnish
ODROIDs: C1+, HC1
Location: Finland
Has thanked: 0
Been thanked: 0
Contact:

Re: Spectre / meltdown?

Unread post by Nominal Animal » Sat Jan 13, 2018 10:56 pm

Schnitzelbrain wrote:Then A15 is vulnerable to 3a
The 3a variant only exposes system registers, not memory contents.

DarkBahamut
Posts: 331
Joined: Tue Jan 19, 2016 10:19 am
languages_spoken: english
ODROIDs: XU4, N1
Has thanked: 0
Been thanked: 0
Contact:

Re: Spectre / meltdown?

Unread post by DarkBahamut » Mon Jan 15, 2018 7:51 pm

The A15 cores are affected by Spectre though. Variant 2 requires kernel patches and that going to come with performance decreases.

To date Arm haven't released the required patches for 32bit kernels so there isn't any mitigation for the A15.

Nominal Animal
Posts: 73
Joined: Sat Sep 16, 2017 12:51 pm
languages_spoken: English, Finnish
ODROIDs: C1+, HC1
Location: Finland
Has thanked: 0
Been thanked: 0
Contact:

Re: Spectre / meltdown?

Unread post by Nominal Animal » Tue Jan 16, 2018 3:52 am

The variant 2 kernel patches are still under development; the second version of the patch series by Marc Zyngier of ARM look quite promising, too.

elatllat
Posts: 1225
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1
Has thanked: 0
Been thanked: 2 times
Contact:

Re: Spectre / meltdown?

Unread post by elatllat » Thu Jan 18, 2018 10:01 pm

x86 only just got the retpoline mitigation https://lwn.net/Articles/744621/

Le_xi
Posts: 1
Joined: Fri Jan 19, 2018 8:37 pm
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: Spectre / meltdown?

Unread post by Le_xi » Fri Jan 19, 2018 8:41 pm

I am running Dietpi on a XU4. Is there anything I can/should do right now?

User avatar
meveric
Posts: 9933
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, N2
Has thanked: 1 time
Been thanked: 25 times
Contact:

Re: Spectre / meltdown?

Unread post by meveric » Fri Jan 19, 2018 9:38 pm

No, there's nothing you can do. Once Kernel are patched a simple Kernel update will do the trick.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

Ronaldleess
Posts: 59
Joined: Wed May 24, 2017 6:52 am
languages_spoken: english
ODROIDs: XU4 C1 C1+
Has thanked: 0
Been thanked: 0
Contact:

Re: Spectre / meltdown?

Unread post by Ronaldleess » Thu Jan 25, 2018 11:53 pm

Code: Select all

# system will freeze if this isn't done
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor  

# first thing on startup before cores are in use (otherwise, won't work)
echo "0" > /sys/devices/system/cpu/cpu4/online
echo "0" > /sys/devices/system/cpu/cpu5/online
echo "0" > /sys/devices/system/cpu/cpu6/online
echo "0" > /sys/devices/system/cpu/cpu7/online

# check to make sure only small cores online: (0xc07)
grep "CPU part" /proc/cpuinfo
In the meantime, something like this may work (since small cores not affected by meltdown or spectre).
I am The Umbrella Man

DarkBahamut
Posts: 331
Joined: Tue Jan 19, 2016 10:19 am
languages_spoken: english
ODROIDs: XU4, N1
Has thanked: 0
Been thanked: 0
Contact:

Re: Spectre / meltdown?

Unread post by DarkBahamut » Sat Jan 27, 2018 12:34 am

The arm patches for 32bit CPU's are available now, but haven't been merged into any branch upstream yet I believe. You can merge them into 4.14 without too much trouble though and they seem to work OK so far. I've not noticed any significant performance changes in the few benchmarks I ran, just mainly ~2-3% fluctuations which is almost margin of error really.

User avatar
odroid
Site Admin
Posts: 30270
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 3 times
Been thanked: 26 times
Contact:

Re: Spectre / meltdown?

Unread post by odroid » Sun Jan 28, 2018 10:55 am

@DarkBahamut
Can you give me a link of the patch for Cortex-A15?

Nominal Animal
Posts: 73
Joined: Sat Sep 16, 2017 12:51 pm
languages_spoken: English, Finnish
ODROIDs: C1+, HC1
Location: Finland
Has thanked: 0
Been thanked: 0
Contact:

Re: Spectre / meltdown?

Unread post by Nominal Animal » Sun Jan 28, 2018 11:42 am

Marc Zyngier's third version of the patch set is here; of which 4/6, 5/6, and 6/6 affect A15. You might need to port some additional patches from the arm64 kpti branch, too.

DarkBahamut
Posts: 331
Joined: Tue Jan 19, 2016 10:19 am
languages_spoken: english
ODROIDs: XU4, N1
Has thanked: 0
Been thanked: 0
Contact:

Re: Spectre / meltdown?

Unread post by DarkBahamut » Sun Jan 28, 2018 11:20 pm

The patches above are whats is required for the A15, indeed. You'll have to manual merge them unless you merge the other 3 patches though as the A15 patches make changes on top of them. Personally I just merged the whole 6 patches from the set as it's a bit easier/cleaner. 1 patch from the arm64 set is required to merge them, though only about half the commit is actually needed so you could cherry-pick out the required bits in theory. Again I just merged the whole commit as it's easier and won't cause any issues for the XU4. It needed a manual merge because of a very minor difference in the file between 4.15 and 4.14.

Otherwise they all apply nicely to 4.14.15. Been testing/running them for two days now and not noticed any issues or performance drops so far (phew!) :)

https://github.com/Emerald-Phoenix/linu ... -bp-4.14.y - The 7 commits from 26th Jan will all apply cleanly onto the odroidxu4 4.14.15 branch.

User avatar
odroid
Site Admin
Posts: 30270
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 3 times
Been thanked: 26 times
Contact:

Re: Spectre / meltdown?

Unread post by odroid » Mon Jan 29, 2018 9:54 am

Kernel 4.14.15 update has been released with Marc Zyngier's Spectre patches.

Code: Select all

odroid@odroid:~$ uname -a
Linux odroid 4.14.15-103 #1 SMP PREEMPT Sun Jan 28 20:54:21 UTC 2018 armv7l armv7l armv7l GNU/Linux
But we need some helps to learn how to test the patch and the performance drops.
WebGL & Octane 2 on Chromium browser and some UnixBench results seem to be same as the previous kernel though.

Nominal Animal
Posts: 73
Joined: Sat Sep 16, 2017 12:51 pm
languages_spoken: English, Finnish
ODROIDs: C1+, HC1
Location: Finland
Has thanked: 0
Been thanked: 0
Contact:

Re: Spectre / meltdown?

Unread post by Nominal Animal » Mon Jan 29, 2018 8:35 pm

As I mentioned weeks ago here, I do expect the overhead from the mitigations on A15 to be within the noise of the measurements in practice, based on having examined the suggested changes in the patches.

Note that you'll want to test kernels that are otherwise exactly the same, to isolate the effect of the changes to this patch set. Other changes in the kernel may affect benchmark results. It is of course also useful to compare different kernel versions, one just cannot pinpoint the reason between any differences in the benchmark results then.

The overhead occurs on syscalls, so you'll want to test workloads where lots of syscalls -- like reads and writes, or sends and receives -- are made. I/O tests (like iobench), database benchmarks, and networking benchmarks (like netperf and uperf), comparing performance on the same hardware, should show the overhead if the overhead is measurable in practice at all.

crossover
Posts: 113
Joined: Wed Jul 22, 2015 2:23 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, USB-IO, HC2, Tinkering kits
Has thanked: 0
Been thanked: 0
Contact:

Re: Spectre / meltdown?

Unread post by crossover » Wed Jan 31, 2018 10:56 pm

I've intensively tested Kernel 4.14.15 for a couple of days on my HC1 server with a 240GB SSD. There was no issue so far and the SATA file-io performance is quite fast and stable as previos Kernel 4.9.
I'm really grateful to hardkernel. There are very few SBCs can run up-to-date kernel in the ARM world.

elatllat
Posts: 1225
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1
Has thanked: 0
Been thanked: 2 times
Contact:

Re: Spectre / meltdown?

Unread post by elatllat » Sat Feb 03, 2018 10:20 pm


elatllat
Posts: 1225
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1
Has thanked: 0
Been thanked: 2 times
Contact:

Re: Spectre / meltdown?

Unread post by elatllat » Sat Mar 17, 2018 10:21 pm

Code: Select all

> git clone https://github.com/speed47/spectre-meltdown-checker.git
> cd spectre-meltdown-checker
> git checkout -b offset origin/offset
> bash spectre-meltdown-checker.sh -v -v
Spectre and Meltdown mitigation detection tool v0.35

Checking for vulnerabilities on current system
Kernel is Linux 4.14.26-119 #1 SMP PREEMPT Tue Mar 13 08:11:46 UTC 2018 armv7l
CPU is ARM v7 model 0xc07
Will use vmlinux image /boot/vmlinuz-4.14.26-119
Will use kconfig /proc/config.gz (decompressed)
Will use System.map file /proc/kallsyms
(debug) try_decompress: looking for gunzip magic in /boot/vmlinuz-4.14.26-119
(debug) try_decompress: magic for gunzip found at offset 27501:xy
(debug) try_decompress: decompression with gunzip worked but result is not a kernel, trying with an offset
(debug) try_decompress: looking for cat magic in /tmp/vmlinux-ptrtPJ
(debug) try_decompress: magic for cat found at offset 10745961:xxy
(debug) try_decompress: decompressed with cat successfully!
Kernel image version is unknown

Hardware check
* Hardware support (CPU microcode) for mitigation techniques
  * Indirect Branch Restricted Speculation (IBRS)
    * SPEC_CTRL MSR is available: (debug) attempted to load module msr, insmod_msr=
 UNKNOWN  (couldn't read /dev/cpu/0/msr, is msr support enabled in your kernel?)
    * CPU indicates IBRS capability: (debug) attempted to load module cpuid, insmod_cpuid=
 UNKNOWN  (couldn't read /dev/cpu/0/cpuid, is cpuid support enabled in your kernel?)
    * Kernel has set the spec_ctrl flag in cpuinfo:  NO 
  * Indirect Branch Prediction Barrier (IBPB)
    * PRED_CMD MSR is available:  UNKNOWN  (couldn't read /dev/cpu/0/msr, is msr support enabled in your kernel?)
    * CPU indicates IBPB capability: (debug) attempted to load module cpuid, insmod_cpuid=
 UNKNOWN  (couldn't read /dev/cpu/0/cpuid, is cpuid support enabled in your kernel?)
  * Single Thread Indirect Branch Predictors (STIBP)
    * SPEC_CTRL MSR is available:  UNKNOWN  (couldn't read /dev/cpu/0/msr, is msr support enabled in your kernel?)
    * CPU indicates STIBP capability: (debug) attempted to load module cpuid, insmod_cpuid=
 UNKNOWN  (couldn't read /dev/cpu/0/cpuid, is cpuid support enabled in your kernel?)
  * Enhanced IBRS (IBRS_ALL)
    * CPU indicates ARCH_CAPABILITIES MSR availability: (debug) attempted to load module cpuid, insmod_cpuid=
 UNKNOWN  (couldn't read /dev/cpu/0/cpuid, is cpuid support enabled in your kernel?)
    * ARCH_CAPABILITIES MSR advertises IBRS_ALL capability:  UNKNOWN 
  * CPU explicitly indicates not being vulnerable to Meltdown (RDCL_NO):  UNKNOWN 
  * CPU microcode is known to cause stability problems:  NO 
* CPU vulnerability to the three speculative execution attacks variants
  * Vulnerable to Variant 1: (debug) checking cpu1: <0xc07> <7>
(debug) checking cpu1: this arm non vulnerable to 1 & 2
(debug) checking cpu1: this arm non vulnerable to meltdown
(debug) is_cpu_vulnerable: for cpu1 and so far, we have <immune> <immune> <immune>
(debug) checking cpu2: <0xc07> <7>
(debug) checking cpu2: this arm non vulnerable to 1 & 2
(debug) checking cpu2: this arm non vulnerable to meltdown
(debug) is_cpu_vulnerable: for cpu2 and so far, we have <immune> <immune> <immune>
(debug) checking cpu3: <0xc07> <7>
(debug) checking cpu3: this arm non vulnerable to 1 & 2
(debug) checking cpu3: this arm non vulnerable to meltdown
(debug) is_cpu_vulnerable: for cpu3 and so far, we have <immune> <immune> <immune>
(debug) checking cpu4: <0xc07> <7>
(debug) checking cpu4: this arm non vulnerable to 1 & 2
(debug) checking cpu4: this arm non vulnerable to meltdown
(debug) is_cpu_vulnerable: for cpu4 and so far, we have <immune> <immune> <immune>
(debug) checking cpu5: <0xc0f> <7>
(debug) checking cpu5: this armv7 vulnerable to spectre 1 & 2
(debug) checking cpu5: this arm non vulnerable to meltdown
(debug) is_cpu_vulnerable: for cpu5 and so far, we have <vuln> <vuln> <immune>
(debug) checking cpu6: <0xc0f> <7>
(debug) checking cpu6: this armv7 vulnerable to spectre 1 & 2
(debug) checking cpu6: this arm non vulnerable to meltdown
(debug) is_cpu_vulnerable: for cpu6 and so far, we have <vuln> <vuln> <immune>
(debug) checking cpu7: <0xc0f> <7>
(debug) checking cpu7: this armv7 vulnerable to spectre 1 & 2
(debug) checking cpu7: this arm non vulnerable to meltdown
(debug) is_cpu_vulnerable: for cpu7 and so far, we have <vuln> <vuln> <immune>
(debug) checking cpu8: <0xc0f> <7>
(debug) checking cpu8: this armv7 vulnerable to spectre 1 & 2
(debug) checking cpu8: this arm non vulnerable to meltdown
(debug) is_cpu_vulnerable: for cpu8 and so far, we have <vuln> <vuln> <immune>
(debug) is_cpu_vulnerable: temp results are <vuln> <vuln> <immune>
(debug) is_cpu_vulnerable: final results are <0> <0> <1>
 YES 
  * Vulnerable to Variant 2:  YES 
  * Vulnerable to Variant 3:  NO 

CVE-2017-5753 [bounds check bypass] aka 'Spectre Variant 1'
* Kernel has array_index_mask_nospec:  NO 
* Kernel has the Red Hat/Ubuntu patch:  NO 
* Checking count of LFENCE instructions following a jump in kernel... objdump: /tmp/vmlinux-G0rEmi: File format not recognized
 NO  (only 0 jump-then-lfence instructions found, should be >= 30 (heuristic))
> STATUS:  VULNERABLE  (Kernel source needs to be patched to mitigate the vulnerability)

CVE-2017-5715 [branch target injection] aka 'Spectre Variant 2'
* Mitigation 1
  * Kernel is compiled with IBRS/IBPB support: (debug) ibrs: /sys/kernel/debug/ibrs_enabled file doesn't exist
(debug) ibrs: /sys/kernel/debug/x86/ibrs_enabled file doesn't exist
(debug) ibrs: /proc/sys/kernel/ibrs_enabled file doesn't exist
 NO 
  * Currently enabled features
    * IBRS enabled for Kernel space:  NO 
    * IBRS enabled for User space:  NO 
    * IBPB enabled:  NO 
* Mitigation 2
  * Kernel compiled with retpoline option:  NO 
  * Kernel compiled with a retpoline-aware compiler:  NO 
> STATUS:  VULNERABLE  (IBRS hardware + kernel support OR kernel with retpoline are needed to mitigate the vulnerability)

CVE-2017-5754 [rogue data cache load] aka 'Meltdown' aka 'Variant 3'
* Kernel supports Page Table Isolation (PTI):  NO 
* PTI enabled and active: (debug) kpti_enabled: couldn't find any hint that PTI is enabled
 NO 
* Performance impact if PTI is enabled
  * CPU supports PCID:  NO  (no security impact but performance will be degraded with PTI)
  * CPU supports INVPCID:  NO  (no security impact but performance will be degraded with PTI)
* Running as a Xen PV DomU:  NO 
> STATUS:  NOT VULNERABLE  (your CPU vendor reported your CPU model as not vulnerable)

A false sense of security is worse than no security at all, see --disclaimer

DarkBahamut
Posts: 331
Joined: Tue Jan 19, 2016 10:19 am
languages_spoken: english
ODROIDs: XU4, N1
Has thanked: 0
Been thanked: 0
Contact:

Re: Spectre / meltdown?

Unread post by DarkBahamut » Sun Mar 18, 2018 3:02 am

It sounds like that checker is really only for x86 CPU's. It's checking if x86 specific mitigations are in place, not finding them, then it says the CPU is vulnerable. It doesn't appear to actually be testing it directly.
STATUS: VULNERABLE (IBRS hardware + kernel support OR kernel with retpoline are needed to mitigate the vulnerability)
IBRS and retpoline are x86 only. The ARM solution is different: https://git.kernel.org/pub/scm/linux/ke ... og/?h=kpti (these were all merged in 4.14.20)

elatllat
Posts: 1225
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1
Has thanked: 0
Been thanked: 2 times
Contact:

Re: Spectre / meltdown?

Unread post by elatllat » Wed Mar 28, 2018 7:14 pm

DarkBahamut wrote:It sounds like that checker is really only for x86 CPU's. It's checking if x86 specific mitigations are in place, not finding them, then it says the CPU is vulnerable. It doesn't appear to actually be testing it directly.
STATUS: VULNERABLE (IBRS hardware + kernel support OR kernel with retpoline are needed to mitigate the vulnerability)
IBRS and retpoline are x86 only. The ARM solution is different: https://git.kernel.org/pub/scm/linux/ke ... og/?h=kpti (these were all merged in 4.14.20)
Thanks for the link, I sent it to the author of the checker and a few changes were made.
That code may be merged but it does not appear to be enabled;

Code: Select all

> grep CONFIG_HARDEN_BRANCH_PREDICTOR arch/arm/configs/odroidxu4_defconfig
>
XU4 uses A15s for which it looks like CONFIG_HARDEN_BRANCH_PREDICTOR is required to change from cpu_v7_switch_mm to cpu_v7_icinv_switch_mm

ah, those were not "all merged in 4.14.20";

Code: Select all

grep -R CONFIG_HARDEN_BRANCH_PREDICTOR .
./arch/arm64/kernel/Makefile:arm64-obj-$(CONFIG_HARDEN_BRANCH_PREDICTOR)	+= bpi.o
./arch/arm64/kernel/entry.S:#ifdef CONFIG_HARDEN_BRANCH_PREDICTOR
./arch/arm64/kernel/cpu_errata.c:#ifdef CONFIG_HARDEN_BRANCH_PREDICTOR
./arch/arm64/kernel/cpu_errata.c:#endif	/* CONFIG_HARDEN_BRANCH_PREDICTOR */
./arch/arm64/kernel/cpu_errata.c:#ifdef CONFIG_HARDEN_BRANCH_PREDICTOR
./arch/arm64/include/asm/mmu.h:#ifdef CONFIG_HARDEN_BRANCH_PREDICTOR
./arch/arm64/include/asm/mmu.h:#endif	/* CONFIG_HARDEN_BRANCH_PREDICTOR */
./arch/arm64/include/asm/kvm_mmu.h:#ifdef CONFIG_HARDEN_BRANCH_PREDICTOR
only the arm64 not the arm patches were.

elatllat
Posts: 1225
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1
Has thanked: 0
Been thanked: 2 times
Contact:

Re: Spectre / meltdown?

Unread post by elatllat » Thu Jun 14, 2018 12:30 pm

looks like the patches made it into 4.18 https://www.phoronix.com/scan.php?page= ... s-Week-One

Post Reply

Return to “Issues”

Who is online

Users browsing this forum: Baidu [Spider] and 4 guests