[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 03 Mar 2018 15:33:29 +0000
From: Ben Hutchings <ben@...adent.org.uk>
To: Adam Wallis <awallis@...eaurora.org>, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Cc: akpm@...ux-foundation.org, Sinan Kaya <okaya@...eaurora.org>,
Vinod Koul <vinod.koul@...el.com>,
Shunyong Yang <shunyong.yang@...-semitech.com>
Subject: Re: [PATCH 3.16 083/254] dmaengine: dmatest: move callback wait
queue to thread context
On Wed, 2018-02-28 at 12:47 -0500, Adam Wallis wrote:
> Ben
>
> On 2/28/2018 10:20 AM, Ben Hutchings wrote:
> > 3.16.55-rc1 review patch. If anyone has any objections, please let me know.
> >
> > ------------------
> >
> > From: Adam Wallis <awallis@...eaurora.org>
> >
> > commit 6f6a23a213be51728502b88741ba6a10cda2441d upstream.
> >
> > Commit adfa543e7314 ("dmatest: don't use set_freezable_with_signal()")
> > introduced a bug (that is in fact documented by the patch commit text)
> > that leaves behind a dangling pointer. Since the done_wait structure is
> > allocated on the stack, future invocations to the DMATEST can produce
> > undesirable results (e.g., corrupted spinlocks).
> >
> > Commit a9df21e34b42 ("dmaengine: dmatest: warn user when dma test times
> > out") attempted to WARN the user that the stack was likely corrupted but
> > did not fix the actual issue.
> >
> > This patch fixes the issue by pushing the wait queue and callback
> > structs into the the thread structure. If a failure occurs due to time,
> > dmaengine_terminate_all will force the callback to safely call
> > wake_up_all() without possibility of using a freed pointer.
> >
> > Bug: https://bugzilla.kernel.org/show_bug.cgi?id=197605
> > Fixes: adfa543e7314 ("dmatest: don't use set_freezable_with_signal()")
> > Reviewed-by: Sinan Kaya <okaya@...eaurora.org>
> > Suggested-by: Shunyong Yang <shunyong.yang@...-semitech.com>
> > Signed-off-by: Adam Wallis <awallis@...eaurora.org>
> > Signed-off-by: Vinod Koul <vinod.koul@...el.com>
> > Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
>
> [..]
>
> Make sure you pick up the following bug fix on whatever branch you apply the
> above patch to
>
>
> From 66b3bd2356e0a1531c71a3dcf96944621e25c17c Mon Sep 17 00:00:00 2001
> From: Yang Shunyong <shunyong.yang@...-semitech.com>
> Date: Mon, 29 Jan 2018 14:40:11 +0800
> Subject: dmaengine: dmatest: fix container_of member in dmatest_callback
>
> From: Yang Shunyong <shunyong.yang@...-semitech.com>
>
> commit 66b3bd2356e0a1531c71a3dcf96944621e25c17c upstream.
Thanks, I've added this.
Ben.
> The type of arg passed to dmatest_callback is struct dmatest_done.
> It refers to test_done in struct dmatest_thread, not done_wait.
>
> Fixes: 6f6a23a213be ("dmaengine: dmatest: move callback wait ...")
> Signed-off-by: Yang Shunyong <shunyong.yang@...-semitech.com>
> Acked-by: Adam Wallis <awallis@...eaurora.org>
> Signed-off-by: Vinod Koul <vinod.koul@...el.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
>
>
>
--
Ben Hutchings
[W]e found...that it wasn't as easy to get programs right as we had
thought.
... I realized that a large part of my life from then on was going to
be spent
in finding mistakes in my own programs. - Maurice Wilkes, 1949
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists