5 ms·
Wonder how much of these bugs remain hidden away in the modern kernels. USB and Thunderbolt (which is also carrying PCIe in some modes) and for what it's worth
by mschuster91 9y ago
Wonder how much of these bugs remain hidden away in the modern kernels. USB and Thunderbolt (which is also carrying PCIe in some modes) and for what it's worth USB-C which can ALSO carry PCIe, in addition to DisplayPort, HDMI and whatnotelse have grown enormously complex.
To make matters worse, I guess there are ways for the USB slave device to fingerprint the OS (or: hardware!) running on the host... something like a "pwn me" USB stick working on all three major platforms (OS X, Linux, Windows) or game consoles is certainly possible. And I can perfectly imagine that there are ways to exploit the actual USB controller hardware, which gives unfettered memory access.
- majidazimi 9y agoConsidering scientific statistics, which says there are 0.5 to 25 bugs per KLoC in delivered software, we are really lucky that stuff still work... :D
- red75prime 9y agoCorner cases. Relatively rare until exploited.
- AceJohnny2 9y agoI use the following metaphor: software is like a narrow path high up on the arete of a mountain, with thousand-foot drops on either side. Your goal is to walk down that path. If everything goes well (all the input is as expected), you'll walk the path straight and reach your goal. Bad software (most of it, honestly) has no guardrails: do something wrong, take one step to the side, and you fall crashing off the narrow path. Robust software has guardrails, handles all the error conditions, to make sure you stay on the path (or at least return to the start). Most software is tested against expected input. It's already a lot of work to get things working for the expected case, it's usually enough to stop there. Make the path, expect smart hikers, omit guardrails. This is why stuff still works: most of the time, things go as expected. It is a huge investment to test against all error conditions. I only know of the Space Shuttle that had the robustness requirements to shoulder the cost of implementing that. As I recall, their conventional productivity metrics were abysmal (<1 LoC/day/engineer?), but it was robust. I've worked on High-Availability equipment. The software quality wasn't better than elsewhere, but the recovery mechanisms were much better. For example, all mission-critical data was mirrored to redundant HW/SW, and there was a standby system ready to pick up whenever the active copy crashed... which wasn't too often, but it happened. This is similar to Netflix' "Chaos Monkey" approach to software design.
- kurtisc 9y agoAssuming 0.5 rounds down, that seems like an essentially useless statistic. If you deliver a randomised binary that just doesn't run, does that count as more than one bug?
- colejohnson66 9y ago0.5 rounds up though...
- api 9y agoI swear over-engineering is the cancer of all modern software and systems. It's become my #1 complaint about almost all modern software and systems.
- jacquesm 9y agoWelcome to the club. The problem is that nobody really cares, which makes it super hard to do something about it. In fact, there are plenty of people riding the over-engineering gravy train, which means there are substantial forces to keep things as they are or make them even worse. I don't remember the last job where I was hired where my major contribution was to add something, usually I'm just removing cruft and simplifying things and that's what makes things work again.
- funkymike 9y agoA good day is when I delete more code than I add.
- colejohnson66 9y agoBut then your LoC is negative, and you’re not being productive! /s
- garblegarble 9y agoThat's why I don't delete code, I just comment it out with line comments, and add a note before each line describing why it was removed. I'm so productive! /s :)
- deckard1 9y agoyou joke, but I get the sneaking suspicion that many of my co-workers don't squash commits simply because they are gaming github metrics. Didn't help that my company went as far as saying they used # commits as a guide for annual reviews.
- orclev 9y ago
- derefr 9y ago> USB and Thunderbolt (which is also carrying PCIe in some modes) and for what it's worth USB-C which can ALSO carry PCIe, in addition to DisplayPort, HDMI and whatnotelse have grown enormously complex. Well, sure, the hardware standards required to achieve this are complex. But looked at from another angle, the software required to handle this is simpler than before. Before, a kernel had to have, effectively, fifteen drivers for the various IO controller-hub chips in the system, and then fifteen matching subsystems to manage their respective protocol stacks (i.e. physical, link, and [for several of the standards] network layers in the OSI model.) With consolidation, now you have maybe half as many drivers for controller-hubs (because both USB-C and Thunderbolt are managed by the same hub, etc.) and far fewer stacks, because there's only one stack per common protocol standard. Every port being "unified into" a {USB, PCIe, DisplayPort, HDMI, ...} port means that now, that set of protocols—taken together—are now where a lot of the eyes in kernel development end up. So each of these protocol stacks is being picked over far more thoroughly than before. It's the same thing that happened when USB obsoleted all the previously-proprietary standards for OSI layers 1 and 2 over serial or parallel ports: suddenly, instead of 1500 individual implementations of those layers [either as proprietary drivers from the manufacturer, or as reverse-engineered parts of Linux] you had one, much-more-well-done OSI layer-1/2 driver for USB. There were still 1500 drivers, for whatever those devices did on top of OSI1+2 (though that number gradually decreased as common HAL driver standards for things like HID peripherals emerged), but those drivers now each had much less code and therefore much less attack surface. (And, as well, a lot of those drivers no longer "did" anything much at the hardware level, instead just packing and unpacking packets from the bus into data for a system service to hold onto, and therefore these drivers could now be more heavily sandboxed by the OS. This is ~half of why Windows XP crashed less than Windows 9x: a USB device-driver crash was, almost always, a non-fatal event.)
- kevhito 9y agoI'm really not sure this is right, it just doesn't ring true to me. Yes, in the bad old days, we had dozens or hundreds of different drivers for specific network cards, serial cards, parallel port chips, audio cards, floppy controllers, disk drivers, etc., plus the tangled mess of scsi and ata/sata/pata storage stacks, tcp/ip/tokenring/ethernet/netbios/smb/appletalk network stacks, tty/vtty/serial terminals, and so on. Bugs in the higher-level stacks, like sata, would be impact very broadly. But a bug in one specific network card driver would, generally, only affect the subset of people who actually had that specific network card. And many of those old drivers were not really all that complicated, because they were specific and narrowly tailored. Buggy as anything too, of course, and didn't get much scrutiny due to the huge variation in software. Now everything is subsumed under a massive IO controller-hub chip driver. At least the last time I checked, all those tangled upper-level stacks are still there, but they are just entwined with a hugely complex mess of usb/thunderbolt/usb-c mess. So you'd still have all the complexity of a sata stack, but that's nested on top of a scsi stack, sitting on a PCI stack, all nested inside a USB-C stack.
- walrus01 9y agoThunderbolt is used as an attack vector by some NSA APT/rootkit: https://www.wired.com/2017/03/wikileaks-shows-cia-can-hack-macs-hidden-code/ https://www.wired.com/2017/03/wikileaks-shows-cia-can-hack-m... https://securinghardware.com/articles/SLOTSCREAMER/ https://securinghardware.com/articles/SLOTSCREAMER/ also duplicated by others, back in 2015: https://www.extremetech.com/mobile/197005-new-apple-malware-is-undetectable-unstoppable-and-can-infect-any-thunderbolt-equipped-device https://www.extremetech.com/mobile/197005-new-apple-malware-...
- mshook 9y agoFingerprinting has been done: https://cise.ufl.edu/~butler/pubs/sadfe11.pdf https://cise.ufl.edu/~butler/pubs/sadfe11.pdf And given you can easily reprogram thumb drives and such, it's easy to do evil stuff with them. You can plug a thumb drive with a reprogrammed firmware which will detect the OS based on IO patterns and then it can tell the OS it's also a keyboard and runs command for you. https://srlabs.de/bites/usb-peripherals-turn/ https://srlabs.de/bites/usb-peripherals-turn/ https://srlabs.de/wp-content/uploads/2014/11/SRLabs-BadUSB-Pacsec-v2.pdf https://srlabs.de/wp-content/uploads/2014/11/SRLabs-BadUSB-P... https://github.com/brandonlw/Psychson https://github.com/brandonlw/Psychson https://www.computerworld.com/article/2690790/tools-for-creating-malicious-usb-thumb-drives-released.html https://www.computerworld.com/article/2690790/tools-for-crea... From the article: "During their Derbycon demonstration, which is available on YouTube, the two researchers replicated the emulated keyboard attack, but also showed how to create a hidden partition on thumb drives to defeat forensic tools and how to bypass the password for protected partitions on some USB drives that provide such a feature."
- mschuster91 9y agoWow, the situation is even worse than I imagined - I thought fingerprinting was theoretical, not that there are actual practical examples in the wild. Jeez.