[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 1 Feb 2023 20:56:55 -0800
From: Eric Biggers <ebiggers@...nel.org>
To: Munehisa Kamata <kamatam@...zon.com>
Cc: surenb@...gle.com, hannes@...xchg.org, hdanton@...a.com,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
mengcc@...zon.com, stable@...r.kernel.org
Subject: Re: [PATCH] sched/psi: fix use-after-free in ep_remove_wait_queue()
On Wed, Feb 01, 2023 at 07:00:23PM -0800, Munehisa Kamata wrote:
> diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c
> index 8ac8b81bfee6..6e66c15f6450 100644
> --- a/kernel/sched/psi.c
> +++ b/kernel/sched/psi.c
> @@ -1343,10 +1343,11 @@ void psi_trigger_destroy(struct psi_trigger *t)
>
> group = t->group;
> /*
> - * Wakeup waiters to stop polling. Can happen if cgroup is deleted
> - * from under a polling process.
> + * Wakeup waiters to stop polling and clear the queue to prevent it from
> + * being accessed later. Can happen if cgroup is deleted from under a
> + * polling process otherwise.
> */
> - wake_up_interruptible(&t->event_wait);
> + wake_up_pollfree(&t->event_wait);
>
> mutex_lock(&group->trigger_lock);
wake_up_pollfree() should only be used in extremely rare cases. Why can't the
lifetime of the waitqueue be fixed instead?
- Eric
Powered by blists - more mailing lists