From: kernel test robot <lkp@intel.com>
To: Beau Belgrave <beaub@linux.microsoft.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
"Steven Rostedt (Google)" <rostedt@goodmis.org>
Subject: kernel/trace/trace_events_user.c:811:13: sparse: sparse: cast removes address space '__user' of expression
Date: Sat, 16 Jul 2022 05:25:10 +0800 [thread overview]
Message-ID: <202207160536.yQsO3FQC-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 9b59ec8d50a1f28747ceff9a4f39af5deba9540e
commit: 7f5a08c79df35e68f1a43033450c5050f12bc155 user_events: Add minimal support for trace_event into ftrace
date: 5 months ago
config: sparc64-randconfig-s031-20220716 (https://download.01.org/0day-ci/archive/20220716/202207160536.yQsO3FQC-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 12.1.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-39-gce1a6720-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7f5a08c79df35e68f1a43033450c5050f12bc155
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 7f5a08c79df35e68f1a43033450c5050f12bc155
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=sparc64 SHELL=/bin/bash drivers/usb/gadget/function/ drivers/virtio/ kernel/trace/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
kernel/trace/trace_events_user.c:747:16: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/trace/trace_events_user.c:747:16: sparse: void [noderef] __rcu *
kernel/trace/trace_events_user.c:747:16: sparse: void *
>> kernel/trace/trace_events_user.c:811:13: sparse: sparse: cast removes address space '__user' of expression
>> kernel/trace/trace_events_user.c:811:13: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __user *buf @@ got char * @@
kernel/trace/trace_events_user.c:811:13: sparse: expected void [noderef] __user *buf
kernel/trace/trace_events_user.c:811:13: sparse: got char *
kernel/trace/trace_events_user.c:827:16: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/trace/trace_events_user.c:827:16: sparse: void [noderef] __rcu *
kernel/trace/trace_events_user.c:827:16: sparse: void *
kernel/trace/trace_events_user.c:854:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/trace/trace_events_user.c:854:9: sparse: void [noderef] __rcu *
kernel/trace/trace_events_user.c:854:9: sparse: void *
vim +/__user +811 kernel/trace/trace_events_user.c
801
802 static ssize_t user_events_write(struct file *file, const char __user *ubuf,
803 size_t count, loff_t *ppos)
804 {
805 struct iovec iov;
806 struct iov_iter i;
807
808 if (unlikely(*ppos != 0))
809 return -EFAULT;
810
> 811 if (unlikely(import_single_range(READ, (char *)ubuf, count, &iov, &i)))
812 return -EFAULT;
813
814 return user_events_write_core(file, &i);
815 }
816
--
0-DAY CI Kernel Test Service
https://01.org/lkp
reply other threads:[~2022-07-15 21:25 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=202207160536.yQsO3FQC-lkp@intel.com \
--to=lkp@intel.com \
--cc=beaub@linux.microsoft.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/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
all inboxes | Powered by JetHome®