linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] reference count hardening via kref: another attempt
@ 2016-06-25  1:13 Jann Horn
  2016-06-25  1:13 ` [RFC] kref: pin objects with dangerously high reference count Jann Horn
  2016-06-25  1:59 ` [RFC] reference count hardening via kref: another attempt Kees Cook
  0 siblings, 2 replies; 6+ messages in thread
From: Jann Horn @ 2016-06-25  1:13 UTC (permalink / raw)
  To: linux-kernel, kernel-hardening; +Cc: pageexec, Kees Cook, jann, Jann Horn

I would like to harden the kernel against reference count
overflow bugs. The commit message of the patch contains
a short analysis of code size impact, an explanation why I
want reference count hardening to land in the kernel, and a
description of the algorithm I'd want to use.

The reason I'm writing a cover letter is that my patch, on
its own, is pretty useless: My patch only adds hardening to
struct kref, but nearly all reference counters are
currently implemented using atomic_t, which is a generic
atomic number type. For the patch to be useful, I'll have
to go through the kernel and, for every atomic_t, decide
whether it is a reference count and, if so, change it
(together with all accesses to it) to a kref. According to
a quick grep, there are currently about 2700 atomic_t
struct members or variables in the kernel, so it's going to
be a big amount of work, and the resulting patches will be
gigantic.

Therefore, before I actually spend lots of time on this,
I'd like to know:

 - Does the reference count hardening in my patch look
   okay, and does it have good chances to get accepted
   when submitted for inclusion in the kernel at a later
   point in time?

 - If I manually go through the kernel and write a
   gigantic atomic_t -> struct kref patch (or a few
   patches coarsely grouped by subsystem), how high is
   the probability that it will get accepted?

(Note: I won't have much time for kernel work in the next
four months or so - but afterwards, I could probably
allocate time for getting this done.)

Jann Horn (1):
  kref: pin objects with dangerously high reference count

 include/linux/kref.h | 39 +++++++++++++++++++++++++++++++++------
 init/Kconfig         | 16 ++++++++++++++++
 kernel/Makefile      |  2 +-
 kernel/kref.c        | 17 +++++++++++++++++
 4 files changed, 67 insertions(+), 7 deletions(-)
 create mode 100644 kernel/kref.c

-- 
2.8.0.rc3.226.g39d4020

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

end of thread, other threads:[~2016-06-26  4:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-25  1:13 [RFC] reference count hardening via kref: another attempt Jann Horn
2016-06-25  1:13 ` [RFC] kref: pin objects with dangerously high reference count Jann Horn
2016-06-26  0:03   ` PaX Team
2016-06-26  4:07     ` Jann Horn
2016-06-25  1:59 ` [RFC] reference count hardening via kref: another attempt Kees Cook
2016-06-25 14:24   ` [kernel-hardening] " Greg KH

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).