Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp1858198imm; Fri, 6 Jul 2018 07:45:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf9tJBdtsoIk8vts7g6MuPWA6uEVytdA1Poh3QqI9GxW69n5vAz45/7lGLWCUCOZDTCWUWY X-Received: by 2002:a17:902:b587:: with SMTP id a7-v6mr10821047pls.225.1530888340843; Fri, 06 Jul 2018 07:45:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530888340; cv=none; d=google.com; s=arc-20160816; b=nD17hJE3nvumpkogWFliUx3LNu/gJT60ZNV3qtxsLTft7B8k4/YLiDyhnddNLHikc2 nP17eEPZTsDahp7+wR/M7pIIjEVcTq0LUak8zE2P0r+GrXpB+Tr1DrVmp75ofOr0bdl8 lMhx5lMhVTdXOYMgYkFQVrmZsH5CvMM7Tq1oD/b5PE/e1FnlIyksWIslgEMqfMKApjH1 12XFd+LSi4AOuRDyHvgNJhkrDYNgjIzj4y0jNdlNpHqsSx6TTX9wOP7l/VQ75otJ7xYE ff5rZW4zF/dbGruJptCDtbtWc1iW4Ynr9KsywTAovKj3tTPXARE3Y9yX1lDySVP0ZQbC CwNg== 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:date:subject:cc:to:from :arc-authentication-results; bh=PKgToOqR4YfuyWgjsgDiDWKP0GrQqg4oArw5zR4APjk=; b=yNdvOpGHPeZYMduLQWUtu+f8eka8bPVr6XtwQV/ATYkq+1e3y1dmdPN/5SlmpG92fd /MjKQAw34J3Ivxv7UL+fNk5m9AEOHS2W8ROWim7bbdEsMDqmjY+JwGGEAXiugx/91NaW 1dH+mJlA3svPxWVOM3fOdHzwltK5HE3M3pKirbNBDhsT1J/bPobHyavi16o/lv6aPYEB b+tryy/UDPBSCKg7pMKwwrtGrtMit3DLmj1hUdM7kFUneGlRAze8GKy1YsWWRbxNgdv2 Jgo20RUW2JbChVLskTmy9M6YT8w86N6h0Yje+hGMaUQsRgL/HZYKmSt7JUPmYaHlBkhW g8wA== 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 h4-v6si7704466pgs.201.2018.07.06.07.45.26; Fri, 06 Jul 2018 07:45:40 -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 S933060AbeGFOor (ORCPT + 99 others); Fri, 6 Jul 2018 10:44:47 -0400 Received: from lithops.sigma-star.at ([195.201.40.130]:33008 "EHLO lithops.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932352AbeGFOoq (ORCPT ); Fri, 6 Jul 2018 10:44:46 -0400 Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id C6A8A6093339; Fri, 6 Jul 2018 16:44:45 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id DvSI3GZWKt_C; Fri, 6 Jul 2018 16:44:45 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 72558609333C; Fri, 6 Jul 2018 16:44:45 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id uRjBrUWut8Pc; Fri, 6 Jul 2018 16:44:45 +0200 (CEST) Received: from blindfold.localnet (213-47-184-186.cable.dynamic.surfer.at [213.47.184.186]) by lithops.sigma-star.at (Postfix) with ESMTPSA id 49DE66093339; Fri, 6 Jul 2018 16:44:45 +0200 (CEST) From: Richard Weinberger To: Benjamin Gaignard Cc: marek.vasut@gmail.com, dwmw2@infradead.org, computersforpeace@gmail.com, boris.brezillon@bootlin.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" Date: Fri, 06 Jul 2018 16:44:44 +0200 Message-ID: <32602293.7BQn8HeLUA@blindfold> In-Reply-To: <20180706130525.22223-1-benjamin.gaignard@st.com> References: <20180706130525.22223-1-benjamin.gaignard@st.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. :) 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)); >