Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3064933imm; Sun, 1 Jul 2018 11:25:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeVKSMDGvgR/V/Fl1bkt9NwB1zf4Gb2c26IQYyXuKbRW6L8kf7tzvAxws5S3Za9Pcwbm6Sw X-Received: by 2002:a62:3ece:: with SMTP id y75-v6mr14281192pfj.7.1530469520684; Sun, 01 Jul 2018 11:25:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530469520; cv=none; d=google.com; s=arc-20160816; b=GGwnBOrrdOHClcb7Z7LSxzoLOxQfJxjxjtrmJyFLqJD4Xr8vdku10+cwljDgijIA+C /geNs5nu82o48Erz6QbnLze0+0+pibsZWyBPrGc4JMBQGinjwOa6+1iqxJ/A5jXLbExl GFZZjMWFiv9sqSKkwDdso3FDps4KL6UOPAjzXQF1TfatEQEtsNz1Obh7NUsjBiV2UujZ laMbIKEP+3gKBkKEyhfzL9ehYcgDYBLMfmmmjCRgmqwxCwWsMoXQdxLm+1er+LpSJkdw LANnVnHLEpzf73M6pB1rbeTVp4gsOSUc+RJQOSVnU7JvuFPcFQuELPXaH/1UKZvDqml7 ZlIQ== 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=PNCn1xl3uqwcBlAwOQ1zt1xxAlw3WBaQBp3NjYGANbg=; b=VgPtttYdRtFwf3HU0GcX0UaXinlOXJlvh18XGXuZ/YHz7qfZ6BYpjtzhVkdWqiaIXK E+G6Tt3ySC4b3fyRZO8Uwcy81bZCNnchn+SortkihdisXCaIw6eKwFgTJOvwFzb7xfzQ WUMLEtFMss9uxIaQyfYLOO+ytN9vDsGh38uNkeMDri/vutGduRb2hT6shDeciE+pK7BY v6M0PeDkF91+mg02ydxACvnPzCXYT9UR3b0YX0v/udFocCfVH8ndZcTT9fvs8fKDogXe nyf9iXKc2Edc5gGV4r97b/e2XpFlBF+Vb46OWhSQNTSEUTArC3540HqAhrEEDM4GuumC IVoQ== 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 w21-v6si14792727pll.96.2018.07.01.11.25.06; Sun, 01 Jul 2018 11:25:20 -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 S965051AbeGASXQ (ORCPT + 99 others); Sun, 1 Jul 2018 14:23:16 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33444 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753558AbeGAQY0 (ORCPT ); Sun, 1 Jul 2018 12:24:26 -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 04E45AEF; Sun, 1 Jul 2018 16:24:25 +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.9 012/101] ASoC: dapm: delete dapm_kcontrol_data paths list before freeing it Date: Sun, 1 Jul 2018 18:20:58 +0200 Message-Id: <20180701160757.630627041@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160757.138608453@linuxfoundation.org> References: <20180701160757.138608453@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.9-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 @@ -425,6 +425,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); }