Live data from Hacker News

OpenBSD may soon gain further memory protections: immutable userland mappings

marc.info

71–72 of 72 posts

Re: OpenBSD may soon gain further memory protections: immutable userland mappings

#71

I was just discussing this sort of thing with some colleagues. Because the stack frame for main contains a bunch of other stuff - environment variables, cli args, etc - it makes it unreliable to try to instrument Linux systems and collect that information. A process can change its name, args, env, at any time. That sort of information is really helpful for forensics. Currently your only option is to pull data directl…

> Very few programs make syscalls directly (except go programs i guess? lol) on Linux You’re forgetting statically compiled binaries, which are very important for ease of deployment and distro-agnostic execution.

Statically compiled binaries almost always still use a libc, either by dynamically linking it or by statically linking it.

Re: OpenBSD may soon gain further memory protections: immutable userland mappings

#72
post #63

Earlier quoted context omitted.

> On the plus side, on Linux /proc/ /environ is a snapshot created at the time of execve() and kept by the kernel, nothing other than execve() can change it (don't quote me on this, I'm only 90% sure.) prctl(PR_SET_MM_ENV_{START,END}) will change the contents of /proc/ /environ. From what it looks like in Linux's source code, twiddling the bits at the base of the stack will also cause the procfs file to change--it se…

Now I'm sad :( … but Thanks for removing a misconception of mine!

Yep, dug into this the other day and POC'd it to prove that (even without prctl, just direct writing) you can overwrite those values and that will be shown in proc.
Post reply on HN