netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Olsa <olsajiri@gmail.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Jakub Kicinski <kuba@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Peter Zijlstra <peterz@infradead.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Network Development <netdev@vger.kernel.org>,
	bpf <bpf@vger.kernel.org>, Kernel Team <kernel-team@fb.com>
Subject: Re: pull-request: bpf 2022-03-29
Date: Wed, 30 Mar 2022 10:05:34 +0200	[thread overview]
Message-ID: <YkQPTlN5VMeRg5zZ@krava> (raw)
In-Reply-To: <CAADnVQJNS_U97aqaNxtAhuvZCK6oiDA-tDoAEyDMYnCBbfaZkg@mail.gmail.com>

On Tue, Mar 29, 2022 at 06:51:22PM -0700, Alexei Starovoitov wrote:
> On Tue, Mar 29, 2022 at 6:41 PM Jakub Kicinski <kuba@kernel.org> wrote:
> >
> > On Tue, 29 Mar 2022 16:49:24 -0700 Alexei Starovoitov wrote:
> > > Hi David, hi Jakub,
> > >
> > > The following pull-request contains BPF updates for your *net* tree.
> > >
> > > We've added 16 non-merge commits during the last 1 day(s) which contain
> > > a total of 24 files changed, 354 insertions(+), 187 deletions(-).
> > >
> > > The main changes are:
> > >
> > > 1) x86 specific bits of fprobe/rethook, from Masami and Peter.
> > >
> > > 2) ice/xsk fixes, from Maciej and Magnus.
> > >
> > > 3) Various small fixes, from Andrii, Yonghong, Geliang and others.
> >
> > There are some new sparse warnings here that look semi-legit.
> > As in harmless but not erroneous.
> 
> Both are new warnings and not due to these patches, right?
> 
> > kernel/trace/rethook.c:68:9: error: incompatible types in comparison expression (different address spaces):
> > kernel/trace/rethook.c:68:9:    void ( [noderef] __rcu * )( ... )
> > kernel/trace/rethook.c:68:9:    void ( * )( ... )
> >
> > 66 void rethook_free(struct rethook *rh)
> > 67 {
> > 68         rcu_assign_pointer(rh->handler, NULL);
> > 69
> > 70         call_rcu(&rh->rcu, rethook_free_rcu);
> > 71 }
> >
> > Looks like this should be a WRITE_ONCE() ?
> 
> Masami, please take a look.
> 
> > And the __user annotations in bpf_trace.c are still not right,
> > first arg of kprobe_multi_resolve_syms() should __user:
> >
> > kernel/trace/bpf_trace.c:2370:34: warning: incorrect type in argument 2 (different address spaces)
> > kernel/trace/bpf_trace.c:2370:34:    expected void const [noderef] __user *from
> > kernel/trace/bpf_trace.c:2370:34:    got void const *usyms
> > kernel/trace/bpf_trace.c:2376:51: warning: incorrect type in argument 2 (different address spaces)
> > kernel/trace/bpf_trace.c:2376:51:    expected char const [noderef] __user *src
> > kernel/trace/bpf_trace.c:2376:51:    got char const *
> > kernel/trace/bpf_trace.c:2443:49: warning: incorrect type in argument 1 (different address spaces)
> > kernel/trace/bpf_trace.c:2443:49:    expected void const *usyms
> > kernel/trace/bpf_trace.c:2443:49:    got void [noderef] __user *[assigned] usyms
> 
> This one is known. Still waiting for the fix from Jiri.

right, I replied that for some reason I can't see these warnings
with 'make C=2' and latest sparse.. how do you run that?

if patch below fixes it for you, I can send formal patch quickly

jirka


---
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index d8553f46caa2..7fa2ebc07f60 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -2349,11 +2349,11 @@ kprobe_multi_link_handler(struct fprobe *fp, unsigned long entry_ip,
 }
 
 static int
-kprobe_multi_resolve_syms(const void __user *usyms, u32 cnt,
+kprobe_multi_resolve_syms(const void *usyms, u32 cnt,
 			  unsigned long *addrs)
 {
 	unsigned long addr, size;
-	const char __user **syms;
+	const char **syms;
 	int err = -ENOMEM;
 	unsigned int i;
 	char *func;

  parent reply	other threads:[~2022-03-30  8:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-29 23:49 pull-request: bpf 2022-03-29 Alexei Starovoitov
2022-03-30  1:41 ` Jakub Kicinski
2022-03-30  1:51   ` Alexei Starovoitov
2022-03-30  2:02     ` Jakub Kicinski
2022-03-30  4:52     ` Masami Hiramatsu
2022-03-30  9:15       ` Masami Hiramatsu
2022-03-30 15:09         ` Alexei Starovoitov
2022-03-31  1:11           ` [PATCH bpf] rethook: Fix to use WRITE_ONCE() for rethook::handler Masami Hiramatsu
2022-03-31  2:30             ` patchwork-bot+netdevbpf
2022-03-31  1:12           ` pull-request: bpf 2022-03-29 Masami Hiramatsu
2022-03-30  8:05     ` Jiri Olsa [this message]
2022-03-30 11:01       ` Jiri Olsa
2022-03-30  4:10 ` patchwork-bot+netdevbpf

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=YkQPTlN5VMeRg5zZ@krava \
    --to=olsajiri@gmail.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=kernel-team@fb.com \
    --cc=kuba@kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=peterz@infradead.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;
as well as URLs for NNTP newsgroup(s).