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: <202203172252.S8ZtTgQG-lkp@intel.com>
Date:   Thu, 17 Mar 2022 22:40:22 +0800
From:   kernel test robot <lkp@...el.com>
To:     Jens Axboe <axboe@...nel.dk>
Cc:     kbuild-all@...ts.01.org,
        GNU/Weeb Mailing List <gwml@...r.gnuweeb.org>,
        linux-kernel@...r.kernel.org
Subject: [ammarfaizi2-block:axboe/linux-block/for-5.18/io_uring 30/39]
 fs/io_uring.c:5879:68: sparse: sparse: incorrect type in initializer
 (different base types)

tree:   https://github.com/ammarfaizi2/linux-block axboe/linux-block/for-5.18/io_uring
head:   9aa8dfde4869ccdec0a7290b686dbc10e079e163
commit: 81459350d581e958ee9c6e76031f77333881c23c [30/39] io_uring: cache req->apoll->events in req->cflags
config: alpha-randconfig-s031-20220317 (https://download.01.org/0day-ci/archive/20220317/202203172252.S8ZtTgQG-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 11.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://github.com/ammarfaizi2/linux-block/commit/81459350d581e958ee9c6e76031f77333881c23c
        git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
        git fetch --no-tags ammarfaizi2-block axboe/linux-block/for-5.18/io_uring
        git checkout 81459350d581e958ee9c6e76031f77333881c23c
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=alpha SHELL=/bin/bash

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


sparse warnings: (new ones prefixed by >>)
   fs/io_uring.c:3389:24: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void [noderef] __user * @@     got struct io_buffer *[assigned] kbuf @@
   fs/io_uring.c:3389:24: sparse:     expected void [noderef] __user *
   fs/io_uring.c:3389:24: sparse:     got struct io_buffer *[assigned] kbuf
   fs/io_uring.c:5041:14: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct file *file @@     got struct file [noderef] __rcu * @@
   fs/io_uring.c:5041:14: sparse:     expected struct file *file
   fs/io_uring.c:5041:14: sparse:     got struct file [noderef] __rcu *
>> fs/io_uring.c:5879:68: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __poll_t [usertype] _key @@     got unsigned int [usertype] cflags @@
   fs/io_uring.c:5879:68: sparse:     expected restricted __poll_t [usertype] _key
   fs/io_uring.c:5879:68: sparse:     got unsigned int [usertype] cflags
   fs/io_uring.c:5881:47: sparse: sparse: restricted __poll_t degrades to integer
   fs/io_uring.c:5885:52: sparse: sparse: restricted __poll_t degrades to integer
   fs/io_uring.c:5886:71: sparse: sparse: restricted __poll_t degrades to integer
   fs/io_uring.c:5886:65: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected restricted __poll_t [usertype] val @@     got unsigned int @@
   fs/io_uring.c:5886:65: sparse:     expected restricted __poll_t [usertype] val
   fs/io_uring.c:5886:65: sparse:     got unsigned int
   fs/io_uring.c:5886:52: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __poll_t [usertype] mask @@     got unsigned short @@
   fs/io_uring.c:5886:52: sparse:     expected restricted __poll_t [usertype] mask
   fs/io_uring.c:5886:52: sparse:     got unsigned short
   fs/io_uring.c:5890:71: sparse: sparse: incorrect type in argument 3 (different base types) @@     expected signed int [usertype] res @@     got restricted __poll_t [usertype] mask @@
   fs/io_uring.c:5890:71: sparse:     expected signed int [usertype] res
   fs/io_uring.c:5890:71: sparse:     got restricted __poll_t [usertype] mask
   fs/io_uring.c:5921:66: sparse: sparse: restricted __poll_t degrades to integer
   fs/io_uring.c:5921:55: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected restricted __poll_t [usertype] val @@     got unsigned int @@
   fs/io_uring.c:5921:55: sparse:     expected restricted __poll_t [usertype] val
   fs/io_uring.c:5921:55: sparse:     got unsigned int
   fs/io_uring.c:5999:45: sparse: sparse: incorrect type in argument 3 (different base types) @@     expected int events @@     got restricted __poll_t [usertype] events @@
   fs/io_uring.c:5999:45: sparse:     expected int events
   fs/io_uring.c:5999:45: sparse:     got restricted __poll_t [usertype] events
   fs/io_uring.c:6030:40: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected int mask @@     got restricted __poll_t [usertype] mask @@
   fs/io_uring.c:6030:40: sparse:     expected int mask
   fs/io_uring.c:6030:40: sparse:     got restricted __poll_t [usertype] mask
   fs/io_uring.c:6030:50: sparse: sparse: incorrect type in argument 3 (different base types) @@     expected int events @@     got restricted __poll_t [usertype] events @@
   fs/io_uring.c:6030:50: sparse:     expected int events
   fs/io_uring.c:6030:50: sparse:     got restricted __poll_t [usertype] events
   fs/io_uring.c:6117:24: sparse: sparse: incorrect type in return expression (different base types) @@     expected int @@     got restricted __poll_t [assigned] [usertype] mask @@
   fs/io_uring.c:6117:24: sparse:     expected int
   fs/io_uring.c:6117:24: sparse:     got restricted __poll_t [assigned] [usertype] mask
   fs/io_uring.c:6134:40: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected int mask @@     got restricted __poll_t [assigned] [usertype] mask @@
   fs/io_uring.c:6134:40: sparse:     expected int mask
   fs/io_uring.c:6134:40: sparse:     got restricted __poll_t [assigned] [usertype] mask
   fs/io_uring.c:6134:50: sparse: sparse: incorrect type in argument 3 (different base types) @@     expected int events @@     got restricted __poll_t [usertype] events @@
   fs/io_uring.c:6134:50: sparse:     expected int events
   fs/io_uring.c:6134:50: sparse:     got restricted __poll_t [usertype] events
   fs/io_uring.c:6145:47: sparse: sparse: incorrect type in argument 3 (different base types) @@     expected int events @@     got restricted __poll_t [usertype] events @@
   fs/io_uring.c:6145:47: sparse:     expected int events
   fs/io_uring.c:6145:47: sparse:     got restricted __poll_t [usertype] events
   fs/io_uring.c:6170:25: sparse: sparse: restricted __poll_t degrades to integer
   fs/io_uring.c:6170:48: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __poll_t [usertype] mask @@     got unsigned int @@
   fs/io_uring.c:6170:48: sparse:     expected restricted __poll_t [usertype] mask
   fs/io_uring.c:6170:48: sparse:     got unsigned int
   fs/io_uring.c:6179:22: sparse: sparse: invalid assignment: |=
   fs/io_uring.c:6179:22: sparse:    left side has type restricted __poll_t
   fs/io_uring.c:6179:22: sparse:    right side has type int
   fs/io_uring.c:6184:30: sparse: sparse: invalid assignment: &=
   fs/io_uring.c:6184:30: sparse:    left side has type restricted __poll_t
   fs/io_uring.c:6184:30: sparse:    right side has type int
   fs/io_uring.c:6186:22: sparse: sparse: invalid assignment: |=
   fs/io_uring.c:6186:22: sparse:    left side has type restricted __poll_t
   fs/io_uring.c:6186:22: sparse:    right side has type int
   fs/io_uring.c:6209:33: sparse: sparse: incorrect type in argument 5 (different base types) @@     expected int mask @@     got restricted __poll_t [usertype] mask @@
   fs/io_uring.c:6209:33: sparse:     expected int mask
   fs/io_uring.c:6209:33: sparse:     got restricted __poll_t [usertype] mask
   fs/io_uring.c:6209:50: sparse: sparse: incorrect type in argument 6 (different base types) @@     expected int events @@     got restricted __poll_t [usertype] events @@
   fs/io_uring.c:6209:50: sparse:     expected int events
   fs/io_uring.c:6209:50: sparse:     got restricted __poll_t [usertype] events
   fs/io_uring.c:6290:24: sparse: sparse: invalid assignment: |=
   fs/io_uring.c:6290:24: sparse:    left side has type unsigned int
   fs/io_uring.c:6290:24: sparse:    right side has type restricted __poll_t
   fs/io_uring.c:6291:65: sparse: sparse: restricted __poll_t degrades to integer
   fs/io_uring.c:6291:29: sparse: sparse: restricted __poll_t degrades to integer
   fs/io_uring.c:6291:38: sparse: sparse: incorrect type in return expression (different base types) @@     expected restricted __poll_t @@     got unsigned int @@
   fs/io_uring.c:6291:38: sparse:     expected restricted __poll_t
   fs/io_uring.c:6291:38: sparse:     got unsigned int
>> fs/io_uring.c:6343:21: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] cflags @@     got restricted __poll_t [usertype] events @@
   fs/io_uring.c:6343:21: sparse:     expected unsigned int [usertype] cflags
   fs/io_uring.c:6343:21: sparse:     got restricted __poll_t [usertype] events
   fs/io_uring.c:6381:43: sparse: sparse: invalid assignment: &=
   fs/io_uring.c:6381:43: sparse:    left side has type restricted __poll_t
   fs/io_uring.c:6381:43: sparse:    right side has type int
   fs/io_uring.c:6382:62: sparse: sparse: restricted __poll_t degrades to integer
   fs/io_uring.c:6382:43: sparse: sparse: invalid assignment: |=
   fs/io_uring.c:6382:43: sparse:    left side has type restricted __poll_t
   fs/io_uring.c:6382:43: sparse:    right side has type unsigned int
   fs/io_uring.c:2406:17: sparse: sparse: context imbalance in 'handle_prev_tw_list' - different lock contexts for basic block
   fs/io_uring.c:8569:9: sparse: sparse: context imbalance in 'io_sq_thread_unpark' - wrong count at exit
   fs/io_uring.c:8580:9: sparse: sparse: context imbalance in 'io_sq_thread_park' - wrong count at exit

vim +5879 fs/io_uring.c

  5850	
  5851	/*
  5852	 * All poll tw should go through this. Checks for poll events, manages
  5853	 * references, does rewait, etc.
  5854	 *
  5855	 * Returns a negative error on failure. >0 when no action require, which is
  5856	 * either spurious wakeup or multishot CQE is served. 0 when it's done with
  5857	 * the request, then the mask is stored in req->result.
  5858	 */
  5859	static int io_poll_check_events(struct io_kiocb *req)
  5860	{
  5861		struct io_ring_ctx *ctx = req->ctx;
  5862		struct io_poll_iocb *poll = io_poll_get_single(req);
  5863		int v;
  5864	
  5865		/* req->task == current here, checking PF_EXITING is safe */
  5866		if (unlikely(req->task->flags & PF_EXITING))
  5867			io_poll_mark_cancelled(req);
  5868	
  5869		do {
  5870			v = atomic_read(&req->poll_refs);
  5871	
  5872			/* tw handler should be the owner, and so have some references */
  5873			if (WARN_ON_ONCE(!(v & IO_POLL_REF_MASK)))
  5874				return 0;
  5875			if (v & IO_POLL_CANCEL_FLAG)
  5876				return -ECANCELED;
  5877	
  5878			if (!req->result) {
> 5879				struct poll_table_struct pt = { ._key = req->cflags };
  5880	
  5881				req->result = vfs_poll(req->file, &pt) & req->cflags;
  5882			}
  5883	
  5884			/* multishot, just fill an CQE and proceed */
  5885			if (req->result && !(req->cflags & EPOLLONESHOT)) {
  5886				__poll_t mask = mangle_poll(req->result & poll->events);
  5887				bool filled;
  5888	
  5889				spin_lock(&ctx->completion_lock);
  5890				filled = io_fill_cqe_aux(ctx, req->user_data, mask,
  5891							 IORING_CQE_F_MORE);
  5892				io_commit_cqring(ctx);
  5893				spin_unlock(&ctx->completion_lock);
  5894				if (unlikely(!filled))
  5895					return -ECANCELED;
  5896				io_cqring_ev_posted(ctx);
  5897				io_add_napi(req->file, ctx);
  5898			} else if (req->result) {
  5899				return 0;
  5900			}
  5901	
  5902			/*
  5903			 * Release all references, retry if someone tried to restart
  5904			 * task_work while we were executing it.
  5905			 */
  5906		} while (atomic_sub_return(v & IO_POLL_REF_MASK, &req->poll_refs));
  5907	
  5908		return 1;
  5909	}
  5910	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ