[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wiCv6m9g2=tGSVkf8KEdZFFJp47hiepo93NyLruYoGLAQ@mail.gmail.com>
Date: Thu, 6 Jan 2022 19:02:58 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Eric Biggers <ebiggers@...nel.org>
Cc: Tejun Heo <tj@...nel.org>, Zefan Li <lizefan.x@...edance.com>,
Johannes Weiner <hannes@...xchg.org>,
Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Ingo Molnar <mingo@...hat.com>,
Hillf Danton <hdanton@...a.com>,
syzbot <syzbot+cdb5dd11c97cc532efad@...kaller.appspotmail.com>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
syzkaller-bugs <syzkaller-bugs@...glegroups.com>,
Linux-MM <linux-mm@...ck.org>
Subject: Re: psi_trigger_poll() is completely broken
On Thu, Jan 6, 2022 at 4:14 PM Eric Biggers <ebiggers@...nel.org> wrote:
>
> I had to make the following changes to Linus's patch:
Ack. Thanks.
> This is one way to fix the use-after-free, but the fact that it allows anyone
> who can write to a /proc/pressure/* file to cause the kernel to allocate an
> unbounded number of 'struct psi_trigger' structs is still really broken.
Yeah, I agree. Very non-optimal - that patch really was trying to just
keep the status quo, and fixing the immediate problems.
Modifying that patch to only allow a previous NULL value in
psi_trigger_replace() would be fairly simple - it would basically just
get rid of the "stale_trigger" list (and the loops it creates).
You'd still want the psi_trigger_release() model to separate that
whole "release" from "new trigger".
But that does require that nobody ever does more than a single write
to one file.
Debian code search finds those "/proc/pressure/xyz" files mentioned at
least by systemd and the chromium chrome browser sources. Whether they
actually write triggers to them, I can't say.
Maybe we just need to try.
Linus
Powered by blists - more mailing lists