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]
Message-ID: <20161107203540.GA29563@ast-mbp.thefacebook.com>
Date:   Mon, 7 Nov 2016 12:35:42 -0800
From:   Alexei Starovoitov <alexei.starovoitov@...il.com>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     Martin KaFai Lau <kafai@...com>, linux-kernel@...r.kernel.org,
        kernel-team@...com
Subject: Re: ftrace module init race/bug

On Mon, Nov 07, 2016 at 03:08:41PM -0500, Steven Rostedt wrote:
> On Mon, 7 Nov 2016 11:46:24 -0800
> Alexei Starovoitov <alexei.starovoitov@...il.com> wrote:
> 
> > Hi Steven,
> > 
> > I'm debugging the following spew:
> > 
> > [ 7139.111213] WARNING: CPU: 8 PID: 856649 at kernel/trace/ftrace.c:2747 ftrace_shutdown+0x263/0x270
> 
> What kernel version is this, as that line number doesn't line up to
> nay warning on 4.9 on 4.9-rc1.

it's our 4.6 with backports. It's line 2766 in 4.9 and as far as I can tell
the ftrace logic is the same, so pretty sure it's applicable, but...
no reproducer available. Only this spew.

> > do you think the following diff is enough to silence the warning
> > diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> > index b1870fbd2b67..edb00bf70d84 100644
> > --- a/kernel/trace/ftrace.c
> > +++ b/kernel/trace/ftrace.c
> > @@ -2744,7 +2744,7 @@ static int ftrace_shutdown(struct ftrace_ops *ops, int command)
> >                 struct dyn_ftrace *rec;
> > 
> >                 do_for_each_ftrace_rec(pg, rec) {
> > -                       if (FTRACE_WARN_ON_ONCE(rec->flags))
> > +                       if (FTRACE_WARN_ON_ONCE(rec->flags & ~FTRACE_FL_DISABLED))
> >                                 pr_warn("  %pS flags:%lx\n",
> >                                         (void *)rec->ip, rec->flags);
> >                 } while_for_each_ftrace_rec();
> > 
> > or it's a tip of an iceberg and less hacky fix is needed?
> 
> Actually, this may be correct. I need to audit the other
> do_for_each_ftrace_rec() loops.

yep, the __ftrace_hash_rec_update() has !FTRACE_FL_DISABLED check,
so I thought ftrace_shutdown() may need it too.
Should I send the above patch with proper sob?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ