Received: by 10.223.185.116 with SMTP id b49csp6463746wrg; Wed, 28 Feb 2018 09:48:46 -0800 (PST) X-Google-Smtp-Source: AG47ELt5mpIMACz6gAEswFoNmFSb6jvcvDmIyntoYvwRZNcNwlHtMZsP3z8uOsJo0u5v0o4zg1/1 X-Received: by 10.99.114.65 with SMTP id c1mr9931290pgn.314.1519840126654; Wed, 28 Feb 2018 09:48:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519840126; cv=none; d=google.com; s=arc-20160816; b=tgQ4Fe+eCObkc/a2Scn5so70UtZdW1uZ5PEfa6fRylwZxt6Ifj6U8M8kOPc5VTNF59 JgRp7VLi4XIx/XggD3O9eG3Ys+pkkcAdERVzZPvDu1uThO1KQ5e2rUf5v1dS9ET0G29i MeFp7OwtvyuZuuoQR6bDaZ4fEyvGeRGozZlStwNed4qAkJiVO725GhnK6io6Sn2d8wK5 GxuN148N1d4Cd+N9DAXgX12qq6za+EgfzhIRuUoVLL2U1cx8N/XFzWlJgcF+bYRWKpQq jiaI+cjs2w9HkQcjBMSVjDEBNVl9T+6oHhUzzXYRs5dkrHKOe8N8KAN8wx7GKC/Z6OKA ecng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=PVPAg1hCeux/ACgPbaJN7PZxkGqtWtOWSUBEbVwS8Aw=; b=pUn/eJDixPa7kz3qvqIevl71JAL8whBn61b9RcPKRnEdXTtQ/S5DgQNz7QYT0i1nD1 /AJFG+tcvDcjED6zOyQPWbNU0mSHnPQ2+DP46fxbwehymrVpAs4aLqtm4RI9Mp+M5Oev Jg8mRrBg06+ZAGwNq6+KBObVgs8SXW9tPft+Pido+T3gRc+m6LWiJ7+rR6roQOjLpMLY zMBMRZDv52Q5+5jPdf2knqE5MtaYHb0oUJjMhsTeHsr0ORRylIErECrUfHO62icGQAfR EzJvAB/NfjIm68RjZ2mXSyDwjDGswKWgBzTsz8Bw1PUHeUDSAZncoLsMP505+cMWVO/v Y/sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=bAgzMQh5; dkim=pass header.i=@codeaurora.org header.s=default header.b=AySEs9cF; 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 x63si1481914pfi.173.2018.02.28.09.48.31; Wed, 28 Feb 2018 09:48:46 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b=bAgzMQh5; dkim=pass header.i=@codeaurora.org header.s=default header.b=AySEs9cF; 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 S932963AbeB1Rrv (ORCPT + 99 others); Wed, 28 Feb 2018 12:47:51 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:49774 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932146AbeB1Rrr (ORCPT ); Wed, 28 Feb 2018 12:47:47 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 7B794607B9; Wed, 28 Feb 2018 17:47:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1519840066; bh=3732QylDzRQIxNz6gtmn6yu6HuWszMBGFSKYCWS7lJw=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=bAgzMQh5eQ31hgr+pYrpSrVDxlrqfZxq4c9Gl2rzJI6I1D6mciob3eyYXOuYFovIr JnU289SEhomt3BdKvm4YxvA1g8HoL5bZXMq4meXSCr7YbvOAdHF00OkWETxOr3N9XL z/x1Svu88m1emb7KHdM+bO1e/wUS+GEMpigFQP8I= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [10.38.64.48] (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: awallis@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 54470601CF; Wed, 28 Feb 2018 17:47:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1519840056; bh=3732QylDzRQIxNz6gtmn6yu6HuWszMBGFSKYCWS7lJw=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=AySEs9cFEwptz6D1lrwHltD6DQGSyyKaL9U2JPbBIuFFRmYmR3V5dgOCa1koFQkuY poHWBTrtHX4Dg3S/EZJA/oF1AtLe7Akzq55KMtDVF6aggAKnIU4GXG/4qAdCO85xov kia/1cVKMOYG6rpmHoesRhHEJ1suOSb1S8zVLJvs= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 54470601CF Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=awallis@codeaurora.org Subject: Re: [PATCH 3.16 083/254] dmaengine: dmatest: move callback wait queue to thread context To: Ben Hutchings , linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: akpm@linux-foundation.org, Sinan Kaya , Vinod Koul , Shunyong Yang References: From: Adam Wallis Message-ID: Date: Wed, 28 Feb 2018 12:47:34 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > 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 > Suggested-by: Shunyong Yang > Signed-off-by: Adam Wallis > Signed-off-by: Vinod Koul > Signed-off-by: Ben Hutchings [..] 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 Date: Mon, 29 Jan 2018 14:40:11 +0800 Subject: dmaengine: dmatest: fix container_of member in dmatest_callback From: Yang Shunyong commit 66b3bd2356e0a1531c71a3dcf96944621e25c17c upstream. 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 Acked-by: Adam Wallis Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman -- Adam Wallis Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.