Change proc/<pid>/cmdline to 8k

Greg KH gregkh at linuxfoundation.org
Thu Jun 4 04:04:26 EDT 2015


On Thu, Jun 04, 2015 at 01:11:48PM +0530, Navin P wrote:
> On Thu, Jun 4, 2015 at 10:47 AM, Greg KH <gregkh at linuxfoundation.org> wrote:
> > On Thu, Jun 04, 2015 at 09:52:08AM +0530, Navin P wrote:
> >> Hi,
> >>
> >>   I want to change the cmdline of a process to support 8096 . It works
> >> well on ppc where the page size is 65k.
> >>   But when i try to increase it on x86 (i686)
> >>
> >> http://lxr.free-electrons.com/source/fs/proc/base.c  by doing
> >> 6*PAGE_SIZE, i get kernel panic after some time
> >>
> >> 199 static int proc_pid_cmdline(struct seq_file *m, struct pid_namespace *ns,
> >> 200                             struct pid *pid, struct task_struct *task)
> >> 201 {
> >> 202         /*
> >> 203          * Rely on struct seq_operations::show() being called once
> >> 204          * per internal buffer allocation. See single_open(), traverse().
> >> 205          */
> >> 206         BUG_ON(m->size < PAGE_SIZE);
> >> 207         m->count += get_cmdline(task, m->buf, 6*PAGE_SIZE);
> >> 208         return 0;
> >> 209 }
> >> 210
> >
> > That shows you that this will not work, sorry.
> 
> Can you please help me and guide me into achieving this ?

Why do you want this?  What problem are you trying to solve that you
have come to the conclusion that increasing the size of the command line
is the solution?

thanks,

greg k-h



More information about the Kernelnewbies mailing list