Re: [PATCH 1/2] teach argv_split() to handle the mutable strings

2013-03-18 Thread Andrew Morton
On Sat, 16 Mar 2013 21:23:53 +0100 Oleg Nesterov wrote: > argv_split() allocates argv[count_argc(str)] array and assumes that > it will find the same number of arguments later. This is obviously > wrong if this string can be changed, say, by sysctl. > > With this patch argv_split() kstrndup's

Re: [PATCH 1/2] teach argv_split() to handle the mutable strings

2013-03-18 Thread Andrew Morton
On Sat, 16 Mar 2013 21:23:53 +0100 Oleg Nesterov o...@redhat.com wrote: argv_split() allocates argv[count_argc(str)] array and assumes that it will find the same number of arguments later. This is obviously wrong if this string can be changed, say, by sysctl. With this patch argv_split()

[PATCH 1/2] teach argv_split() to handle the mutable strings

2013-03-16 Thread Oleg Nesterov
argv_split() allocates argv[count_argc(str)] array and assumes that it will find the same number of arguments later. This is obviously wrong if this string can be changed, say, by sysctl. With this patch argv_split() kstrndup's the whole string and does not split it, we simply replace the spaces

[PATCH 1/2] teach argv_split() to handle the mutable strings

2013-03-16 Thread Oleg Nesterov
argv_split() allocates argv[count_argc(str)] array and assumes that it will find the same number of arguments later. This is obviously wrong if this string can be changed, say, by sysctl. With this patch argv_split() kstrndup's the whole string and does not split it, we simply replace the spaces