Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3318955imu; Sun, 11 Nov 2018 12:16:01 -0800 (PST) X-Google-Smtp-Source: AJdET5fSUZOdkLGQNNNiCKxLSZqw827ObML85jlcMijqiHyF26v8fJLGPItw275G2pSITGWCnZX0 X-Received: by 2002:a17:902:1124:: with SMTP id d33-v6mr17910746pla.125.1541967361398; Sun, 11 Nov 2018 12:16:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541967361; cv=none; d=google.com; s=arc-20160816; b=bHXWl8FdqLfApxOaxIsPgW0lyF1aNRzqC0/ZlxGZFZAfBT0WY/YulEBrG/M5RbLVfM los8phrDaQYppd06EJW9yXMuLbFTqObm/MFov4bFRfzyNDMzh7SmQe15IucVv+y5LDi/ QmPV31d30qK97SrxYPqdH0M1RiWOU2tZdd05Irexr5t6vXTS9wtlEi5L9Z3mY8nCalpl oZJlJ7+2w0DI1WmpC+2eaqdZ05Y4SLvsGHRUBP0Dto/JUdVQRMw8mLzNVug92vNY5/xK iNbAOuh29DiTVBzGl7DaoK+kN09aMWCPYGQJGqkYWMEwg6EG5IPByLyGVVR4Flbcc2Ik +bug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=E5f/xFkgFUpcC9twMkroNALgrHLBJS1okLNqRRTXze8=; b=IzZo3YwTAw+XOmbxcSu3n0dreVD4hPvqKaExSugqbrBzDSQou3BiAk2EA+9plVGgFm IgU1MQB3+SnkKVjVSTF+1dk66FOlNg4ogWXu4c65d81TZ64QvvUMA1LtXeUBJNTQJEmN CwMNrXym8ONR3nVCQna4iBiNokDDS1TUaGN112C+J8GOOAq2eSD6rC8sINrWR9kb5gM0 i3IsYSwacP4DxRUAxnJ9Y59dVm7OHX4vHuJ2rUukRvEBWBNGzrivYGdWtUo2YXYjQ7AK hLmyxrZwi2jywGqg1UYHykvngZTiEf8/9h63aN+MqQhKAufM1DsEnrLoW9otBWGlSxSX TwEQ== 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 35-v6si7822031ple.289.2018.11.11.12.15.46; Sun, 11 Nov 2018 12:16:01 -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 S1731121AbeKLFzy (ORCPT + 99 others); Mon, 12 Nov 2018 00:55:54 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:51964 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725905AbeKLFzy (ORCPT ); Mon, 12 Nov 2018 00:55:54 -0500 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gLvt4-0000oU-VF; Sun, 11 Nov 2018 19:59:15 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gLvsR-0001VX-1J; Sun, 11 Nov 2018 19:58:35 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Mark Brown" , "Srinivas Kandagatla" Date: Sun, 11 Nov 2018 19:49:05 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 109/366] ASoC: dapm: delete dapm_kcontrol_data paths list before freeing it In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 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 3.16.61-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Srinivas Kandagatla commit ff2faf1289c1f81b5b26b9451dd1c2006aac8db8 upstream. dapm_kcontrol_data is freed as part of dapm_kcontrol_free(), leaving the paths pointer dangling in the list. This leads to system crash when we try to unload and reload sound card. I hit this bug during ADSP crash/reboot test case on Dragon board DB410c. Without this patch, on SLAB Poisoning enabled build, kernel crashes with "BUG kmalloc-128 (Tainted: G W ): Poison overwritten" Signed-off-by: Srinivas Kandagatla Signed-off-by: Mark Brown Signed-off-by: Ben Hutchings --- sound/soc/soc-dapm.c | 2 ++ 1 file changed, 2 insertions(+) --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -254,6 +254,8 @@ static int dapm_kcontrol_data_alloc(stru static void dapm_kcontrol_free(struct snd_kcontrol *kctl) { struct dapm_kcontrol_data *data = snd_kcontrol_chip(kctl); + + list_del(&data->paths); kfree(data->wlist); kfree(data); }