Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp560376imm; Wed, 6 Jun 2018 02:09:03 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJDnsudVQyWDrLQsNXyWcu24Uhc/p5GCl0kK4PsVNJ3qJHYMLlDr1ZaF373p9vneT0F3UKm X-Received: by 2002:a17:902:584b:: with SMTP id f11-v6mr2377880plj.222.1528276143866; Wed, 06 Jun 2018 02:09:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528276143; cv=none; d=google.com; s=arc-20160816; b=h3Z0l5gpIjv1AZwTlb/sWtgo1pHUNcRbwP6F5TJQHfgv+595hKU+lRw2zephHRNwqi /TjXE5KWq3DXNOQY3P00JHjesCicGl1SBjogEYO1DBQppVtj4cuxgXqbrr0YHTX8IIW8 D8Sso+KQWvK9yt9Hb5AUTU95uzPtEG7Oac9vxMvIDdA3Xrgb7jywLiErGnaTYkxpRjdt 5sPLqs5xyRelBOr8GWcmnc4PngrFL2bIzNaH4QwZpxnUVPwcfAj/zED7TnG0ON3GQRUz gxe6gKsAnWM38h/H1PbC4kl+EX+/HTk/lID6h4nW1+T3FFIG/v0ONuaxYI8JfX8BW72t QMdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=4tYAzHvkknQ4hgjd/VYtTwglW6rZN6HiM+RorVpj8Qo=; b=X6SyHkjckxsVi/EGSmKxtLKNb5+NfaMGPCbeaElRtuyTxXKX2O0N3J9WC3ly1QXe7Y BSiU67Q0tSCcHfYZ42OIu/M3VjG6EKhL8l8SrCNPEgy53q/BxWa/uoaI37OvVsG6LN9+ a1VzF4+aqianZUDnZOsEtrkDUkcE9vUifUmd1aahy9obo3vrVCUc+hfC9vbT7qTJkwTq JdgHUwbJq3KWpuhv53E+1VwaJGb8H2EeLMe3IZu0LH62lGDOLv2y4lDdIdQePpZUfO7h teDoZ1xFRxj3qNumJMolCAXXMkx2u/FiuHXQqcdeqwLFqCKTcCliKv7DISTwXAd7gajf 5jNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nEexE3vU; 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 w16-v6si51104884plq.141.2018.06.06.02.08.49; Wed, 06 Jun 2018 02:09:03 -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; dkim=pass header.i=@kernel.org header.s=default header.b=nEexE3vU; 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 S932373AbeFFJIU (ORCPT + 99 others); Wed, 6 Jun 2018 05:08:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:55550 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932248AbeFFJIT (ORCPT ); Wed, 6 Jun 2018 05:08:19 -0400 Received: from localhost (unknown [37.173.63.40]) (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 5FAEF204EE; Wed, 6 Jun 2018 09:08:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1528276098; bh=Di2fyg2iQ+fL4A4MWdtFSoXgmeepWFLCp5MAfR+IGes=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nEexE3vUqk/jsVB9nI47e1jxHA33fd4NZ5kv8Nx/CHsGKYZ7iqHetBFTZnrr/Ojen fKJBbBYiWFB3Mk6c/LMN8eSUG604Z1dOQQMZ6qc/rZQ7NYVP7DUzA2HnKV0FLTT0Vt 3mrDjh9alhjvYiXQiWodpqOyQltIDLoVIUh1uRp0= Date: Wed, 6 Jun 2018 11:07:53 +0200 From: Greg KH To: Daniel Rosenberg Cc: Sumit Semwal , linux-kernel@vger.kernel.org, Gustavo Padovan , linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, dri-devel@lists.freedesktop.org, kernel-team@android.com, Divya Ponnusamy , stable Subject: Re: [PATCH resend] drivers: dma-buf: Change %p to %pK in debug messages Message-ID: <20180606090753.GA27744@kroah.com> References: <20180605234041.246060-1-drosen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180605234041.246060-1-drosen@google.com> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 05, 2018 at 04:40:41PM -0700, Daniel Rosenberg wrote: > The format specifier %p can leak kernel addresses > while not valuing the kptr_restrict system settings. > Use %pK instead of %p, which also evaluates whether > kptr_restrict is set. > > Signed-off-by: Divya Ponnusamy > Signed-off-by: Daniel Rosenberg > Cc: stable > --- > drivers/dma-buf/sync_debug.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/dma-buf/sync_debug.c b/drivers/dma-buf/sync_debug.c > index c4c8ecb24aa9..d8d340542a79 100644 > --- a/drivers/dma-buf/sync_debug.c > +++ b/drivers/dma-buf/sync_debug.c > @@ -133,7 +133,7 @@ static void sync_print_sync_file(struct seq_file *s, > char buf[128]; > int i; > > - seq_printf(s, "[%p] %s: %s\n", sync_file, > + seq_printf(s, "[%pK] %s: %s\n", sync_file, This is a root-only file, right? So it's not that bad of a problem. Also, by default, all %p pointers are now hashed so what really is leaking here? And finally, why even print out a pointer at all? Why not just stick with the name and not worry about the pointer? thanks, greg k-h