Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp1863083imm; Fri, 6 Jul 2018 07:50:39 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe6yz+rGSLHILogHopMDGJqiuvwigmAvBKMCQyP/OPMb+gvIWMmOkm3wT1fBuingoMhgI1X X-Received: by 2002:a63:6004:: with SMTP id u4-v6mr9638175pgb.441.1530888639755; Fri, 06 Jul 2018 07:50:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530888639; cv=none; d=google.com; s=arc-20160816; b=i8laa0Ntk9PgDqcVfWIJfLGeI9Vdf7nL+3YfQmO4p+k3EH7/BtGfZJPAz2atOSycK9 sbr7edQ4FiSR96DtoutRSnaDm0x7KNsD3ysM5tQZmltcszx/rcvktWC2NNsdhTUHH3le vEeDr2N5tli7B7nvFpHCXBETvd5eYg2E+BNiwmnkUq5izdW+8+uMX3CErZow348SQin9 JeicG1OkSmGZGhokx5vBFb2Z7T9TQK9Pxq1UX3wYgxcObXl8oPjCn5Uf+fKhsLcm7Fdd Q3xBG+CaoONBwB/N0E+0W+mwtFvkVEOwaTd3HnJrYJsfmylEv8k4xlVYt4LygUyAyPTx YHrA== 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=IHzx3X8YjemCar87EqvwMxrRzV48hf8QYmN2NRwI3SQ=; b=z/SXyJBYLBKJrJn3dgeBBhP/Xbz79uiKEGUpX0b4zIH02nSwqUYhhciEs9lI+9JaHO Go6ovoB+N5iC4eFbt2dwG7SiPQO0c8JQ6vqhugPE6q5oEOPw1QD458CyCHxi+Xyao8mz d94G8XPU/Sxzcx3IpXZ2zOCKdcd7hPhUgN/CaLrnkZ5t+SN4yKjmYjhk2ZypSMBsUaXi c/THrkPK8G+qjRFwTe7OJVAfYE6lpUgieNfHNqfmdOz9gVJporlrFqdxdyGwtGu/5L+S RTl0740SfhU9asz6pwWGpkJQlo4VqS53ZTcfMwxtkv3w2bJ6QX699ZKYNIb3Akk9sDhz T5DQ== 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 a12-v6si7706879pgv.296.2018.07.06.07.50.25; Fri, 06 Jul 2018 07:50:39 -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 S933102AbeGFOru (ORCPT + 99 others); Fri, 6 Jul 2018 10:47:50 -0400 Received: from mail.bootlin.com ([62.4.15.54]:60635 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932516AbeGFOrt (ORCPT ); Fri, 6 Jul 2018 10:47:49 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 275B220734; Fri, 6 Jul 2018 16:47:47 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (AAubervilliers-681-1-12-56.w90-88.abo.wanadoo.fr [90.88.133.56]) by mail.bootlin.com (Postfix) with ESMTPSA id B9C64208EF; Fri, 6 Jul 2018 16:47:31 +0200 (CEST) Date: Fri, 6 Jul 2018 16:47:32 +0200 From: Boris Brezillon To: Richard Weinberger Cc: Benjamin Gaignard , marek.vasut@gmail.com, dwmw2@infradead.org, computersforpeace@gmail.com, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Benjamin Gaignard Subject: Re: [PATCH] mtd: stm32-quadspi: replace "%p" with "%pK" Message-ID: <20180706164732.5776df5a@bbrezillon> In-Reply-To: <32602293.7BQn8HeLUA@blindfold> References: <20180706130525.22223-1-benjamin.gaignard@st.com> <32602293.7BQn8HeLUA@blindfold> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; 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 Fri, 06 Jul 2018 16:44:44 +0200 Richard Weinberger wrote: > Am Freitag, 6. Juli 2018, 15:05:25 CEST schrieb Benjamin Gaignard: > > The format specifier "%p" can leak kernel addresses. > > Use "%pK" instead. > > Does %pK really make sense for dev_dbg()? > When the driver is being debugged "leaking" is on purpose. :) %p already gives you a hash of the pointer address. At least with %pK you can turn it off through a sysctl :). > > Thanks, > //richard > > > Signed-off-by: Benjamin Gaignard > > --- > > drivers/mtd/spi-nor/stm32-quadspi.c | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/mtd/spi-nor/stm32-quadspi.c b/drivers/mtd/spi-nor/stm32-quadspi.c > > index 72553506a00b..13e9fc961d3b 100644 > > --- a/drivers/mtd/spi-nor/stm32-quadspi.c > > +++ b/drivers/mtd/spi-nor/stm32-quadspi.c > > @@ -355,7 +355,7 @@ static int stm32_qspi_read_reg(struct spi_nor *nor, > > struct device *dev = flash->qspi->dev; > > struct stm32_qspi_cmd cmd; > > > > - dev_dbg(dev, "read_reg: cmd:%#.2x buf:%p len:%#x\n", opcode, buf, len); > > + dev_dbg(dev, "read_reg: cmd:%#.2x buf:%pK len:%#x\n", opcode, buf, len); > > > > memset(&cmd, 0, sizeof(cmd)); > > cmd.opcode = opcode; > > @@ -376,7 +376,7 @@ static int stm32_qspi_write_reg(struct spi_nor *nor, u8 opcode, > > struct device *dev = flash->qspi->dev; > > struct stm32_qspi_cmd cmd; > > > > - dev_dbg(dev, "write_reg: cmd:%#.2x buf:%p len:%#x\n", opcode, buf, len); > > + dev_dbg(dev, "write_reg: cmd:%#.2x buf:%pK len:%#x\n", opcode, buf, len); > > > > memset(&cmd, 0, sizeof(cmd)); > > cmd.opcode = opcode; > > @@ -398,7 +398,7 @@ static ssize_t stm32_qspi_read(struct spi_nor *nor, loff_t from, size_t len, > > struct stm32_qspi_cmd cmd; > > int err; > > > > - dev_dbg(qspi->dev, "read(%#.2x): buf:%p from:%#.8x len:%#zx\n", > > + dev_dbg(qspi->dev, "read(%#.2x): buf:%pK from:%#.8x len:%#zx\n", > > nor->read_opcode, buf, (u32)from, len); > > > > memset(&cmd, 0, sizeof(cmd)); > > > >