HNHacker News
TopNewBestAskShowJobs

qhwudbebd

466 karma · joined February 24, 2017

submissionscomments
qhwudbebd··on Linux TCP So_reuseport: Usage and Implementation
Indeed. SO_REUSEPORT_LB is the FreeBSD equivalent of SO_REUSEPORT on Linux. SO_REUSEPORT on FreeBSD means something different, as you say. If SO_REUSEPORT_LB exists, we're on FreeBSD and want to use it! :)
qhwudbebd··on Linux TCP So_reuseport: Usage and Implementation
Confusingly, on FreeBSD this option is SO_REUSEPORT_LB; SO_REUSEPORT is something different. So I find myself writing

    #if defined SO_REUSEPORT_LB
      setsockopt(fd, SOL_SOCKET, SO_REUSEPORT_LB, &(int) { 1 }, sizeof(int));
    #elif defined SO_REUSEPORT
      setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &(int) { 1 }, sizeof(int));
    #else
      [do something to avoid reusing sockets]
    #endif
 
when I want to use this feature.
qhwudbebd··on No Nat November: My Month Without IPv4
The nat64/clat situation on Linux is not brilliant at the moment. There are userspace implementations like Tayga and Tundra. These incur kernel-userspace-kernel transition for each packet so are pretty inefficient and struggle unnecessarily on low-end hardware.

Then there are out-of-tree modules of varying quality, none of those I've looked at being amazingly inspiring code-wise. As out-of-tree modules, they'd need to be rebuilt whenever you rebuild your kernel, but would inconveniently not be built as part of that kernel unless you patch them in.

I'd not seen the eBPF implementation before. That's quite a nice idea. Quite tempted to have a hack at that to fix the minor issues the author identifies.

(What's the story with building eBPF programs nowadays? Are there all kinds of crazy dependencies, or is the situation better than it used to be?)

qhwudbebd··on Ntfs2btrfs does in-place conversion of NTFS filesystem to the open-source Btrfs
One of the choices you've made that I really like is sharing the kernel and userspace filesystem code so directly in the form of libbcachefs. I get the impression this means the kernel can do practically everything userspace can, and vice versa. (I think the only exception is initialising devices by writing a superblock, although the kernel can take over the initialisation of the rest of the filesystem from that point onwards? And maybe turning passphrases into keys for encrypted-fs support which does an scrypt thing?)

As well as giving you really powerful userspace tools for manipulating filesystems, this also suggests that a stripped down busybox module for bcachefs could consist of superblock writing and pretty much nothing else? Maybe a few ioctls to trigger various operations. "Just leave it all to the kernel."

qhwudbebd··on Official Raspberry Pi NVMe SSD Review
Do these give you decent performance DMA-able gpio and spi like you get even on a cheap rpi4? (I'm not claiming they don't/can't, just that it isn't immediately obvious to me that they would.)

For example, spi is an easy hack to bit sample a digital level and stream the results into memory for later processing. You can effortless do this at 20MHz+ plus on an rpi4. When you want to stream multiple digital levels simultaneously (in sync), DMA on gpio is a nice generalisation. (Could perhaps abuse I2S inputs too, which might be present on a more generic x86 board?)

I always wonder about a nice PCIe board supporting good DMAable gpio/spi/i2c/etc on standard x86 machines. I'd probably pay a fair amount of money for a quality one. But it's a product I've never seen on the market. Bodging a USB gpio interfaces with one of the relatively low spec chipsets seem like a pale, inefficient and high-latency imitation.

Actually, given the RP1, maybe the rpi5 has slow/non-DMA gpio too? I haven't been able to check it out yet as these boards still don't have mainlined linux support and I'm not up for buying toys that don't. (Am I imagining it, or did they used to be a lot better at mainlining support for their boards promptly?)

qhwudbebd··on Exploring Typst, a new typesetting system similar to LaTeX
Agreed it could be improved fairly easily at this early stage, and even documenting 'standard recipes' would help. But I do think as a default, prefacing with a fixed string with fixed capitalisation is probably the wrong choice vs earlier systems which simply insert the reference number/letter itself and allow the user to word things correctly around that. Trying to make it do the right thing in context in a way that generalises across multiple languages is unnecessarily hard.
qhwudbebd··on Exploring Typst, a new typesetting system similar to LaTeX
I played with this briefly, and saw that supplement can also take a function, which presumable how you make @wibble return '(34)' instead of 'Equation 34'? The function is passed the equation itself, so supplement: x => x makes the reference identical to the whole equation (!), but it wasn't obvious to me how to extract just the equation number from an equation x?

This is a really common idiom in mathematical writing: "from (1) we see that..." instead of "from Equation 1 we see that". (Randomly capitalising 'Equation' here is another controversial implication of using a fixed word string as a supplement.)

qhwudbebd··on USB-C PD for an industrial Cisco IR829 router
When you talk about an adaptor with 2m of cable, I guess that's really what I'm buying here? There's a USB C plug at one end and a male barrel connector at the other.

Adding another pair of USB C female + USB C male somewhere along the combined cable length would be worse, I think? Especially in the 'dongle' configuration where all that mess hangs right next to one or other end of the cable: hard to hide and the extra bulk makes it easier to unintentionally pull the plug out.

qhwudbebd··on USB-C PD for an industrial Cisco IR829 router
Much less interesting and DIY, but I discovered cheap USB-C PD to barrel connector cables exist for a variety of different diameters and voltages not so long ago, and they've been great. So convenient to ditch a bunch of wall-warts and plug into a single multi-port GaN charger that can sit on a desk at the end of a normal mains cable.
qhwudbebd··on A terrible way to jump into colocating your own stuff
Serial console + reset line control for the win here, if you want easy to diy. I guess there are lots of arm32/arm64 embedded boards that run openbsd you might repurpose and be able to mount inside a machine and which will have near zero power footprint compared to the hardware itself?

I've often wondered about actually replacing the kernel and userspace on the vendor BMCs themselves, to substitute something more competent, but I've not found anyone who's successfully done it.

qhwudbebd··on A terrible way to jump into colocating your own stuff
My version of this is to use a serial console server for direct access, rather than vga + keyboard. If the kernel is still running fine but network access is down, I have a getty running on the serial port. If the kernel has locked up too, I hit the reset button by sending a 500ms+ serial break (special circuit, highly recommended) and the bios has serial redirect, so I can do stuff like hit del to drop into bios setup or uefi shell at that point.

But I expect you're probably right some or all of the providers we use do have something like that, as I speculated in the previous post. I've just never understood the point of vga-type stuff when bios/uefi serial redirect exists and serial console is more convenient anyway once the kernel has started, so never asked the question.

qhwudbebd··on A terrible way to jump into colocating your own stuff
That's definitely a level of remote-hands intervention I've not had from the handful of places I have racks of colo kit. You're right, it might be something some of them do for other customers though; I've never really asked. They'll certainly push a reset button, swap a drive or rack a server that's shipped to them. (Though hardware's reliable enough nowadays and I have go to data centres so rarely that it's a bit of a fun novelty, and I like doing it myself.)
qhwudbebd··on A terrible way to jump into colocating your own stuff
Having run hosting companies from the mid 90s as well, from memory this kind of thing was pretty normal, even in allegedly secure places like London Telehouse.

Quite a few of us in that era were juggling it with being students, so it wouldn't surprise me if the security staff were used to it and expected you to look young enough to be their kid!

qhwudbebd··on A terrible way to jump into colocating your own stuff
I'm pretty suspicious of trusting the firmware on things like that either, to be honest. (Personally, I tend to use serial cables and a little custom board to turn serial breaks into resets, but I know my NIH instinct is probably a little on the high side. It would be unreasonable for me to suggest someone new to colo start making random extra boards to stick inside their machines!)
qhwudbebd··on A terrible way to jump into colocating your own stuff
Ipmi is a bit of a double-edged sword. Network-connected access to a serial console (including uefi/bios console redirection) and the reset button can be a total lifesaver, I agree. I wouldn't want to be without a serial console and remote reset button either.

But ipmi cards are little network-attached linux boxes which run prehistoric kernels and userspace, exposing as many services as the half-wits who put together the firmware image can shovel in, and are rarely if ever patched by the vendor unless there's some really public scandal.

The standard thing to do is to isolate them on some kind of private management network in an attempt to shield the wider internet from the full majesty of the firmware engineers' dazzling skills, but that might be harder to do in the simple 'beginner' scenario Rachel describes.

One good simple version when you get up to two servers instead of just one is to cross-connect so each machine has ipmi access to the other, but neither ipmi service is exposed to the wider world.

qhwudbebd··on Critical Exploit in MediaTek Wi-Fi Chipsets: Zero-Click Vulnerability
Yes, I'm assuming that's exactly why OpenWrt is mentioned but it's very misleading.

The OpenWrt folks generally have good enough taste not to ship any drivers or userspace junk from vendor SDKs, though they do have a fair-sized set of backport patches on top of the (somewhat elderly) mainline kernels they do ship.

I'm running up-to-date mainline on my routers, not OpenWrt kernels. The mt76 support in 6.11 (and previously in 6.9 and 6.10) is complete enough that I don't need to carry any patches at all over what's in Linus' tree.

qhwudbebd··on Critical Exploit in MediaTek Wi-Fi Chipsets: Zero-Click Vulnerability
Sorry, yes, my use of 'vendor' here was ambiguous. I meant Mediatek, the chipset vendor.
qhwudbebd··on Dissecting the gzip format (2011)
Ooh interesting. I'd assumed (incorrectly) that OpenBSD tar was just libarchive like FreeBSD and NetBSD. I prefer BSD libarchive tar to GNU tar as /bin/tar on my Linux machines too for what it's worth.
qhwudbebd··on Critical Exploit in MediaTek Wi-Fi Chipsets: Zero-Click Vulnerability
The wording of the headline is a bit misleading here. I followed the link thinking it might be a firmware or silicon bug as I have a couple of routers at home with mt76 wifi, but was relieved to find it's just a bug in the vendor's 'sdk' shovelware. I'm baffled that anyone even thought about using that, given there's such good mt76 support from mainline kernels with hostapd.
qhwudbebd··on Dissecting the gzip format (2011)
I agree about the practical utility of bzip2. It's quite an interesting historical artefact, though, as it's the only one of these compression schemes that isn't dictionary-based. The Burrows-Wheeler transform is great fun to play with.
qhwudbebd··on Dissecting the gzip format (2011)
Both libarchive ("bsdtar") and GNU tar have -a, which I guess are the only two upstream tar implementations that are still relevant? You're right, it can take a while for these things to propagate downstream though.
qhwudbebd··on Defend against vampires with 10 gbps network encryption
I'm interested in their last step, in which they set

  vm.dirty_ratio = 40
  vm.dirty_background_ratio = 10
  vm.swappiness=10

  governor=performance
  energy_perf_bias=performance
  min_perf_pct=100
to raise a surprisingly low performance ceiling.

I can't believe they were under any memory pressure, so the first three presumably made no difference, but it's also quite surprising to me that the default ondemand cpu governor was responsible for such a dramatic performance hit. Not throttling up quickly enough leading to higher latency maybe? Very interesting anyway.

qhwudbebd··on OpenSSH Keystroke Obfuscation Bypass
This was present in versions 9.5 - 9.7 of OpenSSH and fixed in 9.8p1 released at the beginning of July. Philippos (along with others) is credited for reporting it in the release notes:

  https://www.openssh.com/releasenotes.html#9.8p1
qhwudbebd··on Asking the wrong questions (2017)
"He wants a glider. Not a problem. There are quite good hang gliders."

Off-topic I know, but 100% this. Modern hang-gliders are amazing: easy to learn, unbelievable glide performance and handling, cheap to buy and learn. The 'whoosh' of energy retention as you pull in and push out has to be felt to be believed.

The same goes for paragliders: their speed and glide makes a mockery of my intuition as a ex-physicist and they fit in a rucksack. I'm a rubbish pilot and I've still managed to fly over a hundred kilometres on a paraglider.

qhwudbebd··on IPMI
If you're up for DIY, it's easy to turn a sufficiently long serial break into a toggle on a reset line and/or power button with a couple of discrete components.

A serial break is the only situation in which an RS232 line is driven +ve with greater than 90% duty cycle: charge a cap slowly on +ve, discharge quickly on -ve (diode), drive a mosfet gate to pull reset line low only when it's been +ve for quarter of a second or so.

Easily the hardest part of doing this is finding a 'clean' way to get a wire attached to the serial RX and GND pins from the inside the case rather than bodging something really ugly. Some boards have a front-facing serial port, though, which has a pin header and cable => easy to tap into.

I'd soldered onto the little legs on a stand off board DB9 port on one batch of machines I installed, and then ended up being thwarted on the next batch of boards which had a slightly different (more enclosed) style of DB9 port that made it much harder to get at the pins.

Whatever you do along these lines will be infinitely better than the insecure, overengineered catastrophe of vendor IPMI/BMC firmware. I wish someone less lazy than me would make a product along these lines... ;-)

qhwudbebd··on Reverse-Engineering an IP Camera (2019)
I'm really interested to hear more about your work too! I've had a few situations where IP cameras would have been ideal, but I dropped the idea after examining a handful because the firmware is invariably too awful to contemplate running.

Reading your later replies, I gathered you took a standard camera but wrote clean new firmware for it. Is the SoC on these devices supported by mainline tf-a, u-boot and kernels, or are you stuck on ancient manufacturer ('BSP') kernel forks and so on? What does the userspace you've put together look like?

qhwudbebd··on Pull Requests via Git Push
Ah interesting. I use git-format-patch instead of git-send-email myself, so I can re-read the resulting mbox before sending it. I always thought of git-send-email as a wrapper that just passed most options straight through to format-patch, but sounds like it does something more with --from.

I haven't read builtin/log.c (edit: and pretty.c) to check how risky the From: field actually is. It might be that it is guaranteed to be properly/safely quoted by git - but it might not be too! When I embedded a " in the author name by hand, the From: line was correctly quoted as

  From: "first\"last" <email@email>
but that's no guarantee that it's done for every malicious author/committer without inspecting the code.
qhwudbebd··on Pull Requests via Git Push
Nice! A couple of thoughts re. your "It's not perfect" which wouldn't add real extra complexity:

Using --from with git-format-patch will add the From: header to the commit message body in the standard way when emailing a patch written by someone else, which would allow you to preserve this easily without risking excitement from injection attacks into email headers.

Maybe the right behaviour for all-zero $oldsha is to quietly turn format-patch $oldsha..$newsha into format-patch --root $newsha?

qhwudbebd··on Fly.io deleted all my apps without notifying me
Whilst this is true in theory, the experience of being a data centre customer, taking transit from one or two providers and peering with a handful of others is very different to being a user of a bulk cloud infrastructure provider.

I think the difference is automation, or rather lack of it. You build personal relationships with real people. Senior network engineers at the supplier don't consider it beneath them to ring up similarly competent people at the customer and chat directly.

In the past I've hosted kit on a larger scale for my businesses, but it seems you get the same personal experience as a tiny individual customer. Even with just a couple of racks of kit of for hobby projects and friends' stuff, I know the network engineers at the DC and transit providers and can email or call direct to discuss things when I need to.

More importantly, if (for example) one of my friends starts gobbling 10Gbps of $$$ transit because of a typo in a script, they ring my mobile to chuckle about it while we fix in realtime, rather than some automated process pulling the plug with the real engineers hiding behind support tickets and first-line support staff that can't string a sentence together.

qhwudbebd··on No more boot loader: Please use the kernel instead
A slight tangent, but still kind of relevant: given that we're lumbered with UEFI on x86-64, are there any active projects working on a better UEFI shell?

Every time I interact with it, I am struck by how awful it is, but the shell is just an EFI application so presumably one could replace it with something better written. Searching turns up EFI menus aplenty, but no one has (yet) taken a shot at a simpler, cleaner EFI shell from what I can see?

← PreviousPage 2 of 6Next →