lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 17 Jun 2019 23:13:03 +0000
From:   Matt Mullins <mmullins@...com>
To:     "alexei.starovoitov@...il.com" <alexei.starovoitov@...il.com>,
        "rostedt@...dmis.org" <rostedt@...dmis.org>
CC:     Song Liu <songliubraving@...com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "daniel@...earbox.net" <daniel@...earbox.net>,
        "bpf@...r.kernel.org" <bpf@...r.kernel.org>,
        "ast@...nel.org" <ast@...nel.org>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        Martin Lau <kafai@...com>, Yonghong Song <yhs@...com>,
        "arnd@...db.de" <arnd@...db.de>, Andrii Nakryiko <andriin@...com>
Subject: Re: [PATCH] bpf: hide do_bpf_send_signal when unused

On Mon, 2019-06-17 at 19:09 -0400, Steven Rostedt wrote:
> On Mon, 17 Jun 2019 08:26:29 -0700
> Alexei Starovoitov <alexei.starovoitov@...il.com> wrote:
> 
> > On Mon, Jun 17, 2019 at 5:59 AM Arnd Bergmann <arnd@...db.de> wrote:
> > > 
> > > When CONFIG_MODULES is disabled, this function is never called:
> > > 
> > > kernel/trace/bpf_trace.c:581:13: error: 'do_bpf_send_signal' defined but not used [-Werror=unused-function]  
> > 
> > hmm. it should work just fine without modules.
> > the bug is somewhere else.
> 
> From what I see, the only use of do_bpf_send_signal is within a
> #ifdef CONFIG_MODULES, which means that you will get a warning about a
> static unused when CONFIG_MODULES is not defined.
> 
> In kernel/trace/bpf_trace.c we have:
> 
> static void do_bpf_send_signal(struct irq_work *entry)
> 
> [..]
> 
> #ifdef CONFIG_MODULES
> 
> [..]
> 
>         for_each_possible_cpu(cpu) {
>                 work = per_cpu_ptr(&send_signal_work, cpu);
>                 init_irq_work(&work->irq_work, do_bpf_send_signal);  <-- on use of do_bpf_send_signal
>         }
> [..]
> #endif /* CONFIG_MODULES */
> 
> The bug (really just a warning) reported is exactly here.

I don't think bpf_send_signal is tied to modules at all;
send_signal_irq_work_init and the corresponding initcall should be
moved outside that #ifdef.

> 
> -- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ