Spectre And Meltdown: How Cache Works

The year so far has been filled with news of Spectre and Meltdown. These exploits take advantage of features like speculative execution, and memory access timing. What they have in common is the fact that all modern processors use cache to access memory faster. We’ve all heard of cache, but what exactly is it, and how does it allow our computers to run faster?

In the simplest terms, cache is a fast memory. Computers have two storage systems: primary storage (RAM) and secondary storage (Hard Disk, SSD). From the processor’s point of view, loading data or instructions from RAM is slow — the CPU has to wait and do nothing for 100 cycles or more while the data is loaded. Loading from disk is even slower; millions of cycles are wasted. Cache is a small amount of very fast memory which is used to hold commonly accessed data and instructions. This means the processor only has to wait for the cache to be loaded once. After that, the data is accessible with no waiting.

A common (though aging) analogy for cache uses books to represent data: If you needed a specific book to look up an important piece of information, you would first check the books on your desk (cache memory). If your book isn’t there, you’d then go to the books on your shelves (RAM). If that search turned up empty, you’d head over to the local library (Hard Drive) and check out the book. Once back home, you would keep the book on your desk for quick reference — not immediately return it to the library shelves. This is how cache reading works.

Continue reading “Spectre And Meltdown: How Cache Works”

Coin Cell Hacks That Won The Coin Cell Challenge

It’s amazing what creative projects show up if you give one simple constraint. In this case, we asked what cool things can be done if powered by one coin cell battery and we had about one hundred answers come back. Today we’re happy to announce the winners of the Coin Cell Challenge.

Continue reading “Coin Cell Hacks That Won The Coin Cell Challenge”

Hackaday Links Column Banner

Hackaday Links: The ‘S’ In ‘CES’ Stands For Snake Oil

Remember IRDA? Before we had Bluetooth and WiFi, the cool kids connected their computers and printers together over fancy Infrared connections. Yes, your computer probably still has the drivers, but the hardware is nowhere to be found. For good reason, too: we now have Bluetooth and WiFi. This year, at CES, IRDA is making a comeback. MyLiFi is a product from OLEDCOMM that puts infrared connectivity in a lamp. All you need to do is plug an Ethernet cable into a desk lamp, a proprietary dongle into your computer, and you too can reap the benefits of a wireless connection with a range measured in meters. One of the selling points of this product is that this gives you wireless Internet ‘without radio waves’, marketing to the idiots who think RF causes cancer or whatever. It’s a stupid product that’s a highlight of the entire trade show.

During this year’s CES, Intel tweeted, “With each person on earth soon to be producing ~1.5 GB of #data each day, it is a resource without limits“. Two criticisms: First, ‘Earth’ should be capitalized. Second, data mined from individuals — which includes personal data and metadata including where you were, and who you talked to — is a resource to be extracted by capitalism. Welcome to the post-privacy society, brought to you by #CES2018.

Oh, crap, we’re getting into cryptocurrency…

Kodak has announced their own blockchain. Is Kodak going to the moon? Yes, but hold on: this might be a good idea. Kodak wants to use a blockchain for ‘image rights management’, where photographers can register, archive, and license their work. It’s a blockchain, and also a solution to a problem: something you don’t see much of these days. Shares of KODK shot up from $3.15 on Monday to somewhere north of $10 this week. Is it a good idea? Who knows, but someone put the word ‘blockchain’ in a press release and made a buttload of cash.

The guy behind the Maker Movement wants to create a blockchain platform for Makers. Who’s this guy behind the Maker Movement? Mark Hatch, former CEO of TechShop and someone who is purportedly on the board of Maker Media (Oh, that’s how Make got the scoop on the TechShop closure -ED). He’s creating a Blockchain for Makers. This blockchain will take two forms. The first is to allow ‘easy confirmation of skills’? Is little Bobby certified to use the table saw? Check the Blockchain. The second barb in our paw is a ‘currency token’ that provides an easy way to pay for related goods or services. There’s no mention if these services are makerspace dues, or some sort of payment system where creators can collect money from people who really really want Raspberry Pis stuffed into 3D printed Nintendos.

In drone news, I am reporting there are no fixed-wing drones on display at CES. Last year, Underwater ROVs outnumbered autonomous fixed-wing aircraft, and this year the scales tipped even further towards submersibles. The laws of physics don’t change for 1/10th scale aircraft, and fixed-wing drones will be more efficient than their multicopter counterparts at nearly every task.

We all know (or should) that safes in Las Vegas hotel rooms aren’t secure. CES 2018 has finally innovated on the hotel safe and come up with something you really don’t want to put your money, wallet, or passport in. It’s an Internet of Things safe. What are the features? Well, it’s small and lightweight and provides little in the way to mount anything. That’s great if you just want to steal the entire safe. But what about breaking into the safe? Don’t worry, the entire thing is made out of plastic. A quick whack to the top of the safe will open it right up.

Bradley Gawthrop: What You Need To Know About Wiring

Wiring — as in plugging wires together and crimping connectors, not the Arduino IDE thingy — is an incredibly deep subject. We all know the lineman’s splice is the best way to solder two wires together, and NASA’s guide to cables and connectors is required reading around these parts. However, there’s a lot that can be said about connectors and cabling, and one of the best people to explain it all is Bradley Gawthrop. He spent the last ten years building pipe organs, and with that comes tens of thousands of relays, solenoids, switches, and valves. All of these parts are connected by thousands of miles of wire, and are arguably as complex as an old-school telephone exchange. If there’s someone you need to talk to about connecting hundreds of thousands of parts together, Bradley is your guy.

Bradley starts his Hackaday Superconference talk with a discussion of the modern prototyping process. We’re pretty far away from dozens of chips sitting around a breadboard with data and address lines these days, and now any sort of prototype is basically a development board with a constellation of modules studded around the perimeter. The best solution for connectors is right angle headers, not only for the reason that the wires stay flat, but also because right angle connectors allow you to probe each and every wire coming out of a board.

Of course, when it comes to wiring, it’s helpful to talk about the wire itself. Instead of having an entire warehouse of wire in every color, gauge, and insulation material hanging above his workshop, Bradley only needs a few options. Right now, he’s only dealing with three gauges of wire — small, medium, and large, or 24, 18, and 12 AWG. That’s one wire for small signals, one wire for a bit of current, and one wire for supply amounts of current. Not only does this cut down on workshop inventory, it also means Bradley only needs three sizes of crimpers and connectors. When it comes to strand count, solid core wire is highly underrated. Not only is it easier to strip and crimp, it can also support its own weight. That’s important, because it means connectors don’t have to bear the weight of the entire cable run.

If you’re looking for the minimal required toolset for running cables and crimping connectors, Bradley has a great little shopping list on his website. The best strippers he’s ever found come from Wiha, but they’ve been EOL’d by the manufacturer. Knipex makes some good strippers, though. You don’t need to spend big money on ferrule crimpers, and some cheapies from BangGood are good enough. Bradley has standardized on Molex SL and Molex KK interconnects, and wire can be sourced easily if you have Amazon Prime.

While the subject matter for Bradley’s talk sounds easy to overlook, connecting parts together in an assembly is a critical skill in itself. We’re glad Bradley could share his experience with us at the Hackaday Superconference.

Dust Off Those AM Radios, There’s Something Good On!

If you are into vintage electronics or restoring antique radio equipment you may be very disappointed with the content offerings on AM broadcast radio these days. Fortunately there is a way to get around this: build your own short-range AM broadcast station and transmit curated content to your radios (and possibly your neighbors). There are several options for creating your own short-range AM broadcast station, and this gives you something fun to tune into with your vintage radio gear.

Continue reading “Dust Off Those AM Radios, There’s Something Good On!”

Fail Of The Week: Engine Flips Out

A few weeks ago an incredible video of an engine exploding started making the rounds on Facebook. This particular engine was thankfully in a dyno room, rather than sitting a couple of feet away from a driver on a track. We’ve all seen engine carnage videos before, but this one stands out. This diesel engine literally rips itself apart, with the top half of the engine flipping and landing on one side of the room while the bottom half sits still spinning on the dyno frame.

Building performance engines is part science, part engineering, and part hacking. While F1 racing teams have millions of dollars of test and measurement equipment at their disposal, smaller shops have to operate on a much lower budget. In this case, the company makes their modifications, then tests things out in the dyno room. Usually, the tests work out fine. Sometimes though, things end spectacularly, as you can see with this diesel engine.

The engine in question belongs to Firepunk diesel, a racing team. It started life as a 6.7 liter Cummins diesel: the same engine you can find in Dodge Ram pickup trucks. This little engine wasn’t content to chug around town, though. The Firepunk team builds performance engines — drag racing and tractor pulling performance in this case. Little more than the engine block itself was original on this engine. Let’s take a deeper look.

Continue reading “Fail Of The Week: Engine Flips Out”

Spectre And Meltdown: Attackers Always Have The Advantage

While the whole industry is scrambling on Spectre, Meltdown focused most of the spotlight on Intel and there is no shortage of outrage in Internet comments. Like many great discoveries, this one is obvious with the power of hindsight. So much so that the spectrum of reactions have spanned an extreme range. From “It’s so obvious, Intel engineers must be idiots” to “It’s so obvious, Intel engineers must have known! They kept it from us in a conspiracy with the NSA!”

We won’t try to sway those who choose to believe in a conspiracy that’s simultaneously secret and obvious to everyone. However, as evidence of non-obviousness, some very smart people got remarkably close to the Meltdown effect last summer, without getting it all the way. [Trammel Hudson] did some digging and found a paper from the early 1990s (PDF) that warns of the dangers of fetching info into the cache that might cross priviledge boundaries, but it wasn’t weaponized until recently. In short, these are old vulnerabilities, but exploiting them was hard enough that it took twenty years to do it.

Building a new CPU is the work of a large team over several years. But they weren’t all working on the same thing for all that time. Any single feature would have been the work of a small team of engineers over a period of months. During development they fixed many problems we’ll never see. But at the end of the day, they are only human. They can be 99.9% perfect and that won’t be good enough, because once hardware is released into the world: it is open season on that 0.1% the team missed.

The odds are stacked in the attacker’s favor. The team on defense has a handful of people working a few months to protect against all known and yet-to-be discovered attacks. It is a tough match against the attackers coming afterwards: there are a lot more of them, they’re continually refining the state of the art, they have twenty years to work on a problem if they need to, and they only need to find a single flaw to win. In that light, exploits like Spectre and Meltdown will probably always be with us.

Let’s look at some factors that paved the way to Intel’s current embarrassing situation.

Continue reading “Spectre And Meltdown: Attackers Always Have The Advantage”