From: Greg Kroah-Hartman Date: Mon, 4 May 2020 09:59:25 +0000 (+0200) Subject: 4.4-stable patches X-Git-Tag: v4.4.222~28 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cd1aded8ca6bd622bc95949de0d3858c9fe1bb51;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: alsa-pcm-oss-place-the-plugin-buffer-overflow-checks-correctly.patch pm-acpi-output-correct-message-on-target-power-state.patch --- diff --git a/queue-4.4/alsa-pcm-oss-place-the-plugin-buffer-overflow-checks-correctly.patch b/queue-4.4/alsa-pcm-oss-place-the-plugin-buffer-overflow-checks-correctly.patch new file mode 100644 index 00000000000..570e214c7c5 --- /dev/null +++ b/queue-4.4/alsa-pcm-oss-place-the-plugin-buffer-overflow-checks-correctly.patch @@ -0,0 +1,92 @@ +From 4285de0725b1bf73608abbcd35ad7fd3ddc0b61e Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Fri, 24 Apr 2020 21:33:50 +0200 +Subject: ALSA: pcm: oss: Place the plugin buffer overflow checks correctly + +From: Takashi Iwai + +commit 4285de0725b1bf73608abbcd35ad7fd3ddc0b61e upstream. + +The checks of the plugin buffer overflow in the previous fix by commit + f2ecf903ef06 ("ALSA: pcm: oss: Avoid plugin buffer overflow") +are put in the wrong places mistakenly, which leads to the expected +(repeated) sound when the rate plugin is involved. Fix in the right +places. + +Also, at those right places, the zero check is needed for the +termination node, so added there as well, and let's get it done, +finally. + +Fixes: f2ecf903ef06 ("ALSA: pcm: oss: Avoid plugin buffer overflow") +Cc: +Link: https://lore.kernel.org/r/20200424193350.19678-1-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/core/oss/pcm_plugin.c | 20 ++++++++++++-------- + 1 file changed, 12 insertions(+), 8 deletions(-) + +--- a/sound/core/oss/pcm_plugin.c ++++ b/sound/core/oss/pcm_plugin.c +@@ -211,21 +211,23 @@ static snd_pcm_sframes_t plug_client_siz + if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + plugin = snd_pcm_plug_last(plug); + while (plugin && drv_frames > 0) { +- if (check_size && drv_frames > plugin->buf_frames) +- drv_frames = plugin->buf_frames; + plugin_prev = plugin->prev; + if (plugin->src_frames) + drv_frames = plugin->src_frames(plugin, drv_frames); ++ if (check_size && plugin->buf_frames && ++ drv_frames > plugin->buf_frames) ++ drv_frames = plugin->buf_frames; + plugin = plugin_prev; + } + } else if (stream == SNDRV_PCM_STREAM_CAPTURE) { + plugin = snd_pcm_plug_first(plug); + while (plugin && drv_frames > 0) { + plugin_next = plugin->next; ++ if (check_size && plugin->buf_frames && ++ drv_frames > plugin->buf_frames) ++ drv_frames = plugin->buf_frames; + if (plugin->dst_frames) + drv_frames = plugin->dst_frames(plugin, drv_frames); +- if (check_size && drv_frames > plugin->buf_frames) +- drv_frames = plugin->buf_frames; + plugin = plugin_next; + } + } else +@@ -251,26 +253,28 @@ static snd_pcm_sframes_t plug_slave_size + plugin = snd_pcm_plug_first(plug); + while (plugin && frames > 0) { + plugin_next = plugin->next; ++ if (check_size && plugin->buf_frames && ++ frames > plugin->buf_frames) ++ frames = plugin->buf_frames; + if (plugin->dst_frames) { + frames = plugin->dst_frames(plugin, frames); + if (frames < 0) + return frames; + } +- if (check_size && frames > plugin->buf_frames) +- frames = plugin->buf_frames; + plugin = plugin_next; + } + } else if (stream == SNDRV_PCM_STREAM_CAPTURE) { + plugin = snd_pcm_plug_last(plug); + while (plugin) { +- if (check_size && frames > plugin->buf_frames) +- frames = plugin->buf_frames; + plugin_prev = plugin->prev; + if (plugin->src_frames) { + frames = plugin->src_frames(plugin, frames); + if (frames < 0) + return frames; + } ++ if (check_size && plugin->buf_frames && ++ frames > plugin->buf_frames) ++ frames = plugin->buf_frames; + plugin = plugin_prev; + } + } else diff --git a/queue-4.4/pm-acpi-output-correct-message-on-target-power-state.patch b/queue-4.4/pm-acpi-output-correct-message-on-target-power-state.patch new file mode 100644 index 00000000000..a37e704467e --- /dev/null +++ b/queue-4.4/pm-acpi-output-correct-message-on-target-power-state.patch @@ -0,0 +1,43 @@ +From a9b760b0266f563b4784f695bbd0e717610dc10a Mon Sep 17 00:00:00 2001 +From: Kai-Heng Feng +Date: Tue, 21 Apr 2020 15:55:16 +0800 +Subject: PM: ACPI: Output correct message on target power state + +From: Kai-Heng Feng + +commit a9b760b0266f563b4784f695bbd0e717610dc10a upstream. + +Transitioned power state logged at the end of setting ACPI power. + +However, D3cold won't be in the message because state can only be +D3hot at most. + +Use target_state to corretly report when power state is D3cold. + +Cc: All applicable +Signed-off-by: Kai-Heng Feng +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/device_pm.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/acpi/device_pm.c ++++ b/drivers/acpi/device_pm.c +@@ -225,13 +225,13 @@ int acpi_device_set_power(struct acpi_de + end: + if (result) { + dev_warn(&device->dev, "Failed to change power state to %s\n", +- acpi_power_state_string(state)); ++ acpi_power_state_string(target_state)); + } else { + device->power.state = target_state; + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Device [%s] transitioned to %s\n", + device->pnp.bus_id, +- acpi_power_state_string(state))); ++ acpi_power_state_string(target_state))); + } + + return result; diff --git a/queue-4.4/series b/queue-4.4/series index f35a4ca8511..2048088cd65 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -1,2 +1,4 @@ ext4-fix-special-inode-number-checks-in-__ext4_iget.patch drm-qxl-qxl_release-leak-in-qxl_hw_surface_alloc.patch +alsa-pcm-oss-place-the-plugin-buffer-overflow-checks-correctly.patch +pm-acpi-output-correct-message-on-target-power-state.patch