[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yd7nlpb5C1asdT9p@cmpxchg.org>
Date: Wed, 12 Jan 2022 09:37:10 -0500
From: Johannes Weiner <hannes@...xchg.org>
To: Suren Baghdasaryan <surenb@...gle.com>
Cc: torvalds@...ux-foundation.org, ebiggers@...nel.org, tj@...nel.org,
lizefan.x@...edance.com, mingo@...hat.com, peterz@...radead.org,
juri.lelli@...hat.com, vincent.guittot@...aro.org,
dietmar.eggemann@....com, rostedt@...dmis.org, bsegall@...gle.com,
mgorman@...e.de, bristot@...hat.com, corbet@....net,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
cgroups@...r.kernel.org, stable@...r.kernel.org,
kernel-team@...roid.com,
syzbot+cdb5dd11c97cc532efad@...kaller.appspotmail.com
Subject: Re: [PATCH v2 1/1] psi: Fix uaf issue when psi trigger is destroyed
while being polled
On Mon, Jan 10, 2022 at 11:12:12PM -0800, Suren Baghdasaryan wrote:
> With write operation on psi files replacing old trigger with a new one,
> the lifetime of its waitqueue is totally arbitrary. Overwriting an
> existing trigger causes its waitqueue to be freed and pending poll()
> will stumble on trigger->event_wait which was destroyed.
> Fix this by disallowing to redefine an existing psi trigger. If a write
> operation is used on a file descriptor with an already existing psi
> trigger, the operation will fail with EBUSY error.
> Also bypass a check for psi_disabled in the psi_trigger_destroy as the
> flag can be flipped after the trigger is created, leading to a memory
> leak.
>
> Fixes: 0e94682b73bf ("psi: introduce psi monitor")
> Cc: stable@...r.kernel.org
> Reported-by: syzbot+cdb5dd11c97cc532efad@...kaller.appspotmail.com
> Analyzed-by: Eric Biggers <ebiggers@...nel.org>
> Suggested-by: Linus Torvalds <torvalds@...ux-foundation.org>
> Signed-off-by: Suren Baghdasaryan <surenb@...gle.com>
That looks good to me, thanks Suren.
Acked-by: Johannes Weiner <hannes@...xchg.org>
Peter, would you mind picking this up and routing this to Linus
through the sched tree, please?
Powered by blists - more mailing lists