liballocs icon indicating copy to clipboard operation
liballocs copied to clipboard

Detect boundary-affecting argv-clobbering by setproctitle() or similar

Open stephenrkell opened this issue 1 year ago • 1 comments

Linux explicitly sanctions a method of 'setting the process name' which not only clobbers argument and environment strings, but also shifts the effective boundary between the two, such that the command name argv[0] may spill over into an area previously used for environment strings. Ideally we'd catch this and be able to expose it in the auxv allocator's interfaces. See my blog post. This is a low-priority issue.

stephenrkell avatar Sep 11 '23 11:09 stephenrkell

Some more useful stuff for when it matters to get this right: https://stackoverflow.com/questions/273691/using-progname-instead-of-argv0

stephenrkell avatar Sep 11 '23 15:09 stephenrkell