Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2982775imm; Sun, 1 Jul 2018 09:39:55 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIPLAKZbuQopaT6wyjpI1sd35f4z4YTjl4z+CKup5zH/tIUmtbzcwOUQjcX7xPMrlf+Quar X-Received: by 2002:a65:43c9:: with SMTP id n9-v6mr18683107pgp.399.1530463195057; Sun, 01 Jul 2018 09:39:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530463195; cv=none; d=google.com; s=arc-20160816; b=dPJyXjAQSfk+z6sRY20Lsm1Psrk/Bynart561FV8eoFwsPAdOVg1nNBSN0tQWM5qzs VHQWumNknrTAvN8/XdtKhdfHBtIkhaYPNjGF84NI3flbsLLqy+IC4zx+8vdTDMHlRRDv HtFDuFJsGDrmvEZrBJ6BRaRoX5bG+m5ODTJwobiOpZRsEpRbXazmMs0dwMwBKhFqeow6 fSfH9ptTTwMJUSS8RAG8gFVLCT26bSYZu9tFYMGaZ69aEy4b9VHgIPlIQG2S50g2/3Yq ZDWK3lnfJBnZvJBnvPlA1M2RnIYWlOWTfvbFZ0uzDL9lYz+QhN/G3pKcoIUfTjGZAAJY JzKQ== 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=yA9hGplT9VaEL21dHcCVvkhndRXFxQTtR3mleCydDEk=; b=XoxWKddfeHH4nkspY/FJokbBP6f0gAYyRVkJ/pEwFZsuaw49b8u2c6qRSu77YKrlVg ZSZ7juF4P4sIIKQ29bRjr0y7GV/Li2jgLclyeTRLrf0ZjiuB5TDFRqMhxzmtRwTROWSU vYeceiBFM5knUD6Cp0sSZtD7Opng4zIuJjzBP7+Ouq/lmqNh+XYM1m8meDD8VAGpiETo X2W70cJuQCnPOC/ScUFSxNFW50c63SoYU4eg1uZuD0JzAomMY6GoklBTphhItcwxlHfq cr4KevPiZPbydhUKYk8BT5q76nvmGP7UppeV+hOD5g2RtYvxze7GKQxru89BHGsd27/C VPrw== 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 f5-v6si13699021plr.56.2018.07.01.09.39.40; Sun, 01 Jul 2018 09:39:55 -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 S1031470AbeGAQhm (ORCPT + 99 others); Sun, 1 Jul 2018 12:37:42 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:36328 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031397AbeGAQhi (ORCPT ); Sun, 1 Jul 2018 12:37:38 -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 3BD2FACC; Sun, 1 Jul 2018 16:37:37 +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 4.17 026/220] ASoC: dapm: delete dapm_kcontrol_data paths list before freeing it Date: Sun, 1 Jul 2018 18:20:50 +0200 Message-Id: <20180701160909.439776904@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160908.272447118@linuxfoundation.org> References: <20180701160908.272447118@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 4.17-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 @@ -433,6 +433,8 @@ err_data: 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); }