OPNsense Forum

English Forums => General Discussion => Topic started by: opnsense_user12123 on January 04, 2018, 04:35:00 pm

Title: https://meltdownattack.com/
Post by: opnsense_user12123 on January 04, 2018, 04:35:00 pm
1. Is there a fix for that problem even on opnsense in the near future ?

2. How high will the loss of performance be?
Title: Re: https://meltdownattack.com/
Post by: phoenix on January 04, 2018, 05:15:17 pm
1. Is there a fix for that problem even on opnsense in the near future ?
Surely that would depend on the upstream kernel developers as that's where the problem is being fixed in Linux & Windows.

2. How high will the loss of performance be?
That would depend on the workload and is estimated at between 5%-30% - possibly more but you'd have to benchmark the system before and after the fixes were applied. The best advice is to read some of the more sensible articles on the subject and wait for any fixes.
Title: Re: https://meltdownattack.com/
Post by: opnsense_user12123 on January 04, 2018, 05:40:57 pm
if I read correctly, data can be read from the cache. Is the firewall still safe?

What about Spectre?
Title: Re: https://meltdownattack.com/
Post by: phoenix on January 04, 2018, 06:00:10 pm
I'm not a security expert (at least, not for PCs) but these exploits have been known about for a while and the embargo on the news was lifted yesterday which is why you're seeing a flurry of speculation. There is, as far as I can see, no known exploit for these vulnerabilities in the wild. As I said earlier, wait for official news from the kernel developers.There should be no reason at this point to worry about the firewall - in addition, there is also no alternative available. :)
Title: Re: https://meltdownattack.com/
Post by: opnsense_user12123 on January 04, 2018, 06:03:59 pm
GREAT NEWS!  :'(
Title: Re: https://meltdownattack.com/
Post by: franco on January 04, 2018, 06:55:23 pm
From what we discussed on IRC this is a local attack, quite unlikely to hit in a server/appliance scenario. Also meaning it can only be exploited in conjunction with a remote exploit or local shell access.

However, network servers and routers may take a larger performance hit for full mitigation than user desktop systems.

FreeBSD is said to be working on patches. LLVM (clang) is also working on this. This will likely go on for months, if not all year.

It's likely the worst thing that ever happened. Stay tuned for more to unfold and buy AMD if you can. ;)


Cheers,
Franco
Title: Re: https://meltdownattack.com/
Post by: chemlud on January 04, 2018, 07:17:36 pm
...have no stocks of either AMD or Intel, but:

https://www.amd.com/en/corporate/speculative-execution

AMD not totally safe, apparently.
Title: Re: https://meltdownattack.com/
Post by: franco on January 04, 2018, 07:18:53 pm
Not safe, but maybe safer. Note we have "Meltdown" (Intel) and "Spectre" (Intel, AMD, ARM).
Title: Re: https://meltdownattack.com/
Post by: chemlud on January 04, 2018, 07:24:14 pm
...but based on this I would not kick out any Intel hardware and replace by AMD, currently ;-)
Title: Re: https://meltdownattack.com/
Post by: franco on January 04, 2018, 07:24:55 pm
True, I didn't mean replace. Just buy smart. :)

As a side note, please enjoy this gem from Theo de Raadt (OpenBSD) from 2007 on the Intel Core 2 bugs and his predictions for the future.

https://marc.info/?l=openbsd-misc&m=118296441702631&w=2


Cheers,
Franco
Title: Re: https://meltdownattack.com/
Post by: lattera on January 04, 2018, 08:45:10 pm
From what we discussed on IRC this is a local attack, quite unlikely to hit in a server/appliance scenario. Also meaning it can only be exploited in conjunction with a remote exploit or local shell access.

Hey Franco,

I'd like to clarify this bit. The Meltdown and Spectre attacks are only local. Remote attacks are extremely unlikely. If a remote vulnerability is found and exploited, the attacker will likely use that vulnerability to gain local access. It's after gaining local access that side channel attacks like Meltdown come into play. Meltdown then becomes extremely serious, especially on systems with non-ECC RAM where Row Hammer could be combined to gain arbitrary write access in the kernel.

FreeBSD's kernel is extremely leaky. Meaning, the kernel is full of information leak vulnerabilities. Log in and simply issue `sysctl -a | grep 0x` as an unprivileged user. While Meltdown is critical in that it can leak the contents of arbitrary kernel and userland memory, the FreeBSD kernel itself is an easy target once local access is achieved. Mitigating Meltdown would simply cause an attacker to look at the plentiful amount of other information leaks, buffer overflows, integer overflows, and other vulnerabilities that lie within the kernel.

We at HardenedBSD are paying attention. We're interested in the mitigation FreeBSD comes up with and will work to audit, test, and include it. We will work with OPNsense to merge it in.

OPNsense users are at a great advantage here due to the inclusion of a few of HardenedBSD's core features (ASLR, SEGVGUARD, and SafeStack integration). The inclusion of those features will drive up the economic cost for attackers, frustrating them and their attempts at exploitation. With HardenedBSD, gone are the days of copy & paste mass exploitation.

edit[0]: llvm is working on an approach (https://reviews.llvm.org/D41723) to mitigate Spectre. If the approach makes it to 6.0.0, I will definitely play around with it in a special feature branch of HardenedBSD.
Title: Re: https://meltdownattack.com/
Post by: franco on January 04, 2018, 09:13:14 pm
Thank you for the detailed response, Shawn. :)
Title: Re: https://meltdownattack.com/
Post by: tillsense on January 05, 2018, 07:48:24 pm
@Shawn

always good to read that there are people who keep their heads!

thanks cheers till
Title: Re: https://meltdownattack.com/
Post by: mimugmail on January 05, 2018, 08:41:24 pm
If you need local access, why does Cisco release Snort rules for Port 25? It would only make sense if the mail service has some buffer problems too, right?
Title: Re: https://meltdownattack.com/
Post by: xinnan on January 06, 2018, 04:11:53 pm
I'm not really worried about any of this as far as my firewall goes because unless opnsense is going to start writing code to exploit the vulnerabilities themselves, I'm totally at a loss for how any of this would ever get a chance to RUN on my box.  Sure, it might pass through the firewall, but I don't see that as a threat to the firewall itself.

Now, If I had something running in a cloud I'd be very worried that someone else might run something malicious on that same cloud server.  I suppose it also makes sense to worry about computers where you run web browsers or that idiots who like clicking "yes, download, install" might have access to the keyboard.

However, probably the biggest problem I see is people running things in the cloud.  If I read and understand these vulnerabilities correctly, it would mean that I could run a malicious VM that could potentially start grabbing info from the memory of the server running many other VMs and potentially get lucky and gain some privileged info. 

Title: Re: https://meltdownattack.com/
Post by: bartjsmit on January 06, 2018, 07:46:29 pm
Amazon has already patched its cloud https://www.neowin.net/news/amazon-aws-customers-see-slowdown-after-meltdown-patch

Bart...
Title: Re: https://meltdownattack.com/
Post by: phoenix on January 06, 2018, 07:58:43 pm
Amazon has already patched its cloud https://www.neowin.net/news/amazon-aws-customers-see-slowdown-after-meltdown-patch

Bart...
So have google: https://security.googleblog.com/2018/01/more-details-about-mitigations-for-cpu_4.html

There's also a patch from VMware for  ESXi systems: https://kb.vmware.com/s/article/2151099
Title: Re: https://meltdownattack.com/
Post by: xinnan on January 06, 2018, 08:27:20 pm
I believe the word that is being tossed around is "mitigation". 

I think we are stuck with Spectre until the next slew of chips are fabricated and the problem is eliminated at the chip level. 
Title: Re: https://meltdownattack.com/
Post by: opnsense_user12123 on January 06, 2018, 09:36:19 pm
Statement of freebsd.org (admin):

About the Meltdown and Spectre attacks: FreeBSD was made aware of the problems in late December 2017. We're working with CPU vendors and the published papers on these attacks to mitigate them on FreeBSD. Due to the fundamental nature of the attacks, no estimate is yet available for the publication date of patches.

https://forums.freebsd.org/threads/63985/#post-371432
Title: Re: https://meltdownattack.com/
Post by: werner on January 07, 2018, 03:30:00 pm
I'm not really convinced attacks are only possible through local access, what about hypervisors. It seems even attacks from one vm to fetch another vm's data are possible. VMWare has patches but those work together with the OS patches. If that's the case any vm running on the same hypervisor host could be used to attack.

That's the type I'm most worried about since we use OPNSense on a vCloud environment where of course other customers have vm's.
Title: Re: https://meltdownattack.com/
Post by: xinnan on January 07, 2018, 03:43:11 pm
Totally agree judging by what I've read, however, VM is a local attack.  It is code running on the machine.  However, If you own the machine and you are the only one running VMs on the machine I think you are in the clear. 

I don't think this really impacts most of us as far as opnsense is concerned unless we are running VMs in the cloud and we don't know what the neighbors are up to.
Title: Re: https://meltdownattack.com/
Post by: franco on January 08, 2018, 07:58:47 am
There are two major areas where these attacks hurt *badly*:

* End users that browse the web, read emails, run applications and updates
* All VM deployments where end-users are deployed or unsupervised code is ran (the "cloud provider") because they make the attack local to the host, even if "sandboxed" in the guest

The best attack vector is to simply *buy* a cheap VM and start scraping the host for secrets in other VMs on it. ;)


Cheers,
Franco
Title: Re: https://meltdownattack.com/
Post by: xinnan on January 08, 2018, 11:18:41 am
The sad thing is that my box's processors are dated enough to be immune to these attacks but I bet the patches slow down my boxes anyway.  Its an epic mess.  Maybe some good will come of this and the x86 architecture will get a badly needed revamp. 
Title: Re: https://meltdownattack.com/
Post by: chemlud on January 08, 2018, 11:21:56 am
@xinnan: I heard the only processors "safe by age" originate from before 1995. What am I missing?
Title: Re: https://meltdownattack.com/
Post by: xinnan on January 08, 2018, 11:42:54 am
Generally true, but some of the Atom chips before 2013 and AMD chips as well are immune.  I'm talking about spectre.  Meltdown can be addressed with OS updates if I'm not misled.

I'm pretty sure that neither my Athlon X2 nor my D2700 are at risk.  However, every laptop and desktop and small server I have are.  Those are all fairly modern Intel CPUs and I do not believe intel when they say they have a fix for this.  I think they are just grasping at straws trying to prevent further devaluation.
Title: Re: https://meltdownattack.com/
Post by: chemlud on January 08, 2018, 12:22:02 pm
...yeah! I have an older AMD CPU machine too! :-D ...and my little farm of RaspberryPis--- :-)
Title: Re: https://meltdownattack.com/
Post by: franco on January 08, 2018, 07:03:21 pm
Hot off the press...

https://lists.freebsd.org/pipermail/freebsd-security/2018-January/009719.html


Cheers,
Franco
Title: Re: https://meltdownattack.com/
Post by: xinnan on January 08, 2018, 08:53:25 pm
Security guys are talking a big game but I feel like this is a whole new game they are not prepared for.
BTW - The firefox and google chrome patches seem to make things both slow and memory hungry if you ask me. 

I'm going to need more tinfoil...
Title: Re: https://meltdownattack.com/
Post by: lattera on January 13, 2018, 01:32:11 am
I thought I'd update everyone with the progress I'm making in addressing Spectre in HardenedBSD.


What's left to do:


Note that this work is only applicable to HardenedBSD 12-CURRENT/amd64. We're still in the very early stages. Once retpoline makes it officially to llvm 6.0, it will be backported to prior versions. Applying this work to OPNsense will take some time. The work I'm doing is simply research. Getting my feet wet.

So, great progress is being made. FreeBSD's PTI patch is coming along as well.

Screenshot here: https://photos.app.goo.gl/nemutoL6zYceaVH12
Title: Re: https://meltdownattack.com/
Post by: lattera on January 16, 2018, 06:07:26 pm
Another update. In the past few days:


Everything's looking good so far. Not a single issue with retpoline, even when building over 29,400 packages. I've had a few issues with PTI, but those have since been resolved. I haven't noticed any real performance impact of retpoline.

The PTI patch does come with a rather large performance hit, especially since it doesn't currently support PCID. (I've been assured by upstream FreeBSD PCID support will follow.) Kostik's PTI patch should land in upstream FreeBSD in a "default disabled" state later today.

I plan to merge into HardenedBSD 12-CURRENT the retpoline patch within the next week or two. Note that retpoline requires lld as the default linker. HardenedBSD enabled lld as the default linker for 12-CURRENT/amd64, but GNU ld remains the default in 11-STABLE/amd64.

The soon-to-be-released OPNsense 18.1 uses FreeBSD 11.1-RELEASE as its upstream, with a select few crucial HardenedBSD bits mixed in. In OPNsense, GNU ld remains the default. Thus, retpoline as currently implemented will not be applicable to OPNsense.
Title: Re: https://meltdownattack.com/
Post by: xinnan on January 16, 2018, 07:52:51 pm
Sounds like good stuff.  How big is "rather large" in terms of percent performance impact?
Title: Re: https://meltdownattack.com/
Post by: lattera on January 16, 2018, 08:10:43 pm
`make -sj6 buildworld` on my Intel Xeon E3-1505M v5 @ 2.80GHz laptop went from 1.5 hours to about 2.25 hours with PTI enabled. retpoline didn't increase the time.
Title: Re: https://meltdownattack.com/
Post by: xinnan on January 16, 2018, 08:39:21 pm
I'm very interested to find out how all these changes will impact packets per second, throughput in terms of bandwidth and VPN bandwidth etc.  I'm hoping it won't be huge.

I'm assuming that more packages, more filtering, more processing will equal more impact, but I'm just guessing and hoping it is less than initially thought.
Title: Re: https://meltdownattack.com/
Post by: lattera on January 16, 2018, 08:53:06 pm
That's a really good question, one that I cannot answer right now. Once PTI becomes available for 11.1-RELEASE, we at OPNsense will definitely have to do one or more "Call For Testing" rounds.
Title: Re: https://meltdownattack.com/
Post by: xinnan on January 16, 2018, 10:08:06 pm
Well, thanks for banging away on it.
Title: Re: https://meltdownattack.com/
Post by: lattera on January 17, 2018, 03:08:52 pm
The amd64 PTI patch has landed in FreeBSD HEAD, disabled by default: https://svnweb.freebsd.org/base?view=revision&revision=328083

We'll enable it by default in HardenedBSD.
Title: Re: https://meltdownattack.com/
Post by: xinnan on January 23, 2018, 11:33:13 am
https://www.theverge.com/2018/1/22/16919426/intel-advises-pause-deployment-of-spectre-patch

https://techcrunch.com/2018/01/22/linus-torvalds-declares-intel-fix-for-meltdown-spectre-complete-and-utter-garbage/

https://gizmodo.com/intel-is-trying-to-fix-the-biggest-problem-with-its-spe-1822305604

All fixed!
Title: Re: https://meltdownattack.com/
Post by: lattera on January 23, 2018, 04:31:21 pm
Update: PTI is now enabled by default on HardenedBSD 12-CURRENT/amd64. The retpoline patch has landed in both upstream llvm (https://reviews.llvm.org/D41723) HEAD and HardenedBSD 12-CURRENT/amd64. Packages are building with retpoline applied to the entire package repo.

HardenedBSD will likely be the first OS to ship with retpoline applied to the entirety of the operating system, spanning not only world and kernel, but also third-party applications in its package repository.
Title: Re: https://meltdownattack.com/
Post by: chemlud on January 23, 2018, 05:57:04 pm
@xinnan:

Much better, there WAS NEVER anything to fix. Intel hardware all OK.

No joke:

https://www.intel.com/content/www/us/en/architecture-and-technology/facts-about-side-channel-analysis-and-intel-products.html

One day in the not-so-far future I will end with Parkinsons' from the all-day head shaking....
Title: Re: https://meltdownattack.com/
Post by: franco on January 23, 2018, 07:14:21 pm
But Intel proposing an OPT-IN hardware flag for "this cpu is insecure, please make it safe and slow" is no indication of lawyer-based R&D and general "cover-my-ass"ing for having done nothing wrong whatsoever? It seems silly on the surface to even entertain the idea of it, the malice hidden beneath if baked into actual hardware... "you can't sue us if you don't use the secure mode -- also we are fast by default, slow is merely your fault -- both issues are not linked if you try to imply that".

https://news.ycombinator.com/item?id=16202205


Cheers,
Franco