From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:58723 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753969AbbHNAoj (ORCPT ); Thu, 13 Aug 2015 20:44:39 -0400 Subject: Patch "ASoC: dapm: Lock during userspace access" has been added to the 4.1-stable tree To: lars@metafoo.de, broonie@kernel.org, gregkh@linuxfoundation.org Cc: , From: Date: Thu, 13 Aug 2015 17:44:38 -0700 Message-ID: <143951307828178@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled ASoC: dapm: Lock during userspace access to the 4.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: asoc-dapm-lock-during-userspace-access.patch and it can be found in the queue-4.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From e50b1e06b79e9d51efbff9627b4dd407184ef43f Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Mon, 6 Jul 2015 17:01:24 +0200 Subject: ASoC: dapm: Lock during userspace access From: Lars-Peter Clausen commit e50b1e06b79e9d51efbff9627b4dd407184ef43f upstream. The DAPM lock must be held when accessing the DAPM graph status through sysfs or debugfs, otherwise concurrent changes to the graph can result in undefined behaviour. Signed-off-by: Lars-Peter Clausen Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/soc-dapm.c | 9 +++++++++ 1 file changed, 9 insertions(+) --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -1811,6 +1811,7 @@ static ssize_t dapm_widget_power_read_fi size_t count, loff_t *ppos) { struct snd_soc_dapm_widget *w = file->private_data; + struct snd_soc_card *card = w->dapm->card; char *buf; int in, out; ssize_t ret; @@ -1820,6 +1821,8 @@ static ssize_t dapm_widget_power_read_fi if (!buf) return -ENOMEM; + mutex_lock(&card->dapm_mutex); + /* Supply widgets are not handled by is_connected_{input,output}_ep() */ if (w->is_supply) { in = 0; @@ -1866,6 +1869,8 @@ static ssize_t dapm_widget_power_read_fi p->sink->name); } + mutex_unlock(&card->dapm_mutex); + ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret); kfree(buf); @@ -2140,11 +2145,15 @@ static ssize_t dapm_widget_show(struct d struct snd_soc_pcm_runtime *rtd = dev_get_drvdata(dev); int i, count = 0; + mutex_lock(&rtd->card->dapm_mutex); + for (i = 0; i < rtd->num_codecs; i++) { struct snd_soc_codec *codec = rtd->codec_dais[i]->codec; count += dapm_widget_show_codec(codec, buf + count); } + mutex_unlock(&rtd->card->dapm_mutex); + return count; } Patches currently in stable-queue which might be from lars@metafoo.de are queue-4.1/asoc-dapm-lock-during-userspace-access.patch queue-4.1/dmaengine-pl330-really-fix-choppy-sound-because-of-wrong-residue-calculation.patch queue-4.1/asoc-dapm-don-t-add-prefix-to-widget-stream-name.patch queue-4.1/asoc-ssm4567-keep-tdm_bclks-in-ssm4567_set_dai_fmt.patch