Donn
Donn

Reputation: 1

Is it possible that a child process can modify memory in the parent?

This is twilight zone stuff. We bumped into this on Ubuntu. It looks like errno in a parent process was modified by its child process. We see this in code that is executed before main, in a constructor for a shared library.

Is this even possible? Has anyone seen anything like this?

If errno is in a vdso, could it be that those pages aren't mapped to the child until main is ready to start? That seems crazy.

Upvotes: 0

Views: 292

Answers (1)

ninjalj
ninjalj

Reputation: 43698

Is it possible that a child process can modify memory in the parent?

Only if it comes from a vfork() or a clone() call with CLONE_VM (not from a fork() call), or if that memory is shared memory (mmap()ed MAP_SHARED memory counts as shared memory).

Upvotes: 3

Related Questions