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:   Thu, 24 Jun 2021 20:47:06 -0700
From:   Alexei Starovoitov <alexei.starovoitov@...il.com>
To:     Dmitrii Banshchikov <me@...que.spb.ru>
Cc:     Gary Lin <glin@...e.com>, Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        bpf <bpf@...r.kernel.org>,
        Network Development <netdev@...r.kernel.org>,
        Martin Loviska <mloviska@...e.com>
Subject: Re: [PATCH bpf] net/bpfilter: specify the log level for the kmsg message

On Tue, Jun 22, 2021 at 11:57 PM Dmitrii Banshchikov <me@...que.spb.ru> wrote:
>
> On Tue, Jun 22, 2021 at 09:38:38PM -0700, Alexei Starovoitov wrote:
> > On Tue, Jun 22, 2021 at 9:09 PM Gary Lin <glin@...e.com> wrote:
> > >
> > > Per the kmsg document(*), if we don't specify the log level with a
> > > prefix "<N>" in the message string, the default log level will be
> > > applied to the message. Since the default level could be warning(4),
> > > this would make the log utility such as journalctl treat the message,
> > > "Started bpfilter", as a warning. To avoid confusion, this commit adds
> > > the prefix "<5>" to make the message always a notice.
> > >
> > > (*) https://www.kernel.org/doc/Documentation/ABI/testing/dev-kmsg
> > >
> > > Fixes: 36c4357c63f3 ("net: bpfilter: print umh messages to /dev/kmsg")
> > > Reported-by: Martin Loviska <mloviska@...e.com>
> > > Signed-off-by: Gary Lin <glin@...e.com>
> > > ---
> > >  net/bpfilter/main.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/net/bpfilter/main.c b/net/bpfilter/main.c
> > > index 05e1cfc1e5cd..291a92546246 100644
> > > --- a/net/bpfilter/main.c
> > > +++ b/net/bpfilter/main.c
> > > @@ -57,7 +57,7 @@ int main(void)
> > >  {
> > >         debug_f = fopen("/dev/kmsg", "w");
> > >         setvbuf(debug_f, 0, _IOLBF, 0);
> > > -       fprintf(debug_f, "Started bpfilter\n");
> > > +       fprintf(debug_f, "<5>Started bpfilter\n");
> > >         loop();
> > >         fclose(debug_f);
> > >         return 0;
> >
> > Adding Dmitrii who is redesigning the whole bpfilter.
>
> Thanks. The same logic already exists in the bpfilter v1 patchset
> - [1].
>
> 1. https://lore.kernel.org/bpf/c72bac57-84a0-ac4c-8bd8-08758715118e@fb.com/T/#mb36e20c4e5e4a70746bd50a109b1630687990214

Dmitrii,

what do you prefer we should do with this patch then?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ