49 ms·
New fuzzing tool finds USB bugs in Linux, Windows, macOS, and FreeBSD
- fsflover 6y agoI am glad I am using Qubes OS, which isolates usb devices from the rest of the system.
- lokedhs 6y agoMe too. However, I can't run it on one of my computers because I need to do development on it which requires the GPU. I really wish there was a reasonable solution for using the GPU with Qubes. If that existed I wouldn't have to use any other distribution, ever.
- NullPrefix 6y agoHave you tried GPU passthrough? Will need two GPUs for that though.
- AnIdiotOnTheNet 6y agoSeems like a pretty ridiculous hoop to have to jump through.
- deleted 6y ago[deleted]
- NullPrefix 6y agoWhat do you mean? The two GPUs or the part where you need to give the VM a GPU if you want that VM to have a GPU ?
- sitkack 6y agoYou do realize you are talking to a person running Qubes?
- fsflover 6y agoI can confirm that Qubes requires additional mental, time and computational resources to run. Many people do not have those and for them it would indeed be ridiculous to use Qubes. Its advantages are not important enough to everyone.
- cerberusss 6y agomacOS is also moving into this direction: https://developer.apple.com/system-extensions/ https://developer.apple.com/system-extensions/ "DriverKit provides a fully modernized replacement for IOKit to create device drivers. System extensions and drivers built with DriverKit run in user space, where they can’t compromise the security or stability of macOS."
- saagarjha 6y agoSadly, DriverKit doesn't actually address all the reasons why you'd want a kernel extension.
- monadic2 6y agoDo you have an example?
- sneak 6y agoLittle Snitch, the most critical piece of Mac software after the kernel.
- monadic2 6y agoTbh, is that not viable through packet fence? I also use little snitch and had not considered this.
- sigjuice 6y agoLittle Snitch will be fine. They will use the new API. https://blog.obdev.at/little-snitch-and-the-deprecation-of-kernel-extensions/ https://blog.obdev.at/little-snitch-and-the-deprecation-of-k...
- _bxg1 6y agoI always assume plugging in an untrusted USB to be security-suicide. At least on Windows it can run arbitrary code, by design. Given that, these bugs don't really affect my threat model at all.
- teknopaul 6y agoI'm pretty sure I dont have an evil maid. I do wince as my mate, who works as a binman, tests found devices on a Windows laptop. So far he has got is about a terrabyte of free storage and no problems.
- jfk13 6y ago> and no problems ...that he knows about.
- nsajko 6y agoIt's not just about software security, a simple USB device can fry its host (your computer). https://en.wikipedia.org/wiki/USB_Killer https://en.wikipedia.org/wiki/USB_Killer https://hackaday.com/2015/03/11/killer-usb-drive-is-designed-to-fry-laptops/ https://hackaday.com/2015/03/11/killer-usb-drive-is-designed... https://hackaday.com/2015/10/10/the-usb-killer-version-2-0/ https://hackaday.com/2015/10/10/the-usb-killer-version-2-0/
- blaser-waffle 6y agoHow is Qubes? Was thinking about a Purism laptop w/ Qubes as a way of indulging my paranoia. It's a cool idea and I've been lookin at it for a while, but it seems onerous to isolate everything.
- fsflover 6y agoLibrem 15 is exactly what I am using with Qubes. It is my daily driver. Isolation not only helps against threats but also helps to organize my work and life. Unbelievably easy backups help too.
- conistonwater 6y agoThe paper itself: https://nebelwelt.net/files/20SEC3.pdf https://nebelwelt.net/files/20SEC3.pdf
- pjmlp 6y agoAnd the winners are: - 2x double-free - 8x NULL pointer dereference - 6x general protection - 6x slab-out-of-bounds access - 14x use-after-free access Naturally it was only due to the current shortage of those mythical C developers that never make memory corruption mistakes.
- sanxiyn 6y agoNaturally. Where are they? They should be the ones developing operating systems, not these charlatans.
- nineteen999 6y agoToo busy bragging about their pet language on HN, instead of off proving their point with it.
- iforgotpassword 6y agoThat would be me, unfortunately I don't have time currently to work on the kernel.
- MaxBarraclough 6y agoHypothesis: the more fuzzing tools we develop, the fewer infallible C programmers remain.
- Gravityloss 6y agoI'm reminded of this apocryphal story of a revered machinist from Tampere. The city is on an isthmus between two lakes. Their shop was right next to the rapids between the lakes. They were famous, having never made any mistakes. During some construction event, the city closed off the rapids and no water was flowing there, it was completely dry. There was a massive amount of partially machined objects on the bottom. The machinist had been tossing them out of the window into the water, every time when they made a mistake.
- 6y ago
- drewg123 6y agoThe interesting bit to me is that the FreeBSD bug took 2 weeks of fuzzing to find, but the Mac/Windows bugs were found in one day. USBFuzz found three bugs (two resulting unplanned restart and one resulting system freeze) on MacOS, and two bugs on Windows (resulting in a Blue Screen of Death, confirmed on both Window 8 and Windows 10) during the first day of evaluation. Additionally, one bug was found in a USB Bluetooth dongle driver on FreeBSD in two weeks.
- deleted 6y ago[deleted]
- blablabla123 6y agoFreeBSD is definitely the system that will make it through the apocalypse. A friend once told me he had a damaged RAM module, trying to install Windows, various Linux distributions, nothing worked. But it was possible to install FreeBSD and it just worked...
- asveikau 6y agoStill probably should get that RAM replaced though.
- fouc 6y agoNow I'm wondering how FreeBSD handles damaged RAM differently, and the speed hit it takes for doing so.
- toast0 6y agoTo my knowledge, FreeBSD doesn't have anything specific here, it was probably just luck in where the broken addresses fell and how they were used. These days FreeBSD and Linux both have provisions to avoid addresses you know are bad, if you tell them at boot (and if you don't need those addresses to boot). I'm pretty sure I've read that Solaris has provisions to stop using bad addresses detected at runtime, but it needs ECC or similar to detect the badness.
- 6y ago
- izacus 6y agoI wonder if any USB device actually relies on these bugs being there to operate correctly.
- jeffbee 6y agoHard to imagine a device that relies upon use-after-free defects for its correct functioning.
- VRay 6y agoMe: laughs in firmware engineer
- saagarjha 6y agoNot sure about hardware devices, but I have encountered software that has relied on using freed memory to function as intended.
- not2b 6y agoObligatory xkcd: https://xkcd.com/1172/ https://xkcd.com/1172/
- ken 6y ago"I first heard about this from one of the developers of the hit game SimCity, who told me that there was a critical bug in his application: it used memory right after freeing it, a major no-no that happened to work OK on DOS but would not work under Windows where memory that is freed is likely to be snatched up by another running application right away. The testers on the Windows team were going through various popular applications, testing them to make sure they worked OK, but SimCity kept crashing. They reported this to the Windows developers, who disassembled SimCity, stepped through it in a debugger, found the bug, and added special code that checked if SimCity was running, and if it did, ran the memory allocator in a special mode in which you could still use memory after freeing it." https://www.joelonsoftware.com/2004/06/13/how-microsoft-lost-the-api-war/ https://www.joelonsoftware.com/2004/06/13/how-microsoft-lost...
- hannob 6y agoI think this needs some important context, because otherwise it may be read as "Linux is so insecure compared to the other OSes". From the screenshot it seems all of the bugs were found with KASAN and most of them were overread bugs. Likely for the other OSes they were only looking for crashes and probably often missed these classes of bugs that KASAN can uncover. This essentially means they found more bugs in Linux because Linux has better tools to uncover subtle memory safety bugs.
- frank2 6y agoKASAN is a kernel address sanitizer. Is your claim that the other OSes, as tested, do not do address sanitization?
- johnnyapol 6y agoI think their claim is the researchers can run a Linux install with KASAN and see the results but they are unable to use an equivalent of that on MacOSX, Windows as Apple, Microsoft do not allow an end-user to perform that kind of instrumentation on their own device.
- frank2 6y agoYou and the person I replied to above are essentially correct: >Fuzzing drivers on [FreeBSD, MacOS, and Windows] is more challenging than the Linux kernel due to the lack of support infrastructure. These OSes support neither KASAN, other sanitizers, nor coverage-based collection of executions. The lack of a memory-based sanitizer means our fuzzer only discovers bugs that trigger exceptions, and misses all bugs that silently corrupt memory. Because we cannot collect coverage information, our fuzzer cannot detect seeds that trigger new inputs. (https://nebelwelt.net/files/20SEC3.pdf https://nebelwelt.net/files/20SEC3.pdf) The researchers employed a partial workaround for the problem, but it is pretty obvious to me that the partial workaround does not level the playing field: >To alleviate the second concern, the lack of coverage-guided optimization, we experiment with cross-pollination. To seed our dumb fuzzer, we reuse the inputs generated during our Linux kernel fuzzing campaign.
- jokoon 6y agoPretty sure the NSA has been using similar tools for at least 10 years now.
- Koshkin 6y agohttp://www.usbmadesimple.co.uk/ http://www.usbmadesimple.co.uk/ (tl;dr: USB is anything but simple.)
- peter_d_sherman 6y ago>"At its core, USBFuzz uses a software-emulated USB device to provide random device data to drivers (when they perform IO operations)," the researchers said." The key to sniffing out all of these "bugs" (AKA, "security concerns") is to be able to emulate, emulate, emulate, everything as plug-in modules -- even down to hardware itself. Virtual machine software does this -- but bugs (AKA, "security concerns") have been found in Virtual Machines too, so a "welded together at the seams" Virtual Machine is not the answer -- but rather, a modular, plug-and-play, open interface one is -- where the data moving into and out of interfaces can be monitored, logged, recorded, played back, analyzed, and modified easily to implment a test condition or conditions, as need be. A software emulated USB device -- is a good step towards this vision. It's sort of like if we rebuilt a virtual machine from the ground up, starting with the CPU emulation, and then said, OK, do I want to emulate this piece of hardware in the virtual machine software itself, or do I want to proxy it out, maybe via a serial path, ethernet/socket/ tcp/ip connection, or shared memory proxy to another plug-and-playable (and separately testable) module... I think we need to rethink virtual machines as they exist today. Coding an interface in C for an existing virtual machine and saying that the job is done is not enough; virtual machines must become vastly more modular/proxyable than they are today. The bus of such a machine must become virtual and proxyable as well, such that 3rd party software, modular plug-ins, could observe it in realtime, as should memory, emulated VGA card, etc... any point there's a connection to hardware, real or virtual is a proxy point that must be modular and auditable by 3rd party plug-in programs... THAT's how you write the virtual machines/systems of the future. Which also become the debugging systems of the future... In fact, such a "modular virtual machine" -- could be used by AI driven software to run unit tests, but run them with different combinations of VGA cards, emulated CPU's, emulated BIOS'ses, buses, controller chips, what-have-you... Oh... and there should be a way to interface the VM with actual hardware chips... in other words, I have a hardware chip that is in question... emulate the entire rest of the system, but proxy a physical connection to that chip on a breakout board... etc.
- sitkack 6y agoAnd the underlying hardware should be designed to virtualize its PCIe registers, many accelerators do this, but it should be transparent to both plumb the virtualized register sets into a guest but also interpose those register sets to build a dynamic out of band firewall to same said hardware.
- lloeki 6y ago(Honest, naïve question, I lack awareness of the Linux versioning scheme) Isn't Linux way into 5.x land for quite some time? Is the testing of 4.20-rc2 some kind of proxy to test there were no backports of the very latest mainline? ---- Researchers said they tested USBFuzz on: 9 recent versions of the Linux kernel: v4.14.81, v4.15,v4.16, v4.17, v4.18.19, v4.19, v4.19.1, v4.19.2, and v4.20-rc2 (the latest version at the time of evaluation) FreeBSD 12 (the latest release) MacOS 10.15 Catalina (the latest release) Windows (both version 8 and 10, with most recent security updates installed)
- cmeacham98 6y agoThe linux kernel has several LTS releases for people who want to stay on the same version for stability reasons but also need security updates. I suspect from a security perspective testing whatever the latest 4.19.X version is would be roughly equivalent to 5.X. (Except, perhaps, for any USB-related features introduced in 5.X)
- codys 6y agoSince v3.0, Linux has treated the first _2_ numbers of it's version as something that is incremented sequentially (in the v2.6 era, the _3_rd number was used, prior to v2.6 there was a even/odd stable/unstable split) For example, we have normal releases v4.19 then v4.20 then v5.0 then v5.1. There will never be a v4.21. Stable releases use the third number. v4.14.81 is a stable release of v4.14.0. So the v4.20-rc2 statement just dates the work: $ git show v4.20-rc2 tag v4.20-rc2 Tagger: Linus Torvalds <torvalds@linux-foundation.org> Date: Sun Nov 11 17:12:54 2018 -0600
- gpm 6y agoWoah, so they did this a year and a half ago despite releasing this year (note that the paper has a 2020 reference in it). Weird! I guess responsible disclosure timelines on this sort of work must really suck.
- 0xffff2 6y agoI don't know about computer security, but I've published peer reviewed research papers in other fields and a year and a half from data collection to publication doesn't seem unusual to me. If anything it's pretty fast.
- aspenmayer 6y agoNone of this is directed at OP. Not to be that guy, but I posted this many hours ago.[1] I don't care about the karma, but this is a repost. @dang, can anything be done to help HN not work like this in the future? Why have karma for posts but then allow reposts like this? It disincentivises first posts in favor of gaming the viewers of HN while trying not to get scooped. It sucks. None of this is directed at OP. [1] https://news.ycombinator.com/item?id=23329790 https://news.ycombinator.com/item?id=23329790
- kick 6y agoHe's expressed interest in the past about fixing this; he's not sure how to handle it yet: https://hn.algolia.com/?dateRange=all&page=0&prefix=true&query=by%3Adang%20karma%20shar&sort=byDate&type=comment https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que... That said, two things: You should send a message to hn@ycombinator.com if you have something to say to moderation. They're very responsive, and you'll get a better response rate than posting in random HN threads that might not even be seen. It also breaks the Guidelines: Please don't post on HN to ask or tell us something. Send it to hn@ycombinator.com. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html You also shouldn't take this personally. The poster likely didn't see your post, very likely wasn't 'gaming' anything (they actually have some really interesting articles in their submission history that don't seem to have been posted before, and they're a journalist; it was likely they just read it and posted it), and it wouldn't be practical to 'ban reposts': HN already has a feature that upvotes a previous submission if you post within a given range from it. I know it's not a great feeling to post something that you think is interesting and to see it get to the front page later via someone else (I can point to a bunch of my own posts where this happened), but it getting to the front page at all is something positive. It's not a race, so incentivizing quick-draw on articles from popular outlets (like zdnet, which has millions of readers) above all else probably wouldn't be useful, either.
- aspenmayer 6y agoI don’t care to do that. It’s a problem with basic functionality. There is site behavior which disallows reposts, but only sometimes. The sometimes part is the bug, from my point of view. I honestly don’t care enough to do anything but say it shouldn’t happen when it happens to me, as long as it happens to me. Bug reports should be public for non-security related bugs. This is a bug. This thread is my report. I can be reached on this thread. Edit: I have emailed and asked that replies are in-thread or linked to in this thread. I hope we can get some clarity into whether this is a "won't fix" situation or more of a subjective call on a per-case basis, or something else entirely. I don't want to make waves, just trying to surf.
- pmarreck 6y agoDo Bluetooth next! :)
- ComputerGuru 6y agoThe FreeBSD vuln was in the drivers for a usb Bluetooth dongle, so there is apparently some coverage.
- umvi 6y agoI don't think many people realize how complicated USB is. The USB 2.0 spec is like 700 pages long. The USB 3.0 spec is 500 pages long and the intro paragraph is like "readers are expected to be familiar with the USB 2.0 spec before proceeding". I work in embedded systems and I absolutely despair when we need to fix a USB issue. USB is without a doubt the deepest rabbit hole I ever went down (and I never did find the bottom, because the issue ended up being due to Synopsys's USB core and we didn't have access to the Verilog - and apparently neither did they! They weren't using VCS back in 2016 apparently).
- arminiusreturns 6y agoTell me about it. I thought bluetooth was complicated, until I finally caved and got a wireless headset. Being linux only, I found out that controlling simple things like the led's on the headset required really weird manual commands. I eventually gave up and found a package in yay that did the hard work for me but I was awakened to the weirdness and complexity of the usb spec.
- theamk 6y agoIf you think USB is complicated, try FireWire. So many modes!
- rasz 6y agoUSB has nothing on bluetooth.
- dayjah 6y agoToo soon! I’m currently debugging an issue where a USB 3.2 Gen 2 scientific camera is unable to negotiate a connection with Linux. Under closer inspection it seems the USB 3.2 Gen 2 port on this relatively modern Intel NUC is being identified by the kernel as being USB 2.0. No such issues under Windows; but we’re not deploying that to the field. So I go a bit deeper: the chip is actually a thunderbolt chip (aka USB 4.0), which is able to emulate all of the USB specs. For reasons unknown, the two controller chips on this NUC present as four controller chips; each chip presents as one USB 2 root hub and one 3 root hub. One of the chips is only available via an internal header on the board. All of the externally available USB ports (3x USB 3 ports, 1x USB 2 port, 1x Thunderbolt port) all result in connectivity to the USB 2 root hub. Every fiber in my being wants to work out wtf is happening here; but I’m resisting because fortunately we have a vendor that can replace this NUC with one from 2016 instead of this one from 2018. I did, of course, peek at the spec and experienced the bone-shuddering realization of how complex this whole system is. No wonder Windows BSODd when Gates first demoed USB on stage ...
- AaronFriel 6y agoNo matter what the outcome is, remember: We should keep telling ourselves that it is possible for someone, somewhere unaided by typechecking, memory safety constraints, static analysis, and fuzz testing to write safe C. We haven't found that person yet, but if we stop believing that person exists, then why are we still writing in these languages?
- nineteen999 6y agoI'm just so thankful we have so many people in the LISP, Rust and Haskell communities ready to step up to the plate and replace over 50 years of C/C++ OS development with their grand, impervious and indestructible vision of what a safe, secure OS should be. All they'd have to do is provide us a stable, secure foundation and a hypervisor that can run legacy OS's. Oh, and reimplement/replace the tens of thousands of API's provided by Windows/UNIX/Linux which are in use by millions of programmers everyday. Also they'd need to be able to support all those other secure languages that have been written in C/C++ over the years. I guess they will be able to rewrite those as well in short order on top of their new "secure" foundation. I'm sure it will happen any minute now.
- AaronFriel 6y agoThose folks are actually chomping at the bit to be taken seriously and have been for a very long time! Their proposition is simple: better tools can make us better developers. JavaScript developers have told me on a few occasions that TypeScript is unnecessary, they can just write good JS and they don't need types! And it doesn't even catch every bug, so why bother? I think I'm just tired of being told that while I can't write safe C, it's because I'm not smart enough (which may be true, I guess!), but also that the reason everyone else can't write safe C is because they, too, happen to also be not smart enough: https://news.ycombinator.com/item?id=23289693 https://news.ycombinator.com/item?id=23289693 > I design high-scale database kernels, large code bases, written in modern C++. I can’t remember the last time we had a memory safety issue. It isn’t as though we don’t have plenty of bugs during development, just not those kinds of bugs. Competent idiomatic code simply doesn’t leave much room for those kinds of bugs to occur. If you “constantly struggle with memory safety issues”, you are doing something fundamentally wrong. That’s not something you can blame on the language. > > I am always baffled by the people that supposedly write modern C++ professionally and constantly have memory safety issues. Most serious projects won’t hire you if you aren’t capable of writing memory safe code in your sleep, it is a basic skill.