[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <s5ha6ilkyum.wl-tiwai@suse.de>
Date: Wed, 03 Nov 2021 17:06:41 +0100
From: Takashi Iwai <tiwai@...e.de>
To: Wang Wensheng <wangwensheng4@...wei.com>
Cc: <perex@...ex.cz>, <tiwai@...e.com>, <broonie@...nel.org>,
<joe@...ches.com>, <alsa-devel@...a-project.org>,
<linux-kernel@...r.kernel.org>, <rui.xiang@...wei.com>
Subject: Re: [PATCH -next v2] ALSA: timer: Fix use-after-free problem
On Wed, 03 Nov 2021 16:52:31 +0100,
Takashi Iwai wrote:
>
> On Wed, 03 Nov 2021 04:35:17 +0100,
> Wang Wensheng wrote:
> >
> > When the timer instance was add into ack_list but was not currently in
> > process, the user could stop it via snd_timer_stop1() without delete it
> > from the ack_list. Then the user could free the timer instance and when
> > it was actually processed UAF occurred.
> >
> > This issue could be reproduced via testcase snd_timer01 in ltp - running
> > several instances of that testcase at the same time.
> >
> > What I actually met was that the ack_list of the timer broken and the
> > kernel went into deadloop with irqoff. That could be detected by
> > hardlockup detector on board or when we run it on qemu, we could use gdb
> > to dump the ack_list when the console has no response.
> >
> > To fix this issue, we delete the timer instance from ack_list and
> > active_list unconditionally in snd_timer_stop1().
> >
> > Signed-off-by: Wang Wensheng <wangwensheng4@...wei.com>
> > Suggested-by: Takashi Iwai <tiwai@...e.de>
>
> Thanks, applied now.
BTW, while reviewing the patch, I noticed that we have also the
similar code path for a slave timer instance that has the same kind of
linked list entries. I'll submit the corresponding fix patch.
Takashi
Powered by blists - more mailing lists