linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dave Hansen <dave@linux.vnet.ibm.com>
To: Pekka Enberg <penberg@kernel.org>
Cc: Theodore Tso <tytso@mit.edu>,
	Dan Rosenberg <drosenberg@vsecurity.com>,
	Matt Mackall <mpm@selenic.com>,
	cl@linux-foundation.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] Make /proc/slabinfo 0400
Date: Fri, 04 Mar 2011 09:36:04 -0800	[thread overview]
Message-ID: <1299260164.8493.4071.camel@nimitz> (raw)
In-Reply-To: <AANLkTimpfk8EHjVKYsJv0p_G7tS2yB-n=PPbD2v7xefV@mail.gmail.com>

On Fri, 2011-03-04 at 08:52 +0200, Pekka Enberg wrote:
> On Fri, Mar 4, 2011 at 2:50 AM, Theodore Tso <tytso@mit.edu> wrote:
> > Being able to monitor /proc/slabinfo is incredibly useful for finding various
> > kernel problems.  We can see if some part of the kernel is out of balance,
> > and we can also find memory leaks.   I once saved a school system's Linux
> > deployment because their systems were crashing once a week, and becoming
> > progressively more unreliable before they crashed, and the school board
> > was about to pull the plug.
> 
> Indeed. However, I'm not sure we need to expose the number of _active
> objects_ to non-CAP_ADMIN users (which could be set to zeros if you
> don't have sufficient privileges). Memory leaks can be detected from
> the total number of objects anyway, no? 

This:

	http://www.exploit-db.com/exploits/14814/

loops doing allocations until total==active, and then does one more
allocation to get the position in the slab it needs.  If we mask
'active', it'll just loop until 'total' gets bumped, and then consider
the _previous_ allocation to have been the one that was in the necessary
position.

As Ted mentioned, the real issue here is being able to infer location
inside the slab by correlating your allocations with when the slab
statistics get bumped.  You can do that with slabinfo pretty precisely,
but you can probably also pull it off with meminfo too, albeit with less
precision.

We need to either keep the bad guys away from the counts (this patch),
or de-correlate the counts moving around with the position of objects in
the slab.  Ted's suggestion is a good one, and the only other thing I
can think of is to make the values useless, perhaps by batching and
delaying the (exposed) counts by a random amount.

-- Dave

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2011-03-04 17:37 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-03 17:50 [PATCH] Make /proc/slabinfo 0400 Dan Rosenberg
2011-03-03 18:17 ` Dave Hansen
2011-03-03 18:29   ` Dan Rosenberg
2011-03-03 20:58 ` Matt Mackall
2011-03-03 21:16   ` Dan Rosenberg
2011-03-03 21:44     ` Matt Mackall
2011-03-03 22:30       ` Dan Rosenberg
2011-03-03 23:08         ` Matt Mackall
2011-03-04  0:32           ` Dave Hansen
2011-03-04  0:50         ` Theodore Tso
2011-03-04  6:52           ` Pekka Enberg
2011-03-04 17:36             ` Dave Hansen [this message]
2011-03-04 17:48               ` Linus Torvalds
2011-03-04 18:14                 ` Matt Mackall
2011-03-04 20:02                   ` Pekka Enberg
2011-03-04 20:31                     ` Matt Mackall
2011-03-04 20:42                       ` Dan Rosenberg
2011-03-04 20:56                         ` Pekka Enberg
2011-03-04 21:08                           ` Dan Rosenberg
2011-03-04 21:30                             ` Pekka Enberg
2011-03-04 21:44                               ` Dan Rosenberg
2011-03-04 22:10                                 ` Pekka Enberg
2011-03-04 22:14                                   ` Pekka Enberg
2011-03-04 23:02                                     ` Matt Mackall
2011-03-05 16:25                                       ` Ted Ts'o
2011-03-06 13:19                                         ` Alan Cox
2011-03-07 14:56                                           ` Dan Rosenberg
2011-03-07 16:02                                             ` Matt Mackall
2011-03-04 20:37                     ` Dan Rosenberg
2011-03-04 20:58                       ` Pekka Enberg
2011-03-04 21:10                         ` Dan Rosenberg
2011-03-06  0:42                           ` Jesper Juhl
2011-03-06  0:57                             ` Dan Rosenberg
2011-03-06  1:09                             ` Matt Mackall
2011-03-06  1:15                               ` Jesper Juhl
2011-03-07 16:40                                 ` Christoph Lameter
2011-03-04 21:12                         ` Matt Mackall
2011-03-04 11:58           ` Alan Cox
  -- strict thread matches above, loose matches on Subject: below --
2011-03-07 14:19 [PATCH] Make /proc/slabinfo 040 George Spelvin
2011-03-07 17:49 ` [PATCH] Make /proc/slabinfo 0400 George Spelvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1299260164.8493.4071.camel@nimitz \
    --to=dave@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux-foundation.org \
    --cc=drosenberg@vsecurity.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@elte.hu \
    --cc=mpm@selenic.com \
    --cc=penberg@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).