All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [jpoimboe:sframe 9/10] kernel/unwind/user.c:40:30: sparse: sparse: incorrect type in argument 1 (different address spaces)
@ 2023-11-11  0:02 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2023-11-11  0:02 UTC (permalink / raw
  To: Josh Poimboeuf; +Cc: oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jpoimboe/linux.git sframe
head:   ec004e900e02c9c85cf8c89d4c26d4168a6c5d18
commit: 09460e60dd1c2f8ea1abb8d9188195db699ce76f [9/10] unwind: Introduce SFrame user space unwinding
config: x86_64-randconfig-121-20231111 (https://download.01.org/0day-ci/archive/20231111/202311110749.UZ5JGPyC-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231111/202311110749.UZ5JGPyC-lkp@intel.com/reproduce)

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/202311110749.UZ5JGPyC-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> kernel/unwind/user.c:40:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned long * @@
   kernel/unwind/user.c:40:30: sparse:     expected void const volatile [noderef] __user *ptr
   kernel/unwind/user.c:40:30: sparse:     got unsigned long *
   kernel/unwind/user.c:43:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned long * @@
   kernel/unwind/user.c:43:30: sparse:     expected void const volatile [noderef] __user *ptr
   kernel/unwind/user.c:43:30: sparse:     got unsigned long *

vim +40 kernel/unwind/user.c

bd5cff471e67cf Josh Poimboeuf 2023-11-07  14  
bd5cff471e67cf Josh Poimboeuf 2023-11-07  15  int user_unwind_next(struct user_unwind_state *state)
bd5cff471e67cf Josh Poimboeuf 2023-11-07  16  {
bd5cff471e67cf Josh Poimboeuf 2023-11-07  17  	struct user_unwind_frame _frame;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  18  	struct user_unwind_frame *frame = &_frame;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  19  	unsigned long cfa, fp, ra;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  20  	int ret = -EINVAL;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  21  
bd5cff471e67cf Josh Poimboeuf 2023-11-07  22  	if (state->done)
bd5cff471e67cf Josh Poimboeuf 2023-11-07  23  		return -EINVAL;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  24  
bd5cff471e67cf Josh Poimboeuf 2023-11-07  25  	switch (state->type) {
bd5cff471e67cf Josh Poimboeuf 2023-11-07  26  	case USER_UNWIND_TYPE_FP:
bd5cff471e67cf Josh Poimboeuf 2023-11-07  27  		frame = &fp_frame;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  28  		break;
09460e60dd1c2f Josh Poimboeuf 2023-11-08  29  	case USER_UNWIND_TYPE_SFRAME:
09460e60dd1c2f Josh Poimboeuf 2023-11-08  30  		ret = sframe_find(state->ip, frame);
09460e60dd1c2f Josh Poimboeuf 2023-11-08  31  		if (ret)
09460e60dd1c2f Josh Poimboeuf 2023-11-08  32  			goto the_end;
09460e60dd1c2f Josh Poimboeuf 2023-11-08  33  		break;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  34  	default:
bd5cff471e67cf Josh Poimboeuf 2023-11-07  35  		BUG();
bd5cff471e67cf Josh Poimboeuf 2023-11-07  36  	}
bd5cff471e67cf Josh Poimboeuf 2023-11-07  37  
bd5cff471e67cf Josh Poimboeuf 2023-11-07  38  	cfa = (frame->use_fp ? state->fp : state->sp) + frame->cfa_off;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  39  
bd5cff471e67cf Josh Poimboeuf 2023-11-07 @40  	if (frame->ra_off && get_user(ra, (unsigned long *)(cfa + frame->ra_off)))
bd5cff471e67cf Josh Poimboeuf 2023-11-07  41  		goto the_end;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  42  
bd5cff471e67cf Josh Poimboeuf 2023-11-07  43  	if (frame->fp_off && get_user(fp, (unsigned long *)(cfa + frame->fp_off)))
bd5cff471e67cf Josh Poimboeuf 2023-11-07  44  		goto the_end;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  45  
bd5cff471e67cf Josh Poimboeuf 2023-11-07  46  	state->sp = cfa;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  47  	state->ip = ra;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  48  	if (frame->fp_off)
bd5cff471e67cf Josh Poimboeuf 2023-11-07  49  		state->fp = fp;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  50  
bd5cff471e67cf Josh Poimboeuf 2023-11-07  51  	return 0;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  52  
bd5cff471e67cf Josh Poimboeuf 2023-11-07  53  the_end:
bd5cff471e67cf Josh Poimboeuf 2023-11-07  54  	state->done = true;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  55  	return ret;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  56  }
bd5cff471e67cf Josh Poimboeuf 2023-11-07  57  

:::::: The code at line 40 was first introduced by commit
:::::: bd5cff471e67cf8d2b2d3bd8db35007ccc86f6a4 unwind: Introduce generic user space unwinding interfaces

:::::: TO: Josh Poimboeuf <jpoimboe@kernel.org>
:::::: CC: Josh Poimboeuf <jpoimboe@kernel.org>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [jpoimboe:sframe 9/10] kernel/unwind/user.c:40:30: sparse: sparse: incorrect type in argument 1 (different address spaces)
@ 2023-12-01  3:50 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2023-12-01  3:50 UTC (permalink / raw
  To: Josh Poimboeuf; +Cc: oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jpoimboe/linux.git sframe
head:   ec004e900e02c9c85cf8c89d4c26d4168a6c5d18
commit: 09460e60dd1c2f8ea1abb8d9188195db699ce76f [9/10] unwind: Introduce SFrame user space unwinding
config: x86_64-randconfig-121-20231111 (https://download.01.org/0day-ci/archive/20231201/202312011113.8PrIagwQ-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231201/202312011113.8PrIagwQ-lkp@intel.com/reproduce)

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/202312011113.8PrIagwQ-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> kernel/unwind/user.c:40:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned long * @@
   kernel/unwind/user.c:40:30: sparse:     expected void const volatile [noderef] __user *ptr
   kernel/unwind/user.c:40:30: sparse:     got unsigned long *
   kernel/unwind/user.c:43:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned long * @@
   kernel/unwind/user.c:43:30: sparse:     expected void const volatile [noderef] __user *ptr
   kernel/unwind/user.c:43:30: sparse:     got unsigned long *

vim +40 kernel/unwind/user.c

bd5cff471e67cf Josh Poimboeuf 2023-11-07  14  
bd5cff471e67cf Josh Poimboeuf 2023-11-07  15  int user_unwind_next(struct user_unwind_state *state)
bd5cff471e67cf Josh Poimboeuf 2023-11-07  16  {
bd5cff471e67cf Josh Poimboeuf 2023-11-07  17  	struct user_unwind_frame _frame;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  18  	struct user_unwind_frame *frame = &_frame;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  19  	unsigned long cfa, fp, ra;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  20  	int ret = -EINVAL;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  21  
bd5cff471e67cf Josh Poimboeuf 2023-11-07  22  	if (state->done)
bd5cff471e67cf Josh Poimboeuf 2023-11-07  23  		return -EINVAL;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  24  
bd5cff471e67cf Josh Poimboeuf 2023-11-07  25  	switch (state->type) {
bd5cff471e67cf Josh Poimboeuf 2023-11-07  26  	case USER_UNWIND_TYPE_FP:
bd5cff471e67cf Josh Poimboeuf 2023-11-07  27  		frame = &fp_frame;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  28  		break;
09460e60dd1c2f Josh Poimboeuf 2023-11-08  29  	case USER_UNWIND_TYPE_SFRAME:
09460e60dd1c2f Josh Poimboeuf 2023-11-08  30  		ret = sframe_find(state->ip, frame);
09460e60dd1c2f Josh Poimboeuf 2023-11-08  31  		if (ret)
09460e60dd1c2f Josh Poimboeuf 2023-11-08  32  			goto the_end;
09460e60dd1c2f Josh Poimboeuf 2023-11-08  33  		break;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  34  	default:
bd5cff471e67cf Josh Poimboeuf 2023-11-07  35  		BUG();
bd5cff471e67cf Josh Poimboeuf 2023-11-07  36  	}
bd5cff471e67cf Josh Poimboeuf 2023-11-07  37  
bd5cff471e67cf Josh Poimboeuf 2023-11-07  38  	cfa = (frame->use_fp ? state->fp : state->sp) + frame->cfa_off;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  39  
bd5cff471e67cf Josh Poimboeuf 2023-11-07 @40  	if (frame->ra_off && get_user(ra, (unsigned long *)(cfa + frame->ra_off)))
bd5cff471e67cf Josh Poimboeuf 2023-11-07  41  		goto the_end;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  42  
bd5cff471e67cf Josh Poimboeuf 2023-11-07  43  	if (frame->fp_off && get_user(fp, (unsigned long *)(cfa + frame->fp_off)))
bd5cff471e67cf Josh Poimboeuf 2023-11-07  44  		goto the_end;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  45  
bd5cff471e67cf Josh Poimboeuf 2023-11-07  46  	state->sp = cfa;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  47  	state->ip = ra;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  48  	if (frame->fp_off)
bd5cff471e67cf Josh Poimboeuf 2023-11-07  49  		state->fp = fp;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  50  
bd5cff471e67cf Josh Poimboeuf 2023-11-07  51  	return 0;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  52  
bd5cff471e67cf Josh Poimboeuf 2023-11-07  53  the_end:
bd5cff471e67cf Josh Poimboeuf 2023-11-07  54  	state->done = true;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  55  	return ret;
bd5cff471e67cf Josh Poimboeuf 2023-11-07  56  }
bd5cff471e67cf Josh Poimboeuf 2023-11-07  57  

:::::: The code at line 40 was first introduced by commit
:::::: bd5cff471e67cf8d2b2d3bd8db35007ccc86f6a4 unwind: Introduce generic user space unwinding interfaces

:::::: TO: Josh Poimboeuf <jpoimboe@kernel.org>
:::::: CC: Josh Poimboeuf <jpoimboe@kernel.org>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-01  3:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-11  0:02 [jpoimboe:sframe 9/10] kernel/unwind/user.c:40:30: sparse: sparse: incorrect type in argument 1 (different address spaces) kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2023-12-01  3:50 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.