Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2962809imm; Sun, 1 Jul 2018 09:14:49 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcoAySC+u6/QnxNIPKQUVJLDOmT9IPTMxGA4TvUGiQCHb83rtkxofW1VRYRqYauEZ6dTPAc X-Received: by 2002:a65:61aa:: with SMTP id i10-v6mr1903850pgv.139.1530461689417; Sun, 01 Jul 2018 09:14:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530461689; cv=none; d=google.com; s=arc-20160816; b=DOVWazd8lVlUB0Tg3lk6rFbDYp5pYqeSvyDpyNtgUkrm9UbrSpxrn+cKj4f/zI0BRp 1EiuDLn1w68HOBt5EBMKGLFbN8efVmsO7QZh70ZtwHCHbNKMwm0sxAIRP+uVmLwFAsqt KhY2B6UsrR81y6vymJs/QZcFReiUcB5vb4HPnezJcaJoDL6KqA9zGnw4Zbo4gii1afsO c3ALAnh3m2IJDOxoUm8YShaYm1BiaNbOLCRxDEz7XkzXUPVpiu0PjZr8BvGd3TAIkXuo xkDLMwU2UAsYHwfr9AwAHdxi4B4VWsvfIlaZL/MmUYx1ohsxlpd6SxSmjeMCXBOHGvrD zyMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=N0zZOPRcTC9v6VaRwMsUKAWOqA9N8X52CSWDuwxHnOY=; b=zayXoSye3D3XPpN5lmH1Nql/W/vNOE4DVVu26eBIIa7t6+PDapYxh5tgVWaW6fh+fY IveY57INX7sgytaakwNEuQQk3gczkEjqM+iBfKsgN/+H/h1Y2C6A17tKCwW/uBN15qxx y6kIYbpAmZ3UZJMzILq1MC6j0zxhG8HYm47WItcohBt1TKl6by0dc3eAPkD3zTXXcWNH UyRDoaLMpsAPJlDvw5rJbzR4j9ZZB5ngxgHbK60M0zZ4Y2+26+TlHrwjnTVrsjsKLIqL iuW77Etxp4nnndJ7Z8U88paOdVuANvAcC/T+ASIcnRygVY/eIQUN6AOET+tJ4qCwmiOz +Owg== 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 m8-v6si13622566plt.29.2018.07.01.09.14.35; Sun, 01 Jul 2018 09:14:49 -0700 (PDT) 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 S932382AbeGAQNQ (ORCPT + 99 others); Sun, 1 Jul 2018 12:13:16 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60068 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932310AbeGAQNI (ORCPT ); Sun, 1 Jul 2018 12:13:08 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 0C36486A; Sun, 1 Jul 2018 16:13:06 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Srinivas Kandagatla , Mark Brown Subject: [PATCH 3.18 50/85] ASoC: dapm: delete dapm_kcontrol_data paths list before freeing it Date: Sun, 1 Jul 2018 18:02:08 +0200 Message-Id: <20180701153124.346157749@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701153122.365061142@linuxfoundation.org> References: <20180701153122.365061142@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable 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 Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- 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); }