From patchwork Sat Feb 25 09:56:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9591547 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A6B236042C for ; Sat, 25 Feb 2017 09:57:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9FEC320855 for ; Sat, 25 Feb 2017 09:57:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 948B8277D9; Sat, 25 Feb 2017 09:57:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id D526020855 for ; Sat, 25 Feb 2017 09:57:06 +0000 (UTC) Received: (qmail 24486 invoked by uid 550); 25 Feb 2017 09:57:04 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 24448 invoked from network); 25 Feb 2017 09:57:02 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=sX3MmK7O6cUMTVJT73Qiak8s5tz1UcjABuRtH6eLWEM=; b=Kfjjf7ZyvH1iU6NVXtZBuw23KoH6rJC68IVVALKwxoSspM6upW3zTHIRTPCb9aNJYE qb6AfbzBVMbhZpx5nGTJr+Tm3Gzz18RQns+Rh7lO+zvpLHHekWjgEzXahCUdpq7BhKKl LSP8pUOE0AptUlOM0T5KhuxWEKWWHEaJZ2hJM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=sX3MmK7O6cUMTVJT73Qiak8s5tz1UcjABuRtH6eLWEM=; b=M6H0MbNSVtNkS7aXT1+y5kWuLcb+IwzvWsraYku86jOkL2418bRqJ5ya1nnrhyeVOt kwoLHm7f3H0L+nCbgW0EPajAKSAdNbCGp0e0PetWTMQ+L44TTmrOsvj4VrOemoxoIOrq OAdKIs/uMwTKPEG3iPEn3X5rbaFMHl6d0fTg18voVqw7TlyZj+JIbiRxVqiBdsYrS8P+ lL1kiP6wQRlGKYcAMIZNehnI3WKXZ+cJjfoDfe7P+TGRuNJYiiXF7KyUTt/O+2K8+zK4 VK+9PayoV5FYvXQhoJzkYZHEc1whgKr7QQiquFYEcPt6AIN3Xmy7EZjQYFDzJUd1s245 DB9w== X-Gm-Message-State: AMke39njvLbAp2PdT2s0WSSdJNOT74/TZa3AEWnvBc7h/pac7vwEgpNn1pukEo0f3tfZtu5v X-Received: by 10.84.142.1 with SMTP id 1mr10108804plw.127.1488016610368; Sat, 25 Feb 2017 01:56:50 -0800 (PST) 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 Message-ID: <20170225095648.GA4917@beast> MIME-Version: 1.0 Content-Disposition: inline Subject: [kernel-hardening] [PATCH] cgroups: censor kernel pointer in debug files X-Virus-Scanned: ClamAV using ClamSMTP 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)