1,120 karma · joined Jun 7, 2009 (17y ago) · 520 submissions
comment 5mo ago · link · parent
comment 1y ago · link · parent
See Vec::into_raw_parts or Box::into_raw for an stdlib analogy.
comment 2y ago · link · parent
I would like to see at least in-process environment modification discouraged. Rust is dealing with the issue by considering getenv unsafe when coming through C, but getting rid of the read side is much harder than the write side.
comment 2y ago · link · parent
I'd be interested in a way to do static binary analysis to get from those symbols to a call tree, as well.
I don't see a way to check for **environ usage though, the compiler could turn this one into anything.
comment 2y ago · link · parent
comment 2y ago · link · parent
I don't know how he hasn't been removed after this.
comment 2y ago · link · parent
On the other hand, while I haven't used it for /, dipping my toes in bcachefs with recoverable data has been a pleasant experience. Compression, encryption, checksumming, deduplication, easy filesystem resizing, SSD acceleration, ease of adding devices… it's good to have it all in one place.
comment 2y ago · link · parent
That's been implemented; in Linux 6.11 bcachefs will correct errors on read. See
> - Self healing on read IO/checksum error
in https://lore.kernel.org/linux-bcachefs/73rweeabpoypzqwyxa7hl...
Making it possible to scrub from userspace by walking and reading everything (tar -c /mnt/bcachefs >/dev/null).
comment 2y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
You may have a mutex on getenv/setenv, like the Rust stdlib does, but when libc doesn't look at that mutex, even on the read side, you run into UB.
So the next step is never calling into seemingly innocent libc functions in safe code (which you have to enforce on your dependencies as well), implementing safe alternatives to a good chunk of libc (and making sure your dependencies use those), to cordon off anything that looks at the environment. This makes a good chunk of POSIX functionality useless.
comment 3y ago · link · parent
comment 3y ago · link · parent
Quoting an example from https://bcachefs.org/GettingStarted/
bcachefs format /dev/sd[ab]1 \
--foreground_target /dev/sda1 \
--promote_target /dev/sda1 \
--background_target /dev/sdb1
mount -t bcachefs /dev/sda1:/dev/sdb1 /mnt
This will configure the filesystem so that writes will be buffered to /dev/sda1 before being written back to /dev/sdb1 in the background, and that hot data will be promoted to /dev/sda1 for faster access. bcachefs format --help
--promote_target=(target)
Device or label to promote data to on readcomment 3y ago · link · parent
https://hacks.mozilla.org/2021/12/webassembly-and-back-again...
comment 3y ago · link · parent
comment 3y ago · link · parent
https://web.archive.org/web/20190328010454/https://plus.goog... (via explainkcd)
comment 3y ago · link · parent
Any other fun easter eggs in the XKCD counter?
- https://xkcd.com/404/ 404s (obviously)
- https://xkcd.com/1337/ is about hackingcomment 3y ago · link · parent
There's also a format string vulnerability that wouldn't exist in Rust and which C turns into privilege escalation instead of aborting.
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent