Re: [PATCH] Set bounds on what /proc/self/make-it-fail accepts.

2014-02-19 Thread Dave Jones
On Wed, Feb 19, 2014 at 02:00:21PM -0800, Andrew Morton wrote: > > I toyed with the idea of changing task_struct.make_it_fail to unsigned too, > > but only realized I missed that after I'd sent out the diff. > > If we're touching the task_struct we could make it a bool. > > Or just a sing

Re: [PATCH] Set bounds on what /proc/self/make-it-fail accepts.

2014-02-19 Thread David Rientjes
On Wed, 19 Feb 2014, Andrew Morton wrote: > If we're touching the task_struct we could make it a bool. > > Or just a single bit(field). task_struct already has a bunch of > bitfields in it (strangely, they aren't contiguous). But some locking > would be needed if tasks-other-than-current can mo

Re: [PATCH] Set bounds on what /proc/self/make-it-fail accepts.

2014-02-19 Thread Andrew Morton
On Wed, 19 Feb 2014 16:55:05 -0500 Dave Jones wrote: > On Wed, Feb 19, 2014 at 01:40:25PM -0800, Andrew Morton wrote: > > > Switching `make_it_fail' to unsigned makes the test simpler but it does > > rather muck up the typing in there. task_struct.make_it_fail is still > > an int, we should

Re: [PATCH] Set bounds on what /proc/self/make-it-fail accepts.

2014-02-19 Thread Dave Jones
On Wed, Feb 19, 2014 at 01:40:25PM -0800, Andrew Morton wrote: > Switching `make_it_fail' to unsigned makes the test simpler but it does > rather muck up the typing in there. task_struct.make_it_fail is still > an int, we should now use simple_strtoul rather than simple_strtol, > proc_fault_

Re: [PATCH] Set bounds on what /proc/self/make-it-fail accepts.

2014-02-19 Thread Andrew Morton
On Tue, 18 Feb 2014 17:06:06 -0500 Dave Jones wrote: > /proc/self/make-it-fail is a boolean, but accepts any number, including > negative ones. Change variable to unsigned, and cap upper bound at 1. > > Signed-off-by: Dave Jones > > diff --git a/fs/proc/base.c b/fs/proc/base.c > index 51507065

Re: [PATCH] Set bounds on what /proc/self/make-it-fail accepts.

2014-02-19 Thread David Rientjes
On Wed, 19 Feb 2014, Akinobu Mita wrote: > I don't have any plans to extend /proc/self/make-it-fail to support > other than 0 or 1. So I have no objection against this change. > > Reviewed-by: Akinobu Mita > Ok, thanks. I hoped that the simple_strtol() would have been replaced by kstrtoint(

Re: [PATCH] Set bounds on what /proc/self/make-it-fail accepts.

2014-02-19 Thread Akinobu Mita
2014-02-19 8:27 GMT+09:00 Dave Jones : > On Tue, Feb 18, 2014 at 02:32:02PM -0800, David Rientjes wrote: > > On Tue, 18 Feb 2014, Dave Jones wrote: > > > > > /proc/self/make-it-fail is a boolean, but accepts any number, including > > > negative ones. Change variable to unsigned, and cap upper b

Re: [PATCH] Set bounds on what /proc/self/make-it-fail accepts.

2014-02-18 Thread Dave Jones
On Tue, Feb 18, 2014 at 02:32:02PM -0800, David Rientjes wrote: > On Tue, 18 Feb 2014, Dave Jones wrote: > > > /proc/self/make-it-fail is a boolean, but accepts any number, including > > negative ones. Change variable to unsigned, and cap upper bound at 1. > > Hmm, this would break anything

Re: [PATCH] Set bounds on what /proc/self/make-it-fail accepts.

2014-02-18 Thread David Rientjes
On Tue, 18 Feb 2014, Dave Jones wrote: > /proc/self/make-it-fail is a boolean, but accepts any number, including > negative ones. Change variable to unsigned, and cap upper bound at 1. > > Signed-off-by: Dave Jones > Hmm, this would break anything that uses anything other than one to enable i

[PATCH] Set bounds on what /proc/self/make-it-fail accepts.

2014-02-18 Thread Dave Jones
/proc/self/make-it-fail is a boolean, but accepts any number, including negative ones. Change variable to unsigned, and cap upper bound at 1. Signed-off-by: Dave Jones diff --git a/fs/proc/base.c b/fs/proc/base.c index 51507065263b..b926377c354f 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @