tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: cbfb00d89c3b9971c3f0732b4f34d4e674bff5d8 commit: 8a6bee347626968d467aef07453c4547bc23cb64 [5704/30000] blk-mq: fix potential uaf for 'queue_hw_ctx' config: x86_64-randconfig-122-20240910 (https://download.01.org/0day-ci/archive/20240910/202409102355.6lrxEzuT-lkp@i...) compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240910/202409102355.6lrxEzuT-lkp@i...)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot lkp@intel.com | Closes: https://lore.kernel.org/oe-kbuild-all/202409102355.6lrxEzuT-lkp@intel.com/
sparse warnings: (new ones prefixed by >>) block/blk-mq-sched.c: note: in included file:
include/linux/blk-mq.h:620:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu *[noderef] __rcu * include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu **
include/linux/blk-mq.h:620:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu *[noderef] __rcu * include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu **
include/linux/blk-mq.h:620:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu *[noderef] __rcu * include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu **
include/linux/blk-mq.h:620:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu *[noderef] __rcu * include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu **
include/linux/blk-mq.h:620:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu *[noderef] __rcu * include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu ** --
block/blk-mq-sysfs.c:339:55: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct blk_mq_hw_ctx *hctx @@ got struct blk_mq_hw_ctx [noderef] __rcu * @@
block/blk-mq-sysfs.c:339:55: sparse: expected struct blk_mq_hw_ctx *hctx block/blk-mq-sysfs.c:339:55: sparse: got struct blk_mq_hw_ctx [noderef] __rcu * block/blk-mq-sysfs.c: note: in included file:
include/linux/blk-mq.h:620:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu *[noderef] __rcu * include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu **
include/linux/blk-mq.h:620:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu *[noderef] __rcu * include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu **
include/linux/blk-mq.h:620:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu *[noderef] __rcu * include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu **
include/linux/blk-mq.h:620:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu *[noderef] __rcu * include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu ** -- block/blk-sysfs.c: note: in included file:
include/linux/blk-mq.h:620:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu *[noderef] __rcu * include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu ** -- block/blk-mq-tag.c: note: in included file:
include/linux/blk-mq.h:620:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu *[noderef] __rcu * include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu ** --
block/blk-mq.c:485:19: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct blk_mq_hw_ctx *hctx @@ got struct blk_mq_hw_ctx [noderef] __rcu * @@
block/blk-mq.c:485:19: sparse: expected struct blk_mq_hw_ctx *hctx block/blk-mq.c:485:19: sparse: got struct blk_mq_hw_ctx [noderef] __rcu *
block/blk-mq.c:3270:41: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct blk_mq_hw_ctx **hctxs @@ got struct blk_mq_hw_ctx [noderef] __rcu **queue_hw_ctx @@
block/blk-mq.c:3270:41: sparse: expected struct blk_mq_hw_ctx **hctxs block/blk-mq.c:3270:41: sparse: got struct blk_mq_hw_ctx [noderef] __rcu **queue_hw_ctx
block/blk-mq.c:3284:17: sparse: sparse: incompatible types in comparison expression (different address spaces):
block/blk-mq.c:3284:17: sparse: struct blk_mq_hw_ctx [noderef] __rcu *[noderef] __rcu * block/blk-mq.c:3284:17: sparse: struct blk_mq_hw_ctx [noderef] __rcu ** block/blk-mq.c:4033:14: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct blk_mq_hw_ctx *hctx @@ got struct blk_mq_hw_ctx [noderef] __rcu * @@ block/blk-mq.c: note: in included file:
include/linux/blk-mq.h:620:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu *[noderef] __rcu * include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu **
include/linux/blk-mq.h:620:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu *[noderef] __rcu * include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu **
include/linux/blk-mq.h:620:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu *[noderef] __rcu * include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu **
include/linux/blk-mq.h:620:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu *[noderef] __rcu * include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu **
include/linux/blk-mq.h:620:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu *[noderef] __rcu * include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu **
include/linux/blk-mq.h:620:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu *[noderef] __rcu * include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu **
include/linux/blk-mq.h:620:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu *[noderef] __rcu * include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu **
include/linux/blk-mq.h:620:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu *[noderef] __rcu * include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu **
include/linux/blk-mq.h:620:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu *[noderef] __rcu * include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu **
include/linux/blk-mq.h:620:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu *[noderef] __rcu * include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu **
include/linux/blk-mq.h:620:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu *[noderef] __rcu * include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu **
include/linux/blk-mq.h:620:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu *[noderef] __rcu * include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu **
include/linux/blk-mq.h:620:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu *[noderef] __rcu * include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu **
include/linux/blk-mq.h:620:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu *[noderef] __rcu * include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu **
include/linux/blk-mq.h:620:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu *[noderef] __rcu * include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu **
include/linux/blk-mq.h:620:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu *[noderef] __rcu * include/linux/blk-mq.h:620:18: sparse: struct blk_mq_hw_ctx [noderef] __rcu **
vim +620 include/linux/blk-mq.h
614 615 static inline struct blk_mq_hw_ctx *queue_hctx(struct request_queue *q, int id) 616 { 617 struct blk_mq_hw_ctx *hctx; 618 619 rcu_read_lock();
620 hctx = *(rcu_dereference(q->queue_hw_ctx) + id);
621 rcu_read_unlock(); 622 623 return hctx; 624 } 625