summaryrefslogtreecommitdiffstats
path: root/libc/netbsd/net
diff options
context:
space:
mode:
authorJP Abgrall <jpa@google.com>2011-09-17 15:22:21 -0700
committerJP Abgrall <jpa@google.com>2011-09-17 15:22:21 -0700
commit3884bfe9661955543ce203c60f9225bbdf33f6bb (patch)
tree3623958287a5af79d5da2dc15f511d94662da00b /libc/netbsd/net
parentb8ef90d67950c5d4e04f95c30e164e924f41f70a (diff)
downloadbionic-3884bfe9661955543ce203c60f9225bbdf33f6bb.zip
bionic-3884bfe9661955543ce203c60f9225bbdf33f6bb.tar.gz
bionic-3884bfe9661955543ce203c60f9225bbdf33f6bb.tar.bz2
libc: popen: work around data corruption
vfork() would not save the registers that the parent would expect to have restored after execl() completed. Specially that execl() would call execve() underneath, further messing up the stack of the parent. To avoid that, we fork() for now. Later we will revisit and cleanup vfork()+execve() to actually have vfork() store all the register that the parent expects to see, and not those left by execve(). In the original code, looking at the registers just before the call to popen(), and after the call showed that r7 would get clobbered. This would leave the caller with an invalid pointer, leading to all kinds of data corruptions. execve() is simpler that execl() in this case. Bug: 5336252 Change-Id: I3bf718c0bb4c0439f6f2753f153cdea14175be9c
Diffstat (limited to 'libc/netbsd/net')
0 files changed, 0 insertions, 0 deletions