HNHacker News
TopNewBestAskShowJobs

dezgeg

2,900 karma · joined August 7, 2013

[ my public key: https://keybase.io/dezgeg; my proof: https://keybase.io/dezgeg/sigs/T97m4HN4fIeKVsJzfbIsXEgnHunf6ut9z2hZbtMU3BM ]
submissionscomments
dezgeg··on TV Backlight Compensation
The correction is not uniform, he passes the blob image to the shader as a texture.
dezgeg··on Let's Destroy C
By that same logic, puts("Hello, world!"); is also vulnerable to DoS attack and information leak since someone could have removed the NUL terminator at the end of the string and have puts() read uninitialized/unmapped memory. Which is absurd logic.
dezgeg··on How to Corrupt a SQLite Database File
File descriptors are held in type int in most APIs, which is only 32 bits wide even in 64-bit systems.
dezgeg··on Banned C standard library functions in Git source code
Yes, strncpy() not NUL-terminating it's output is nasty and well-known. But the comment I was responding to was claiming strlcpy() being unsafe.
dezgeg··on Banned C standard library functions in Git source code
If your buffer isn't a NUL-terminated, then don't call a function that is only defined for NUL-terminated buffers. It's as simple as that.

I'm baffled by how some people claim strlcpy() is 'broken' or 'not safe' because it doesn't handle non-NUL-terminated inputs; the exact same thing applies to just about any function in the C standard library that takes strings as input. Are functions like strchr(), fopen(), printf(), strstr(), setenv() 'broken' as well?

dezgeg··on 'Super Mario Bros.' speedrunner hits nearly inhuman 4:55 world record
I would have previously thought so too, but recently there was a cheating incident in the GTA speedrunning where already a top runner started cheating: https://old.reddit.com/r/speedrun/comments/98utvr/grand_thef.... So for a year there was apparent progression to be seen in the streams, but it was all/most due to modifying the game files to gain advantage.
dezgeg··on x86 finds its way into the iPhone
The PIC18 instruction set has this property. Most instructions take up a single 16-bit instruction word, but the few ones that take up 2 words all have the 0b1111 in the high bits of the second word, which would execute as a NOP if branched into.

This encoding is presumably a consequence of the instruction set containing conditional skip instructions. That is, the skip instructions don't have to parse the instruction stream for 2-word instructions but can always just skip a single instruction word and let the second word execute as a NOP.

dezgeg··on An EPYC NixOS Build Farm
The internals of the test framework are pretty heavily tied to Nix and NixOS, so a release independent of Nix(OS) isn't probably going to happen. With that said, the test infrastructure itself is exposed as library functions that any Nix user can use. And even though the test VMs itself will run NixOS, the host machine can be any Linux distro with Nix installed.
dezgeg··on A plea for stability in the SciPy ecosystem
It might compile, but with modern compilers doing increasingly aggressive optimizations (especially on undefined behaviour), it becomes more of a gamble whether the old source with a modern compiler produces the same results as the old code with an old compiler.
dezgeg··on Why I Quit Google to Work for Myself
Do you think this sort of feeling is unique to Google and just not any large-ish company?
dezgeg··on Apple's Failure to Check Kill Syscall Privilege “Not a Security Issue”
Besides a vulnerability, this bug is in fact a regression compared to previous macOS versions. In an API described by POSIX, no less.
dezgeg··on Apple's Failure to Check Kill Syscall Privilege “Not a Security Issue”
To be clear, this bug was found running Nix on macOS, not iOS (just in case someone else besides me interpreted the two comments here as such).

Additional fun fact - the issue in question was not found during new development, but by just running the same code that had worked on previous macOS versions just fine. So besides a vulnerability, it's an user-visible regression to behaviour described by POSIX APIs.

dezgeg··on Statically Recompiling NES Games into Native Executables with LLVM and Go (2013)
This actually happens surprisingly often in 6502 code, because unconditional branches always take three bytes, unlike conditional jumps which take two bytes. So if the value of some condition flags are known to be constant (e.g. ORing with a nonzero constant always clears the zero flag) it saves a byte to use an always-true conditional jump in place of an unconditional jump.
dezgeg··on Tutorial – Write a System Call
One correction to the strncpy_from_user part, specifically this:

> The process could try to read another process’s memory by giving a pointer that maps into another process’s address space.

This cannot happen, there is no such thing as "a pointer that maps into another process's address space". A virtual address in Linux (on x86 and probably almost all arches) accesses either the processes own memory map (where access to unmapped addresses causes a fault even when done from ring 0) or the kernel virtual mapping.

dezgeg··on Broadcom Wi-Fi Datasheets
> So Broadcom is paying someone to write an open driver for their own GPU. This doesn't benefit anyone else in the ARM ecosystem in the slightest.

I would not be so cynical. It'd be quite unlikely that properly upstreamed Mesa and/or kernel code wouldn't lead to any idea sharing or refactoring/optimization of the common code used by all drivers.

dezgeg··on NES Classic Mini boot image dump method via UART and USB
Which one of those is GPLv3 and not GPLv2?
dezgeg··on Bus1 – Kernel Message Bus
kdbus was never merged to mainline.
dezgeg··on Minimal Raspberry Pi VPU firmware
The K1 chip has a blob-free boot (unlike the newer chips AFAIK) except for the USB-based flash programming / recovery mode, so for the initial installation you'd need to manually flash the eMMC somehow if you don't want to run any proprietary code.

And yes, CUDA isn't supported by the open drivers. Other than that, I've heard Nouveau works relatively well. Though I'm not still sure if the open source graphics community has figured out a way to get stacks like Xorg or Wayland/Weston running without hacking the source on architectures where rendering and scanout are done by different DRM devices.

dezgeg··on Windowing Systems by Example: 9 – Coup de Grace
From the Macintosh folklore archive: http://www.folklore.org/StoryView.py?story=I_Still_Remember_...
dezgeg··on Understanding /proc
According to my reading of the code, an open process file just holds a reference to a relatively lightweight handle to that process (struct pid), which means 1) resource exhaustion by holding onto full process structures doesn't happen 2) numerical process ids can get recycled even if someone is holding a long-dead /proc/PID directory open for that pid, but the old opened directory keeps referring to the dead process.
dezgeg··on Theo de Raadt on LLVM license change
Well as a practical example, I checked the latest firmware of Asus RT-AC88U (HW seems to have shipped in Q4/2015) and the strings in /usr/bin/smbd (binwalk can directly extract the Asus .trx files) point to some derived version of 3.0.37.
dezgeg··on Theo de Raadt on LLVM license change
Many of them ship an old version from pre-GPLv3 times though.
dezgeg··on Does a compiler use all x86 instructions? (2010)
Yes, for instance the LOOP instruction: http://stackoverflow.com/questions/35742570/why-is-the-loop-...
dezgeg··on PulseAudio has been removed from dports
How's the situation for hotplugging sound devices in ALSA nowadays? The top Google results for "alsa hotplug" all point to editing configuration files or udev rules or shell scripts.
dezgeg··on Reflections on NixOS
Containers don't handle the case where two different versions (or otherwise conflicting variants) occur in the whole dependency tree. For instance, consider program A with direct dependencies B and C, where B needs version X of /usr/bin/D but C needs version Y of /usr/bin/D.
dezgeg··on UEFI on top of U-Boot on ARM
In fact, the U-Boot guys were working on a standard solution, quite similar to extlinux/syslinux syntax: http://git.denx.de/?p=u-boot.git;a=blob;f=doc/README.distro;..., but I guess that wasn't standard enough for the Fedora guys.
dezgeg··on C/C++ pointers: pointers abuse in Windows kernel
Linux uses a similar thing: functions that return pointers and that can fail typically return the negated error code cast directly into a pointer: http://lxr.free-electrons.com/source/include/linux/err.h#L23
dezgeg··on Pine64 (64-bit quad core for $15) Quick Start Guide
No, the boot ROM supports from booting an SD card. Though not in the sense of booting any OS like Linux, but booting a board-specific second stage bootloader like U-Boot.
dezgeg··on Pine64 (64-bit quad core for $15) Quick Start Guide
Because these kinds of boards don't typically have BIOS/firmware chips, the booting options are limited to what is provided by the SoC's boot ROM. An USB host stack is immensely complicated and as such something that manufacturers wouldn't want to put in their ROMs (although I recall some Cortex-M0 chips actually implement this).

Many (maybe even most?) SoCs, including at least all previous Allwinner chips do support booting directly from SD cards, though.

dezgeg··on Revisiting the Google Pixel C – Better, but Not There Yet
Nope, Tegra X1 support for the mainline Linux is already being done as we speak (by NVIDIA themselves): http://www.spinics.net/lists/devicetree/msg109053.html
← PreviousPage 11 of 14Next →