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>] [day] [month] [year] [list]
Date:   Fri, 8 Oct 2021 05:07:43 +0800
From:   kernel test robot <lkp@...el.com>
To:     Kanchan Joshi <joshi.k@...sung.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Jens Axboe <axboe@...nel.dk>, Anuj Gupta <anuj20.g@...sung.com>
Subject: [axboe-block:nvme-passthru-wip 10/19]
 drivers/nvme/host/ioctl.c:47:19: warning: cast to pointer from integer of
 different size

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git nvme-passthru-wip
head:   9c18980ac90053bcdb21594eae48935d89bf389c
commit: 5cc445dd8df6e06f3482711aa590170450364393 [10/19] nvme: wire-up support for async-passthru on char-device.
config: sparc-buildonly-randconfig-r006-20211007 (attached as .config)
compiler: sparc-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/commit/?id=5cc445dd8df6e06f3482711aa590170450364393
        git remote add axboe-block https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
        git fetch --no-tags axboe-block nvme-passthru-wip
        git checkout 5cc445dd8df6e06f3482711aa590170450364393
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=sparc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

   drivers/nvme/host/ioctl.c: In function 'nvme_pt_task_cb':
>> drivers/nvme/host/ioctl.c:47:19: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      47 |         ptcmd64 = (void __user *) bcmd->unused2[0];
         |                   ^
   drivers/nvme/host/ioctl.c:62:58: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      62 |                 struct nvme_passthru_cmd __user *ptcmd = (void *)bcmd->unused2[0];
         |                                                          ^
   drivers/nvme/host/ioctl.c: In function 'nvme_ns_async_ioctl':
   drivers/nvme/host/ioctl.c:472:29: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     472 |         void __user *argp = (void __user *) bcmd->unused2[0];
         |                             ^


vim +47 drivers/nvme/host/ioctl.c

    39	
    40	static void nvme_pt_task_cb(struct io_uring_cmd *ioucmd)
    41	{
    42		struct uring_cmd_data *ucd;
    43		struct nvme_passthru_cmd64 __user *ptcmd64 = NULL;
    44		struct block_uring_cmd *bcmd;
    45	
    46		bcmd = (struct block_uring_cmd *) &ioucmd->pdu;
  > 47		ptcmd64 = (void __user *) bcmd->unused2[0];
    48		ucd = (struct uring_cmd_data *) nvme_ioucmd_data_addr(ioucmd);
    49	
    50		if (ucd->meta) {
    51			void __user *umeta = nvme_to_user_ptr(ptcmd64->metadata);
    52	
    53			if (!ucd->status)
    54				if (copy_to_user(umeta, ucd->meta, ptcmd64->metadata_len))
    55					ucd->status = -EFAULT;
    56			kfree(ucd->meta);
    57		}
    58		if (likely(bcmd->ioctl_cmd == NVME_IOCTL_IO64_CMD)) {
    59			if (put_user(ucd->result, &ptcmd64->result))
    60				ucd->status = -EFAULT;
    61		} else {
    62			struct nvme_passthru_cmd __user *ptcmd = (void *)bcmd->unused2[0];
    63	
    64			if (put_user(ucd->result, &ptcmd->result))
    65				ucd->status = -EFAULT;
    66		}
    67		io_uring_cmd_done(ioucmd, ucd->status);
    68	}
    69	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Download attachment ".config.gz" of type "application/gzip" (28720 bytes)

Powered by blists - more mailing lists