Re: [PATCH v2 3/4] sysctl: allow for strict write position handling

2014-04-22 Thread Kees Cook
On Tue, Apr 22, 2014 at 11:11 AM, Andrew Morton wrote: > On Mon, 21 Apr 2014 21:52:48 -0700 Kees Cook wrote: > >> >> This provides CONFIG_PROC_SYSCTL_STRICT_WRITES as a way to make this >> >> behavior act in a less surprising manner for strings, and disallows >> >> non-zero file position when wri

Re: [PATCH v2 3/4] sysctl: allow for strict write position handling

2014-04-22 Thread Andrew Morton
On Mon, 21 Apr 2014 21:52:48 -0700 Kees Cook wrote: > >> This provides CONFIG_PROC_SYSCTL_STRICT_WRITES as a way to make this > >> behavior act in a less surprising manner for strings, and disallows > >> non-zero file position when writing numeric sysctls (similar to what is > >> already done whe

Re: [PATCH v2 3/4] sysctl: allow for strict write position handling

2014-04-21 Thread Kees Cook
On Mon, Apr 21, 2014 at 3:45 PM, Andrew Morton wrote: > On Thu, 17 Apr 2014 17:16:22 -0700 Kees Cook wrote: > >> When writing to a sysctl string, each write, regardless of VFS position, >> begins writing the string from the start. This means the contents of >> the last write to the sysctl control

Re: [PATCH v2 3/4] sysctl: allow for strict write position handling

2014-04-21 Thread Andrew Morton
On Thu, 17 Apr 2014 17:16:22 -0700 Kees Cook wrote: > When writing to a sysctl string, each write, regardless of VFS position, > begins writing the string from the start. This means the contents of > the last write to the sysctl controls the string contents instead of > the first: > > open("/pro

[PATCH v2 3/4] sysctl: allow for strict write position handling

2014-04-17 Thread Kees Cook
When writing to a sysctl string, each write, regardless of VFS position, begins writing the string from the start. This means the contents of the last write to the sysctl controls the string contents instead of the first: open("/proc/sys/kernel/modprobe", O_WRONLY) = 1 write(1, "