Re: [PATCH 1/2] sysctl: fix incorrect write position handling

2014-03-20 Thread Kees Cook
On Wed, Mar 19, 2014 at 6:56 PM, Andi Kleen wrote: >> >> Why are we fixing this? > > Also sysctl writes are root only anyways. > > Protecting root against root? Seems odd. I think you misunderstood my motivation. I don't want to protect anything here except a code auditor's mind. :) The flaw its

Re: [PATCH 1/2] sysctl: fix incorrect write position handling

2014-03-20 Thread Aaron Tomlin
On Wed, Mar 19, 2014 at 06:56:34PM -0700, Andi Kleen wrote: > > > > Why are we fixing this? > > Also sysctl writes are root only anyways. > > Protecting root against root? Seems odd. > > -Andi I agree. I don't see the point here. Regards, -- Aaron Tomlin -- To unsubscribe from this list: se

Re: [PATCH 1/2] sysctl: fix incorrect write position handling

2014-03-19 Thread Andi Kleen
> > Why are we fixing this? Also sysctl writes are root only anyways. Protecting root against root? Seems odd. -Andi -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/ma

Re: [PATCH 1/2] sysctl: fix incorrect write position handling

2014-03-19 Thread Kees Cook
On Wed, Mar 19, 2014 at 3:25 PM, Andrew Morton wrote: > On Tue, 18 Mar 2014 10:17:59 -0700 Kees Cook wrote: > >> When writing to a sysctl string, each write, regardless of VFS position, >> began writing the string from the start. This meant the contents of >> the last write to the sysctl controll

Re: [PATCH 1/2] sysctl: fix incorrect write position handling

2014-03-19 Thread Andrew Morton
On Tue, 18 Mar 2014 10:17:59 -0700 Kees Cook wrote: > When writing to a sysctl string, each write, regardless of VFS position, > began writing the string from the start. This meant the contents of > the last write to the sysctl controlled the string contents instead of > the first: > > open("/pr

[PATCH 1/2] sysctl: fix incorrect write position handling

2014-03-18 Thread Kees Cook
When writing to a sysctl string, each write, regardless of VFS position, began writing the string from the start. This meant the contents of the last write to the sysctl controlled the string contents instead of the first: open("/proc/sys/kernel/modprobe", O_WRONLY) = 1 write(1, "AAA