Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It’s not clear to me why the top rated reply which seemed extremely knowledgeable in discussing Linux kernel auto zeroing of memory mentioned a bunch of caveats including mentioning “some memory management libraries may reuse memory” but didn’t say “including glibc”.

That’s a pretty big library to gloss over from a security or working programmer perspective!

(Corrections to perspective welcome.)



Even if your libc IS one of the offenders, this libc code runs in a single process, so even though libc does or does not use evil tricks for your process, it doesn't mean you will get pages from some other process memory map, only that you may get your own old pages back.


Thanks, makes sense. (Looks like the poster commenting about glibc has corrected themself.)


I thought the shared memory they were referring to would be read only memory or something. So yes, the memory is shared, but your process doesn't have any access to overwrite any of it. Likewise, when you call library functions, when it mallocs something, it uses memory that your process has write access to, not the shared library memory.

In the context of the question, I assume the asker was mostly interested in reading some kind of sensitive data from a previous process, not reading the same librsry-code-only memory or something.

Note: all of this could be wrong, it was just my understanding

Edit: looks like this answers that: https://stackoverflow.com/questions/20857134/memory-write-pr...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: