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]
Message-ID: <202208130039.jwwRVomj-lkp@intel.com>
Date:   Sat, 13 Aug 2022 00:36:54 +0800
From:   kernel test robot <lkp@...el.com>
To:     Keith Busch <kbusch@...nel.org>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: [kbusch:io_uring/dma-register-v2 7/8] io_uring/io_uring.c:3791:45:
 error: passing argument 2 of 'file_dma_map' from incompatible pointer type

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/kbusch/linux.git io_uring/dma-register-v2
head:   c86a9580d33ff9bf90c685f452b66b929f1dc5fe
commit: ba3ab9f0c82ae764b7da4cb7e8df548439b2ec72 [7/8] io_uring: add support for dma pre-mapping
config: sh-randconfig-c043-20220811 (https://download.01.org/0day-ci/archive/20220813/202208130039.jwwRVomj-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 12.1.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/kbusch/linux.git/commit/?id=ba3ab9f0c82ae764b7da4cb7e8df548439b2ec72
        git remote add kbusch https://git.kernel.org/pub/scm/linux/kernel/git/kbusch/linux.git
        git fetch --no-tags kbusch io_uring/dma-register-v2
        git checkout ba3ab9f0c82ae764b7da4cb7e8df548439b2ec72
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=sh SHELL=/bin/bash

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

All errors (new ones prefixed by >>):

   In file included from include/uapi/linux/aio_abi.h:31,
                    from include/linux/syscalls.h:77,
                    from io_uring/io_uring.c:45:
   include/linux/fs.h:3610:60: warning: 'struct bio_vec' declared inside parameter list will not be visible outside of this definition or declaration
    3610 | static inline void *file_dma_map(struct file *file, struct bio_vec *bvec,
         |                                                            ^~~~~~~
   io_uring/io_uring.c: In function '__io_submit_flush_completions':
   io_uring/io_uring.c:1183:40: warning: variable 'prev' set but not used [-Wunused-but-set-variable]
    1183 |         struct io_wq_work_node *node, *prev;
         |                                        ^~~~
   io_uring/io_uring.c: In function 'io_register_map_buffers':
>> io_uring/io_uring.c:3791:45: error: passing argument 2 of 'file_dma_map' from incompatible pointer type [-Werror=incompatible-pointer-types]
    3791 |                 tag = file_dma_map(file, imu->bvec, imu->nr_bvecs);
         |                                          ~~~^~~~~~
         |                                             |
         |                                             struct bio_vec *
   include/linux/fs.h:3610:69: note: expected 'struct bio_vec *' but argument is of type 'struct bio_vec *'
    3610 | static inline void *file_dma_map(struct file *file, struct bio_vec *bvec,
         |                                                     ~~~~~~~~~~~~~~~~^~~~
   cc1: some warnings being treated as errors


vim +/file_dma_map +3791 io_uring/io_uring.c

  3758	
  3759	static int io_register_map_buffers(struct io_ring_ctx *ctx, void __user *arg)
  3760	{
  3761		struct io_uring_map_buffers map;
  3762		struct io_fixed_file *file_slot;
  3763		struct file *file;
  3764		int ret, i;
  3765	
  3766		if (!capable(CAP_SYS_ADMIN))
  3767			return -EPERM;
  3768	
  3769		ret = get_map_range(ctx, &map, arg);
  3770		if (ret < 0)
  3771			return ret;
  3772	
  3773		file_slot = io_fixed_file_slot(&ctx->file_table,
  3774				array_index_nospec(map.fd, ctx->nr_user_files));
  3775		if (!file_slot->file_ptr)
  3776			return -EBADF;
  3777	
  3778		file = io_file_from_fixed(file_slot);
  3779		if (!(file->f_flags & O_DIRECT))
  3780			return -EOPNOTSUPP;
  3781	
  3782		for (i = map.buf_start; i < map.buf_end; i++) {
  3783			struct io_mapped_ubuf *imu = ctx->user_bufs[i];
  3784			void *tag;
  3785	
  3786			if (imu->dma_tag) {
  3787				ret = -EBUSY;
  3788				goto err;
  3789			}
  3790	
> 3791			tag = file_dma_map(file, imu->bvec, imu->nr_bvecs);
  3792			if (IS_ERR(tag)) {
  3793				ret = PTR_ERR(tag);
  3794				goto err;
  3795			}
  3796	
  3797			imu->dma_tag = tag;
  3798			imu->dma_file = file;
  3799		}
  3800	
  3801		return 0;
  3802	err:
  3803		while (--i >= map.buf_start) {
  3804			struct io_mapped_ubuf *imu = ctx->user_bufs[i];
  3805	
  3806			io_dma_unmap(imu);
  3807		}
  3808		return ret;
  3809	}
  3810	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ