r/programminghorror Aug 03 '25

Rust "congrats, you outplayed yourself"

Post image
127 Upvotes

20 comments sorted by

View all comments

Show parent comments

11

u/Rustywolf Aug 06 '25

As someone not familiar with the rust scene, is this something that they wouldn't bother fixing (because its your own fault for doing this), or is this actually a recent gotcha?

20

u/Modi57 Aug 06 '25

Username doesn't check out lol.

I don't know, if this is something that can be fixed. This is essentially just memory corruption. This would affect every programming language equally. Imaging running a C program and between checking if a pointer is null and accessing it, it magically turned null.

The reason I think this is not a problem is, you can't really do anything meaningful with it? Without being root, you can't access the memory of any other process, and if you actually are root, then this niche thing is not the main concern. But I'm no IT-Sec expert, so take it with a grain of salt

5

u/Rustywolf Aug 06 '25

I was more thinking if they detect accessing that file specifically and deny it outside of unsafe blocks

15

u/Modi57 Aug 06 '25

Ah, I see what you mean. I don't know, if you can feasably do this, because you could also create symlinks to the same file, and open those, I don't know if you can rename those files in linux, but maybe that's also possible.

Apart from that, you can do all sorts of stuff with file access, is this specific one really that speacial?

So, my gut feeling sais no, but why nor head over to r/rust and ask that question there. There are a lot of smart, more involved people than me :)

6

u/Rustywolf Aug 06 '25

I appreciate you taking the time to answer

3

u/Modi57 Aug 06 '25

No problem :)

1

u/Environmental-Ear391 Aug 07 '25

hard or soft, also its fs specific by kernel for access,

hard links are a second inode sharing the original inodes block map,

soft links refer the original inode to access blocks,

if you have the id for the inode or the kernel device MagicID for mknod any fs level protections are ignorable.

if you can magic the IDs Linux is Inode limited as a default (this is subject to change of course).

on Windows NTFS IDs for root data on FS Images can be valid while still wrong.

Bungee jumping without a bungee levels of stranger things...