lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d228bf5d-24e3-4fd1-a2eb-f54395697907@infradead.org>
Date:   Thu, 7 Dec 2023 16:30:27 -0800
From:   Randy Dunlap <rdunlap@...radead.org>
To:     Arnd Bergmann <arnd@...nel.org>,
        Sathya Prakash Veerichetty <sathya.prakash@...adcom.com>,
        Kashyap Desai <kashyap.desai@...adcom.com>,
        Sumit Saxena <sumit.saxena@...adcom.com>,
        Sreekanth Reddy <sreekanth.reddy@...adcom.com>,
        "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        Chandrakanth patil <chandrakanth.patil@...adcom.com>
Cc:     Arnd Bergmann <arnd@...db.de>,
        Ranjan Kumar <ranjan.kumar@...adcom.com>,
        Shin'ichiro Kawasaki <shinichiro.kawasaki@....com>,
        mpi3mr-linuxdrv.pdl@...adcom.com, linux-scsi@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mpi3mr: fix printk() format strings



On 12/7/23 06:28, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
> 
> The newly introduced error messages get multiple format strings wrong: size_t must
> be printed using the %z modifier rather than %l and dma_addr_t must be printed
> by reference using the special %pad pointer type:
> 
> drivers/scsi/mpi3mr/mpi3mr_app.c: In function 'mpi3mr_build_nvme_prp':
> include/linux/kern_levels.h:5:25: error: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'dma_addr_t' {aka 'unsigned int'} [-Werror=format=]
> drivers/scsi/mpi3mr/mpi3mr_app.c:949:25: note: in expansion of macro 'dprint_bsg_err'
>   949 |                         dprint_bsg_err(mrioc,
>       |                         ^~~~~~~~~~~~~~
> include/linux/kern_levels.h:5:25: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
> drivers/scsi/mpi3mr/mpi3mr_app.c:1112:41: note: in expansion of macro 'dprint_bsg_err'
>  1112 |                                         dprint_bsg_err(mrioc,
>       |                                         ^~~~~~~~~~~~~~
> 
> Fixes: 9536af615dc9 ("scsi: mpi3mr: Support for preallocation of SGL BSG data buffers part-3")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>

LGTM. Thanks.

Acked-by: Randy Dunlap <rdunlap@...radead.org>
Tested-by: Randy Dunlap <rdunlap@...radead.org> # build-tested

> ---
>  drivers/scsi/mpi3mr/mpi3mr_app.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/mpi3mr/mpi3mr_app.c b/drivers/scsi/mpi3mr/mpi3mr_app.c
> index 4b93b7440da6..0380996b5ad2 100644
> --- a/drivers/scsi/mpi3mr/mpi3mr_app.c
> +++ b/drivers/scsi/mpi3mr/mpi3mr_app.c
> @@ -947,8 +947,8 @@ static int mpi3mr_build_nvme_prp(struct mpi3mr_ioc *mrioc,
>  		dma_addr = drv_buf_iter->dma_desc[count].dma_addr;
>  		if (dma_addr & page_mask) {
>  			dprint_bsg_err(mrioc,
> -				       "%s:dma_addr 0x%llx is not aligned with page size 0x%x\n",
> -				       __func__,  dma_addr, dev_pgsz);
> +				       "%s:dma_addr %pad is not aligned with page size 0x%x\n",
> +				       __func__,  &dma_addr, dev_pgsz);
>  			return -1;
>  		}
>  	}
> @@ -1110,7 +1110,7 @@ static int mpi3mr_build_nvme_prp(struct mpi3mr_ioc *mrioc,
>  				if ((++desc_count) >=
>  				   drv_buf_iter->num_dma_desc) {
>  					dprint_bsg_err(mrioc,
> -						       "%s: Invalid len %ld while building PRP\n",
> +						       "%s: Invalid len %zd while building PRP\n",
>  						       __func__, length);
>  					goto err_out;
>  				}

-- 
~Randy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ