News for hackers. Stuff that matters.
Re:Echo – Assembly program that prints the first positional ... by gens on Monday January 02, 2017 @06:08PM (#13305288)
The kernel copies the strings you pass in the array of pointers. (haven't checked though, but it is better then the alternative of not copying and dealing with the mess)
Re:Echo – Assembly program that prints the first positional ... by cyphar on Tuesday January 03, 2017 @06:28PM (#13314282)
The memory mapping is the same before and after execve(2), so I don't think it needs to be copied. I'll take a look though.
Re:Echo – Assembly program that prints the first positional ... by gens on Wednesday January 04, 2017 @09:41AM (#13318577)
Maybe only a few pages remain as programs don't inherit memory from their parents. It could be done for those strings but consider that mappings are in 4k pages (so the rest of the page would have to be cleared to 0).