From patchwork Thu Feb 24 00:42:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 84287 X-Patchwork-Delegate: apw@canonical.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id E7AAEB6EDD for ; Thu, 24 Feb 2011 11:42:48 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1PsPHr-0005Ps-Ns; Thu, 24 Feb 2011 00:42:31 +0000 Received: from smtp.outflux.net ([198.145.64.163]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1PsPHp-0005Pn-6X for kernel-team@lists.ubuntu.com; Thu, 24 Feb 2011 00:42:29 +0000 Received: from www.outflux.net (serenity-end.outflux.net [10.2.0.2]) by vinyl.outflux.net (8.14.3/8.14.3/Debian-9.1ubuntu1) with ESMTP id p1O0gRcA031573 for ; Wed, 23 Feb 2011 16:42:28 -0800 Date: Wed, 23 Feb 2011 16:42:27 -0800 From: Kees Cook To: kernel-team@lists.ubuntu.com Subject: [PATCH] [natty] proc: hide kernel addresses via %pK in /proc//stack Message-ID: <20110224004227.GE4212@outflux.net> MIME-Version: 1.0 Content-Disposition: inline Organization: Canonical X-MIMEDefang-Filter: outflux$Revision: 1.316 $ X-HELO: www.outflux.net X-Scanned-By: MIMEDefang 2.67 on 10.2.0.1 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com [in -mm as proc-hide-kernel-addresses-via-%pk-in-proc-pid-stack.patch] OriginalAuthor: Konstantin Khlebnikov This file is readable for the task owner. Hide kernel addresses from unprivileged users, leave them function names and offsets. Signed-off-by: Konstantin Khlebnikov Acked-by: Kees Cook Cc: Alexey Dobriyan Signed-off-by: Andrew Morton --- fs/proc/base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN fs/proc/base.c~proc-hide-kernel-addresses-via-%pk-in-proc-pid-stack fs/proc/base.c --- a/fs/proc/base.c~proc-hide-kernel-addresses-via-%pk-in-proc-pid-stack +++ a/fs/proc/base.c @@ -340,7 +340,7 @@ static int proc_pid_stack(struct seq_fil save_stack_trace_tsk(task, &trace); for (i = 0; i < trace.nr_entries; i++) { - seq_printf(m, "[<%p>] %pS\n", + seq_printf(m, "[<%pK>] %pS\n", (void *)entries[i], (void *)entries[i]); } kfree(entries);