From: kernel test robot <lkp@intel.com>
To: Qing Zhang <zhangqing@loongson.cn>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Huacai Chen <chenhuacai@kernel.org>
Subject: arch/loongarch/kernel/stacktrace.c:47:25: sparse: sparse: incorrect type in assignment (different address spaces)
Date: Sat, 1 Jul 2023 18:58:26 +0800 [thread overview]
Message-ID: <202307011821.uIMwFiL1-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: a507db1d8fdc39802415e4d2ef6d1aecd67927fa
commit: 4d7bf939df08218e682f7a42952eee3bad4dceb7 LoongArch: Add USER_STACKTRACE support
date: 11 months ago
config: loongarch-randconfig-r073-20230627 (https://download.01.org/0day-ci/archive/20230701/202307011821.uIMwFiL1-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230701/202307011821.uIMwFiL1-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/202307011821.uIMwFiL1-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> arch/loongarch/kernel/stacktrace.c:47:25: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned long [noderef] __user *user_frame_tail @@ got unsigned long * @@
arch/loongarch/kernel/stacktrace.c:47:25: sparse: expected unsigned long [noderef] __user *user_frame_tail
arch/loongarch/kernel/stacktrace.c:47:25: sparse: got unsigned long *
vim +47 arch/loongarch/kernel/stacktrace.c
39
40 static int
41 copy_stack_frame(unsigned long fp, struct stack_frame *frame)
42 {
43 int ret = 1;
44 unsigned long err;
45 unsigned long __user *user_frame_tail;
46
> 47 user_frame_tail = (unsigned long *)(fp - sizeof(struct stack_frame));
48 if (!access_ok(user_frame_tail, sizeof(*frame)))
49 return 0;
50
51 pagefault_disable();
52 err = (__copy_from_user_inatomic(frame, user_frame_tail, sizeof(*frame)));
53 if (err || (unsigned long)user_frame_tail >= frame->fp)
54 ret = 0;
55 pagefault_enable();
56
57 return ret;
58 }
59
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2023-07-01 10:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202307011821.uIMwFiL1-lkp@intel.com \
--to=lkp@intel.com \
--cc=chenhuacai@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=zhangqing@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox