[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210210145207.77798d6c@gandalf.local.home>
Date: Wed, 10 Feb 2021 14:52:07 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: Yonghong Song <yhs@...com>, Dmitry Vyukov <dvyukov@...gle.com>,
syzbot <syzbot+d29e58bb557324e55e5e@...kaller.appspotmail.com>,
Andrew Morton <akpm@...ux-foundation.org>, andrii@...nel.org,
Alexei Starovoitov <ast@...nel.org>, bpf <bpf@...r.kernel.org>,
Daniel Borkmann <daniel@...earbox.net>,
David Miller <davem@...emloft.net>,
Jesper Dangaard Brouer <hawk@...nel.org>,
John Fastabend <john.fastabend@...il.com>,
Martin KaFai Lau <kafai@...com>,
KP Singh <kpsingh@...omium.org>,
Jakub Kicinski <kuba@...nel.org>,
LKML <linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...e.hu>,
Ingo Molnar <mingo@...hat.com>, mmullins@...com,
netdev <netdev@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>,
Song Liu <songliubraving@...com>,
syzkaller-bugs <syzkaller-bugs@...glegroups.com>
Subject: Re: KASAN: vmalloc-out-of-bounds Read in bpf_trace_run3
On Wed, 10 Feb 2021 19:23:38 +0100
Eric Dumazet <eric.dumazet@...il.com> wrote:
> >> The problem here is a kmalloc failure injection into
> >> tracepoint_probe_unregister, but the error is ignored -- so the bpf
> >> program is freed even though the tracepoint is never unregistered.
> >>
> >> I have a first pass at a patch to pipe through the error code, but it's
> >> pretty ugly. It's also called from the file_operations ->release(), for
> >
> > Maybe you can still post the patch, so people can review and make suggestions which may lead to a *better* solution.
>
>
> ping
>
> This bug is still there.
Is this a bug via syzkaller?
I have this fix in linux-next:
befe6d946551 ("tracepoint: Do not fail unregistering a probe due to memory failure")
But because it is using undefined behavior (calling a sub return from a
call that has parameters, but Peter Zijlstra says is OK), I'm hesitant to
send it to Linus now or label it as stable.
Now this can only happen if kmalloc fails from here (called by func_remove).
static inline void *allocate_probes(int count)
{
struct tp_probes *p = kmalloc(struct_size(p, probes, count),
GFP_KERNEL);
return p == NULL ? NULL : p->probes;
}
As probes and count together is typically much less than a page (unless you
are doing fuzz testing and adding a ton of callbacks to a single
tracepoint), that kmalloc should always succeed.
The failure above can only happen if allocate_probes returns NULL, which is
extremely unlikely.
My question is, how is this triggered? And this should only be triggered by
root doing stupid crap. Is it that critical to have fixed?
-- Steve
Powered by blists - more mailing lists