On Wed, May 16, 2018 at 9:09 PM Andy Lutomirski <luto@xxxxxxxxxxxxxx> wrote: > > In theory, we could instead allow people to set the values of > > mm->{arg,env}_{start,end}, which is where /proc/<pid>/cmdline actually > > finds the argument array. > > HOWEVER, there are serious issues with that too, and right now we only > > allow it for checkpointing and PR_SET_MM_MAP prctl, which does a lot more > > than that. > Out of curiosity, what are the issues? At least one issue is that we technically keep the argument space and the environment space separate, but the *code* actually knows that they are always adjacent. So while we have what looks to be independent argument and environment pointers, in actual fact we have arg_end == env_start, and we have some code that "knows" that. It would probably not be hard to fix up, but I worry about the cases I don't even know about. That said, getting it wrong is probably not the end of the world either, at worst we'd show an odd command line through /proc. It's not like the kernel really uses those fields for anything else. So I guess it wouldn't be too nasty to just allow people to set the argv start/len manually. We actually have the interfaces for it already, but they are restricted to root-only (CAP_SYS_RESOURCE) and rather oddly laid out. The existing interfaces are all built for checkpoint/restart, not for generic use (see PR_SET_MM). Linus -- To unsubscribe from this list: send the line "unsubscribe linux-api" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html