Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1410426imm; Wed, 25 Jul 2018 18:09:06 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcuKjs/g0M+2RkNSFnmJzJUdqBOK9n7BwuZuZ+UpVkLYErImcyXnQ2R5kCyDN5XqOdGXXQf X-Received: by 2002:a63:9856:: with SMTP id l22-v6mr23233054pgo.208.1532567346521; Wed, 25 Jul 2018 18:09:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532567346; cv=none; d=google.com; s=arc-20160816; b=sfr6zYfncewcAuQXgqV5hwLKJRWHO8uKlH28f2X/QYnLbwMvoWAjiKEtEDbtZis6mT aJbcZQvffk/CWFl7Gi1gO7gFdhEQzJSeTZUDtcrhVOqFvpfV4Fd2rGoImhIqCvmXdoB0 hfIVJ21VQjne+4IDWF/4DOF2u3GcK9ZiydYvQPL0S/JM7vimQJilm/joH2lc4+qCuFpS sTQX4CK4PY4QI2HyjcvGfm29Gju+GKopyR+tQTc/zSu5ZbKIzhZK4Y15UuPfNp79HElU YlYbi6pVetk8IytGbQHz09eVg/ssjxFEGKf9r/5uX12LOSK0yRyShMfYvvwFKVdVBb2+ 2tiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=Z5lyHTJJyr51PoopIFW2/HdmBjaljEzgMA+rlr9R8RM=; b=XQD9OPf/tB3HWELK6tjnjNvZ+Kjv3T9ag7Waj/FH78WEZ7ObxflQ8btskstWN3enaV siR6qqh1Cf2lmlillubi0COXdLBLy7jPpcj2WW6mJRyMur0TuX7AEtcoVZwu4z16HBRe pVj7kTci6LeHdlc6uGpzFn/ey1pCEuHLNDUOd8VIlBNzmmSzpEdKDDyMgtBJxQta/LnX jKdBPI+Cn1fiTJ3NjfJJI5KBy1qNZCt/RXl2G3/ukU1eNTJMNjCiJmwH7G7Ylotl1g2B aAiJFv4FUFH4wcAvnJIn9dceDn2JYBr2U73k1neQVsKOLPBPSFQ9GkFVO08YHEZH3MGU 3eUw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a1-v6si14249029pld.63.2018.07.25.18.08.39; Wed, 25 Jul 2018 18:09:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728529AbeGZCVf (ORCPT + 99 others); Wed, 25 Jul 2018 22:21:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:42930 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728292AbeGZCVf (ORCPT ); Wed, 25 Jul 2018 22:21:35 -0400 Received: from vmware.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9695C20685; Thu, 26 Jul 2018 01:07:17 +0000 (UTC) Date: Wed, 25 Jul 2018 21:07:17 -0400 From: Steven Rostedt To: Mark Salyzyn Cc: linux-kernel@vger.kernel.org, Nick Desaulniers , Ingo Molnar , kernel-team@android.com, stable@vger.kernel.org Subject: Re: [PATCH] tracing: do not leak kernel addresses Message-ID: <20180725210717.3b807191@vmware.local.home> In-Reply-To: <20180725202238.165314-1-salyzyn@android.com> References: <20180725202238.165314-1-salyzyn@android.com> X-Mailer: Claws Mail 3.15.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 25 Jul 2018 13:22:36 -0700 Mark Salyzyn wrote: > From: Nick Desaulniers > > Switch from 0x%lx to 0x%pK to print the kernel addresses. > > Fixes: CVE-2017-0630 Wait!!!! This breaks perf and trace-cmd! They require this to be able to print various strings in trace events. This file is root read only, as the CVE says. NAK for this fix. Come up with something that doesn't break perf and trace-cmd. That will not be trivial, as the format is stored in the ring buffer with an address, then referenced directly. It also handles trace_printk() functions that simply point to the string format itself. A fix would require having a pointer be the same that is referenced inside the kernel as well as in this file. Maybe make the format string placed in a location that doesn't leak where the rest of the kernel exists? -- Steve > Signed-off-by: Mark Salyzyn > Cc: Nick Desaulniers > Cc: Steven Rostedt > Cc: Ingo Molnar > Cc: > Cc: # 3.18, 4.4, 4.9, 4.14 > Cc: > > --- > kernel/trace/trace_printk.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/trace/trace_printk.c b/kernel/trace/trace_printk.c > index ad1d6164e946..93698023baf1 100644 > --- a/kernel/trace/trace_printk.c > +++ b/kernel/trace/trace_printk.c > @@ -304,7 +304,7 @@ static int t_show(struct seq_file *m, void *v) > if (!*fmt) > return 0; > > - seq_printf(m, "0x%lx : \"", *(unsigned long *)fmt); > + seq_printf(m, "0x%pK : \"", *(unsigned long *)fmt); > > /* > * Tabs and new lines need to be converted.