From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751754AbdBYJ4w (ORCPT ); Sat, 25 Feb 2017 04:56:52 -0500 Received: from mail-pg0-f50.google.com ([74.125.83.50]:35848 "EHLO mail-pg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751419AbdBYJ4v (ORCPT ); Sat, 25 Feb 2017 04:56:51 -0500 Date: Sat, 25 Feb 2017 01:56:48 -0800 From: Kees Cook To: Tejun Heo Cc: Li Zefan , Johannes Weiner , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com Subject: [PATCH] cgroups: censor kernel pointer in debug files Message-ID: <20170225095648.GA4917@beast> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As found in grsecurity, this avoids exposing a kernel pointer through the cgroup debug entries. Signed-off-by: Kees Cook --- kernel/cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 53bbca7c4859..b794bcadefa4 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -6589,7 +6589,7 @@ static int cgroup_css_links_read(struct seq_file *seq, void *v) struct task_struct *task; int count = 0; - seq_printf(seq, "css_set %p\n", cset); + seq_printf(seq, "css_set %pK\n", cset); list_for_each_entry(task, &cset->tasks, cg_list) { if (count++ > MAX_TASKS_SHOWN_PER_CSS) -- 2.7.4 -- Kees Cook Pixel Security