Home Home > GIT Browse > openSUSE-15.1
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-01-10 20:41:49 +0100
committerTakashi Iwai <tiwai@suse.de>2019-01-11 08:35:12 +0100
commit36052ff43212c5d6a4b127eccdba3154be55ebfc (patch)
tree4d06ac74944c1254a81e596d405c75a684290479
parent5776501b24c366e095c64c3d1d80312ba277e26b (diff)
ALSA: pcm: signedness bug in snd_pcm_plug_alloc() (bsc#1121278).
-rw-r--r--patches.drivers/ALSA-pcm-signedness-bug-in-snd_pcm_plug_alloc.patch43
-rw-r--r--series.conf1
2 files changed, 44 insertions, 0 deletions
diff --git a/patches.drivers/ALSA-pcm-signedness-bug-in-snd_pcm_plug_alloc.patch b/patches.drivers/ALSA-pcm-signedness-bug-in-snd_pcm_plug_alloc.patch
new file mode 100644
index 0000000000..901e62e8b1
--- /dev/null
+++ b/patches.drivers/ALSA-pcm-signedness-bug-in-snd_pcm_plug_alloc.patch
@@ -0,0 +1,43 @@
+From 6f128fa41f310e1f39ebcea9621d2905549ecf52 Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@oracle.com>
+Date: Mon, 27 Aug 2018 12:21:45 +0300
+Subject: [PATCH] ALSA: pcm: signedness bug in snd_pcm_plug_alloc()
+Git-commit: 6f128fa41f310e1f39ebcea9621d2905549ecf52
+Patch-mainline: v4.20-rc1
+References: bsc#1121278
+
+The "frames" variable is unsigned so the error handling doesn't work
+properly.
+
+Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ sound/core/oss/pcm_plugin.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/sound/core/oss/pcm_plugin.c b/sound/core/oss/pcm_plugin.c
+index 0391cb1a4f19..141c5f3a9575 100644
+--- a/sound/core/oss/pcm_plugin.c
++++ b/sound/core/oss/pcm_plugin.c
+@@ -111,7 +111,7 @@ int snd_pcm_plug_alloc(struct snd_pcm_substream *plug, snd_pcm_uframes_t frames)
+ while (plugin->next) {
+ if (plugin->dst_frames)
+ frames = plugin->dst_frames(plugin, frames);
+- if (snd_BUG_ON(frames <= 0))
++ if (snd_BUG_ON((snd_pcm_sframes_t)frames <= 0))
+ return -ENXIO;
+ plugin = plugin->next;
+ err = snd_pcm_plugin_alloc(plugin, frames);
+@@ -123,7 +123,7 @@ int snd_pcm_plug_alloc(struct snd_pcm_substream *plug, snd_pcm_uframes_t frames)
+ while (plugin->prev) {
+ if (plugin->src_frames)
+ frames = plugin->src_frames(plugin, frames);
+- if (snd_BUG_ON(frames <= 0))
++ if (snd_BUG_ON((snd_pcm_sframes_t)frames <= 0))
+ return -ENXIO;
+ plugin = plugin->prev;
+ err = snd_pcm_plugin_alloc(plugin, frames);
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index 07ba4f8ab5..b154cd1353 100644
--- a/series.conf
+++ b/series.conf
@@ -40506,6 +40506,7 @@
patches.fixes/scsi-fnic-replace-gross-legacy-tag-hack-with-blk-mq-.patch
patches.drivers/scsi-hisi_sas-Fix-NULL-pointer-dereference.patch
patches.drivers/ALSA-pcm-Return-0-when-size-start_threshold-in-captu.patch
+ patches.drivers/ALSA-pcm-signedness-bug-in-snd_pcm_plug_alloc.patch
patches.drivers/ALSA-memalloc-Don-t-align-the-size-to-power-of-two.patch
patches.drivers/ALSA-memalloc-Simplify-snd_malloc_dev_pages-calls.patch
patches.drivers/ALSA-memalloc-Add-non-cached-buffer-type.patch