netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: akpm@linux-foundation.org
Cc: netdev@vger.kernel.org, drosenberg@vsecurity.com,
	a.p.zijlstra@chello.nl, eparis@parisplace.org,
	eric.dumazet@gmail.com, eugeneteo@kernel.org, jmorris@namei.org,
	kees.cook@canonical.com, mingo@elte.hu, tgraf@infradead.org
Subject: Re: [patch 1/1] net: convert %p usage to %pK
Date: Tue, 24 May 2011 01:13:30 -0400 (EDT)	[thread overview]
Message-ID: <20110524.011330.1077020828173889583.davem@davemloft.net> (raw)
In-Reply-To: <201105232217.p4NMHZiC015498@imap1.linux-foundation.org>

From: akpm@linux-foundation.org
Date: Mon, 23 May 2011 15:17:35 -0700

> From: Dan Rosenberg <drosenberg@vsecurity.com>
> 
> The %pK format specifier is designed to hide exposed kernel pointers,
> specifically via /proc interfaces.  Exposing these pointers provides an
> easy target for kernel write vulnerabilities, since they reveal the
> locations of writable structures containing easily triggerable function
> pointers.  The behavior of %pK depends on the kptr_restrict sysctl.
> 
> If kptr_restrict is set to 0, no deviation from the standard %p behavior
> occurs.  If kptr_restrict is set to 1, the default, if the current user
> (intended to be a reader via seq_printf(), etc.) does not have CAP_SYSLOG
> (currently in the LSM tree), kernel pointers using %pK are printed as 0's.
>  If kptr_restrict is set to 2, kernel pointers using %pK are printed as
> 0's regardless of privileges.  Replacing with 0's was chosen over the
> default "(null)", which cannot be parsed by userland %p, which expects
> "(nil)".
> 
> The supporting code for kptr_restrict and %pK are currently in the -mm
> tree.  This patch converts users of %p in net/ to %pK.  Cases of printing
> pointers to the syslog are not covered, since this would eliminate useful
> information for postmortem debugging and the reading of the syslog is
> already optionally protected by the dmesg_restrict sysctl.
> 
> Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Applied.

  reply	other threads:[~2011-05-24  5:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-23 22:17 [patch 1/1] net: convert %p usage to %pK akpm
2011-05-24  5:13 ` David Miller [this message]
2011-05-24  6:17   ` Eric Dumazet
2011-05-24  6:33     ` Joe Perches
2011-05-24  6:57       ` Ingo Molnar
2011-05-24  7:04         ` Eric Dumazet
2011-05-24  7:35           ` Joe Perches
2011-05-24  7:45             ` Eric Dumazet
2011-05-24  7:58               ` David Miller
2011-05-24 14:43                 ` Stephen Hemminger
2011-05-24 17:18                   ` David Miller
2011-05-25 23:29                 ` Kees Cook
2011-05-26  1:50                   ` David Miller
2011-05-27  0:14                     ` Kees Cook
2011-05-27  2:44                       ` David Miller
2011-05-27  3:10                         ` Eric Dumazet
2011-05-27  6:37                           ` Ingo Molnar

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=20110524.011330.1077020828173889583.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=drosenberg@vsecurity.com \
    --cc=eparis@parisplace.org \
    --cc=eric.dumazet@gmail.com \
    --cc=eugeneteo@kernel.org \
    --cc=jmorris@namei.org \
    --cc=kees.cook@canonical.com \
    --cc=mingo@elte.hu \
    --cc=netdev@vger.kernel.org \
    --cc=tgraf@infradead.org \
    /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).