linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4] sysctl: fix incorrect write position handling
@ 2014-05-01 21:26 Kees Cook
  2014-05-01 21:26 ` [PATCH 1/4] sysctl: clean up char buffer arguments Kees Cook
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Kees Cook @ 2014-05-01 21:26 UTC (permalink / raw)
  To: linux-kernel
  Cc: Kees Cook, Andrew Morton, Randy Dunlap, Ingo Molnar,
	Rik van Riel, Peter Zijlstra, Mel Gorman, Aaron Tomlin, Li Zefan,
	Dave Hansen, Ryan Mallon, Wanpeng Li, Dario Faggioli, Jens Axboe,
	Benjamin Herrenschmidt, Frederic Weisbecker, Michael Ellerman,
	linux-doc

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.

This misbehavior was featured in an exploit against Chrome OS. While it's
not in itself a vulnerability, it's a weirdness that isn't on the mind
of most auditors: "This filter looks correct, the first line written
would not be meaningful to sysctl" doesn't apply here, since the size
of the write and the contents of the final write are what matter when
writing to sysctls.

This adds the sysctl kernel.sysctl_writes_strict to control the write
behavior. The default (0) reports when VFS position is non-0 on a write,
but retains legacy behavior, -1 disables the warning, and 1 enables the
position-respecting behavior.

Thanks,

-Kees


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-05-06  1:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-01 21:26 [PATCH v3 0/4] sysctl: fix incorrect write position handling Kees Cook
2014-05-01 21:26 ` [PATCH 1/4] sysctl: clean up char buffer arguments Kees Cook
2014-05-01 21:26 ` [PATCH 2/4] sysctl: refactor sysctl string writing logic Kees Cook
2014-05-01 21:26 ` [PATCH 3/4] sysctl: allow for strict write position handling Kees Cook
2014-05-01 21:26 ` [PATCH 4/4] test: validate sysctl_writes_strict Kees Cook
2014-05-03 14:42   ` Randy Dunlap
2014-05-06  1:29     ` Kees Cook
2014-05-05 22:00 ` [PATCH v3 0/4] sysctl: fix incorrect write position handling Andrew Morton
2014-05-06  1:28   ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).