Return-Path: Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:58199 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752088AbeCCPdy (ORCPT ); Sat, 3 Mar 2018 10:33:54 -0500 Message-ID: <1520091209.2617.372.camel@decadent.org.uk> Subject: Re: [PATCH 3.16 083/254] dmaengine: dmatest: move callback wait queue to thread context From: Ben Hutchings To: Adam Wallis , linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: akpm@linux-foundation.org, Sinan Kaya , Vinod Koul , Shunyong Yang Date: Sat, 03 Mar 2018 15:33:29 +0000 In-Reply-To: References: Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-lK8q6GBT/0Os3ohxPX3z" Mime-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: --=-lK8q6GBT/0Os3ohxPX3z Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2018-02-28 at 12:47 -0500, Adam Wallis wrote: > Ben >=20 > 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. > >=20 > > ------------------ > >=20 > > From: Adam Wallis > >=20 > > commit 6f6a23a213be51728502b88741ba6a10cda2441d upstream. > >=20 > > 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). > >=20 > > Commit a9df21e34b42 ("dmaengine: dmatest: warn user when dma test times > > out") attempted to WARN the user that the stack was likely corrupted bu= t > > did not fix the actual issue. > >=20 > > 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. > >=20 > > Bug: https://bugzilla.kernel.org/show_bug.cgi?id=3D197605 > > Fixes: adfa543e7314 ("dmatest: don't use set_freezable_with_signal()") > > Reviewed-by: Sinan Kaya > > Suggested-by: Shunyong Yang > > Signed-off-by: Adam Wallis > > Signed-off-by: Vinod Koul > > Signed-off-by: Ben Hutchings >=20 > [..] >=20 > Make sure you pick up the following bug fix on whatever branch you apply = the > above patch to >=20 >=20 > From 66b3bd2356e0a1531c71a3dcf96944621e25c17c Mon Sep 17 00:00:00 2001 > From: Yang Shunyong > Date: Mon, 29 Jan 2018 14:40:11 +0800 > Subject: dmaengine: dmatest: fix container_of member in dmatest_callback >=20 > From: Yang Shunyong >=20 > 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. >=20 > Fixes: 6f6a23a213be ("dmaengine: dmatest: move callback wait ...") > Signed-off-by: Yang Shunyong > Acked-by: Adam Wallis > Signed-off-by: Vinod Koul > Signed-off-by: Greg Kroah-Hartman >=20 >=20 >=20 --=20 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 --=-lK8q6GBT/0Os3ohxPX3z Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEErCspvTSmr92z9o8157/I7JWGEQkFAlqawEkACgkQ57/I7JWG EQkjDRAAkIzuFVpuprq24A9GEVH61iItmznSP58ucuso2y3hlgG9AqBAvbLePfg2 QhLEmyse65u8l35ijZR82JZAnhZ7yVfhSZSs75nUAK5hN2lQEVsWGgtdk4+b/enR BT1oQeal4/B31ImfstVHHgkFW44qgWXdgrzr0d/42hbSUVlSn8luZzzDJTXmKxIC psuOcPTwLPvw1JUGo51BCwDoMKO/V4GkynE31wbrXicpoR/bLXsoL4iklyNEOBu2 DWE7CFJmWld23Flf+bU4S6zQpUhEQ/FzM2Xd5/tp2+V9sK9iLAqkjA7vLCkpIqhk 43qBETRph3qJV/gTA79nCKCfKhdBg2y971XmFlCkqF0dhmLosoCOI0ZFdAMzCe9j 67rAcMNI1qVBsDCWfr71Jbf00/BoQ7ILn/DyvT0H8WS4huLWfnDpZFYcvC+msSnK XCcAuF5R0SnAQp5is795VWF8+/5eLXh3XG+jCFOp805h62YYJs3HFc61pCnr0kGh VW2NUbUJFwbJGb0r9VZbQfpNq/hLrGt9wSITXYBhkussOlFJ5DJlvf6xyp2wh52g MOexHvkyafzIb1rg8zDqetmgk/Uv5QLTOpv4/hO5ZMIqpaHi62KpALiS7x11gh0y eVJWmnofZFpfdSkxAjBg3nBHbsIdm9OG3B/GL9gDO0jv5kvEvEA= =uxPe -----END PGP SIGNATURE----- --=-lK8q6GBT/0Os3ohxPX3z--