Received: by 10.223.185.116 with SMTP id b49csp791748wrg; Sat, 3 Mar 2018 07:35:19 -0800 (PST) X-Google-Smtp-Source: AG47ELvqyzvjkg+NpvlyxiaxjJn42wJ7CB+U+cRtmXmrLIaabhUQjk0S5GZ0kIBewBJzrFNj6/4p X-Received: by 2002:a17:902:9a84:: with SMTP id w4-v6mr8397549plp.136.1520091319745; Sat, 03 Mar 2018 07:35:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520091319; cv=none; d=google.com; s=arc-20160816; b=LA8h7hXA+ubdfmCXEjKL2E+kORAFTP1Nih5qZaAhViCc4ZnykHS6hBUGFL76FSwnDh KPpLwHrnSbyLAkwZuGn0rCqLAqRdl9Yn+vI2M/loRaLMMa3mYGa1OrGsVn82SfOjFks8 KDM5z8OiDnivOCzfKq2E74ub2fcQP4kuzsxF+sqwkzMlNamV+5SRlZPBThPZrcPvTkJB 7zbazygInOu1RWIROKDAzvo6d8hm3wIB/V6/TmJOtsU5MHA1TWbptDk06gD8nO7lTfIs NMSrlbhkRPbKA5JzJ9BAchu+ZBVXEPxiJlgBk5/rNhwg3vLYzPN2Phwqc4q/H0I17OEb /lfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to:date :cc:to:from:subject:message-id:arc-authentication-results; bh=mkP0UasnJdTbhDxKhaG1gwi2x7shRELsKMNAkpF2Ob8=; b=dCKPvIRaJhfanb8NDgfC0hbvE+OqeEMAp4us7EVeS7w9+wswiZWv6fB55H+++sQSqu 9X9WgihBxIpTa4BbebPB6FofjB62aqTtin/vCPCkc3PGi+sgN3aiJOkijP6YG8vDthCc Mdrk3yB7HVMoZkYfHny0biwJjCqEUuyjjfdcJsbQg81GMbbWem4vHt8ovorX924ko5By Cc4dCNkeLWdm6oDw3K2cyfATKALI970kOf4Eq4Tmk7LGkp6tj+OzsnZq45vSSiXAUN95 GUOwuv7haoAm/JzsghNktYp41y029BDyry/Sixdr7EyDaN6lP8LJM2eNKXRQm7f/Je60 9oMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i9si6879074pfi.150.2018.03.03.07.35.05; Sat, 03 Mar 2018 07:35:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752165AbeCCPdz (ORCPT + 99 others); Sat, 3 Mar 2018 10:33:55 -0500 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 Received: from [2a02:8011:400e:2:6f00:88c8:c921:d332] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1es9AS-0001c3-Rm; Sat, 03 Mar 2018 15:33:48 +0000 Received: from ben by deadeye with local (Exim 4.90_1) (envelope-from ) id 1es9AN-00007W-N2; Sat, 03 Mar 2018 15:33:43 +0000 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" X-Mailer: Evolution 3.26.3-1 Mime-Version: 1.0 X-SA-Exim-Connect-IP: 2a02:8011:400e:2:6f00:88c8:c921:d332 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-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--