This Week In Security:Use-After-Free For Dummies, WiFi Cracking, And PHP-FPM

In a brilliant write-up, [Stephen Tong] brings us his “Use-After-Free for Dummies“. It’s a surprising tale of a vulnerability that really shouldn’t exist, and a walkthrough of how to complete a capture the flag challenge. The vulnerable binary is running on a Raspberry Pi, which turns out to be very important. It’s a multithreaded application that uses lock-free data sharing, through pair of integers readable by multiple threads. Those ints are declared using the volatile keyword, which is a useful way to tell a compiler not to optimize too heavily, as this value may get changed by another thread.

On an x86 machine, this approach works flawlessly, as all the out-of-order execution features are guaranteed to be globally transparent. Put another way, even if thread one can speed up execution by modifying shared memory ahead of time, the CPU will keep the shared memory changes in the proper order. When that shared memory is controlling concurrent access, it’s really important that ordering happens the way you expect it. What was a surprise to me is that the ARM platform does not provide that global memory ordering. While the out-of-order execution will be transparent to the thread making changes, other threads and processes may observe those actions out of order. An example may help:

volatile int value;
volatile int ready;

// Thread 1
value = 123; // (1)
ready = 1; // (2)

// Thread 2
while (!ready); // (3)
print(value); // (4)

Continue reading “This Week In Security:Use-After-Free For Dummies, WiFi Cracking, And PHP-FPM”

Valve Reluctantly Shows How To Mod The Steam Deck

As the narrator in this official instructional video from Valve reminds the viewer several times, the gaming company would really rather you not open up your brand new Steam Deck and start poking around. They can’t guarantee that their software will function should you start changing the hardware, and since there’s no source for replacement parts yet anyway, there’s not much you can do in the way of repairs.

That said, Valve does believe you have the right to take apart your own device, and has produced the video below as an aid to those who are willing risk damaging their new system by opening it up. Specifically, the video goes over how to replace the most likely wear items on the handheld, namely the thumb sticks and the SSD. It seems inevitable that the stock thumb sticks will wear down after a couple years of hard use, so we’re glad to see they are easily removable modules. As for the SSD, it stands to reason that users would want to swap it out for faster and higher capacity models as they become available in the coming years.

Sooner or later, these are going to need to be replaced.

Now to be clear, we appreciate Valve making this video, and would love to see other manufacturers be so forthcoming. But we have to admit that some of its messaging does seem a bit heavy handed. The narrators admonition that users who open their Steam Deck are literally taking their lives into their own hands due to the danger of potentially rupturing the system’s lithium-ion battery is a bit hyperbolic for our tastes. The constant reminders of how badly you could bungle the job just comes off as overly preachy, though to be fair, we probably aren’t the intended audience.

Outside of its obvious gaming functions, we’re excited too see what the community can do with the Steam Deck. With official reference material like this, perhaps we’ll even start seeing some hardware modifications before too long. Though we wouldn’t blame you for hitting the Mute button halfway through.

Continue reading “Valve Reluctantly Shows How To Mod The Steam Deck”

Keith Thorne, Engineer At LIGO, To Deliver Remoticon Keynote

It is my pleasure to announce that Keith Thorne has graciously agreed to deliver a keynote take at Hackaday Remoticon 2. Get your ticket now!

Keith is an astrophysicist and has worked on the Laser Interferometer Gravitational-Wave Observatory (LIGO) since 2008, literally looking for ripples in space-time that you know as gravitational waves. The effects of the phenomena are so subtle that detecting an event requires planet-scale sensors in the form of 4 km long interferometers placed in different parts of the United States whose readings can be compared against one another. A laser beam inside these interferometers bounces back and forth 300 times for a total travel distance of 1,200 km in which any interaction with gravitational waves will ever-so-slightly alter how the photons from the beam register.

The challenges of building, operating, and interpreting such a device are manifold. These interferometers are the highest precision devices ever devised, able to detect motion 1/10,000 of the diameter of a proton! To get there, the mirrors need to be cooled to 77 nano-Kelvins. Getting the most out of it is what Keith and the rest of the team specialize in. This has included things like hacking the Linux kernel to achieve a sufficient level of real-time digital control, and using “squeezed light” to improve detection sensitivity in frequencies where quantum mechanics is getting in the way. While the detectors were first run in 2015 & 2016, successfully observing three events, the work to better understand this phenomenon is ongoing and may include a third site in India, and a space-based detector in the future.

In getting to know Keith he mentioned that he is excited to speak to a conference packed with people who want to hear the gory technical details of this fantastic piece of hardware. I’m sure we’re all giddy to learn what he has to say. But if you’re someone who wants to work on a project like this, he tipped us off that there’s an active EE job posting for LIGO right now. Maybe you’ll end up doing the keynote at a future Hackaday conference.

Call for Proposals is Still Open!

We’re still on the hunt for great talks about hardware creation. True creativity is fed by a steady stream of inspiration. Be that inspiration by giving a talk about the kinds of things you’ve been working on!

Linux Fu: Globs Vs Regexp

I once asked a software developer at work how many times we called fork() in our code. I’ll admit, it was a very large project, but I expected the answer to be — at most — two digits. The developer came back and read off some number from a piece of paper that was in the millions. I told them there was no way we had millions of calls to fork() and, of course, we didn’t. The problem was the developer wasn’t clear on the difference between a regular expression and a glob.

Tools like grep use regular expressions to create search patterns. I might write [Hh]ack ?a ?[Dd]ay as a regular expression to match things like “HackaDay” and “Hack a day” and, even, “Hackaday” using a tool like grep, awk, or many programming languages.

Continue reading “Linux Fu: Globs Vs Regexp”

Raspberry Pi Plots World Wide Earthquakes

What do you do when you stumble across a website posting real-time earthquake data? Well, if you’re [Craig Lindley] you write some code to format it nicely onto a display, put it in a box, and watch it whilst making dinner.

[Craig] started off with coding in Forth on the ESP32, using ESP32Forth, but admits it didn’t go so well, ditching the ESP32 for a Raspberry Pi 3 he had lying around, and after a brief detour via C++, he settled on a Python implementation using Pygame.

A case was 3D printed, which he says worked OK, but needs a little tuning to be perfect. There is no shortage of casing options for the Pi with the official 7″ display, [Craig] suggests that it probably wasn’t worth the effort to 3D print the case and if he was building it again would likely use a commercially available option which had a better fit.

When developing the code, and watching it work, he noted clusters of earthquakes around Hawaii, then he found out Kilauea had just gone up. Wow.

For a similar take, check out this other recent build using an ESP32 and the same data source.

A soldering iron applied to a stuck threadlocked screw in a titanium pen

Removing Threadlocked Screws With A Soldering Iron

We’ve all been there – that last stubborn screw, the one thing between you and some real progress on a repair or restoration. It’s stuck tight with thread-locking fluid, and using more torque threatens to strip the head. Frustration mounting, drilling that sucker out is starting to seem pretty tempting. But wait! [Daniel] offers a potential solution using nothing but a soldering iron.

This tool hack is pretty simple, but all the great ones tend to be straightforward. In the video, [Daniel] is faced with a titanium Torx screw that refuses to come loose due to threadlocker, an adhesive that is applied to screws and other fasteners to prevent them coming loose. Available in a variety of strengths, thread-locking fluid is great at keeping screws where they need to be, but too much (or the wrong kind) can seize a screw permanently.

Instead of drilling out the offending screw, [Daniel] reaches for his soldering iron. By applying a significant amount of heat to the screw head, the adhesive starts to give. After heating, working the screw back and forth breaks the threadlocker, thus freeing the screw. The whole process takes just a couple of minutes, and potentially saves the repairer from destroying a screw.

The chemistry behind thermoset adhesives makes for some great bedtime reading, however the main takeaway is that threadlock fluid, while somewhat resistant to heat, will eventually become brittle enough for the screw to come loose. Unlike most adhesives, which melt under high temperature (think glue sticks), thermoset materials tend to initially harden with the application of heat, before turning brittle and breaking. While high-temperature threadlocker derivatives exist, typical Loctite-branded threadlocker (and similar products) would not appear to be able to stand the heat of a typical soldering iron.

This soldering iron hack isn’t the first we’ve featured on Hackaday – check out this method on removing enamel from magnet wire. If you’re not too squeamish, also check out our thoughts on soldering iron cauterization.

Continue reading “Removing Threadlocked Screws With A Soldering Iron”

A 3D-printed mini laser engraver made from DVD-RW drive motors.

Mini Laser Engraver Could Carve Out A Place On Your Desk

Got a couple of old DVD-RW drives lying around, just collecting dust? Of course you do. If not, you likely know where to find a pair so you can build this totally adorable and fully dangerous laser engraver for your desk. Check out the complete build video after the break.

[Smart Tronix] doesn’t just tell you to salvage the stepper motors out of the drives — they show you how it’s done and even take the time to explain in writing what stepper motors are and why you would want to use them in this project, which is a remix of [maggie_shah]’s design over on Thingiverse. As you might expect, the two steppers are wired up to an Arduino Uno through a CNC shield with a pair of A4988 motor drivers. These form the two axes of movement — the 250mW laser is attached to x, and the platform moves back and forth on the y axis. We’d love to have one of these to mess around with. Nothing that fits on that platform would be safe! Just don’t forget the proper laser blocking safety glasses!

Need something much bigger that won’t take up a lot of space? Roll up your sleeves and build a SCARA arm to hold your laser.

Continue reading “Mini Laser Engraver Could Carve Out A Place On Your Desk”