Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-08-16 22:01:45 +0200
committerJiri Slaby <jslaby@suse.cz>2019-08-16 22:25:11 +0200
commit48c9dd81b6d0f3c75477ee7fe9287164a7b9cf8d (patch)
tree776ceb2ffe170d363dde85da48b4b7fd07d3696c
parent215d58aea220c05b2dab2c04fefc21188b0ab33f (diff)
ALSA: firewire: fix a memory leak bug (bnc#1012628).
-rw-r--r--patches.kernel.org/5.2.9-126-ALSA-firewire-fix-a-memory-leak-bug.patch44
-rw-r--r--series.conf1
2 files changed, 45 insertions, 0 deletions
diff --git a/patches.kernel.org/5.2.9-126-ALSA-firewire-fix-a-memory-leak-bug.patch b/patches.kernel.org/5.2.9-126-ALSA-firewire-fix-a-memory-leak-bug.patch
new file mode 100644
index 0000000000..ce4e5f94e8
--- /dev/null
+++ b/patches.kernel.org/5.2.9-126-ALSA-firewire-fix-a-memory-leak-bug.patch
@@ -0,0 +1,44 @@
+From: Wenwen Wang <wenwen@cs.uga.edu>
+Date: Thu, 8 Aug 2019 00:50:58 -0500
+Subject: [PATCH] ALSA: firewire: fix a memory leak bug
+References: bnc#1012628
+Patch-mainline: 5.2.9
+Git-commit: 1be3c1fae6c1e1f5bb982b255d2034034454527a
+
+commit 1be3c1fae6c1e1f5bb982b255d2034034454527a upstream.
+
+In iso_packets_buffer_init(), 'b->packets' is allocated through
+kmalloc_array(). Then, the aligned packet size is checked. If it is
+larger than PAGE_SIZE, -EINVAL will be returned to indicate the error.
+However, the allocated 'b->packets' is not deallocated on this path,
+leading to a memory leak.
+
+To fix the above issue, free 'b->packets' before returning the error code.
+
+Fixes: 31ef9134eb52 ("ALSA: add LaCie FireWire Speakers/Griffin FireWave Surround driver")
+Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>
+Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
+Cc: <stable@vger.kernel.org> # v2.6.39+
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ sound/firewire/packets-buffer.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sound/firewire/packets-buffer.c b/sound/firewire/packets-buffer.c
+index 0d35359d25cd..0ecafd0c6722 100644
+--- a/sound/firewire/packets-buffer.c
++++ b/sound/firewire/packets-buffer.c
+@@ -37,7 +37,7 @@ int iso_packets_buffer_init(struct iso_packets_buffer *b, struct fw_unit *unit,
+ packets_per_page = PAGE_SIZE / packet_size;
+ if (WARN_ON(!packets_per_page)) {
+ err = -EINVAL;
+- goto error;
++ goto err_packets;
+ }
+ pages = DIV_ROUND_UP(count, packets_per_page);
+
+--
+2.22.0
+
diff --git a/series.conf b/series.conf
index f8ae9aeada..ff30fa73b7 100644
--- a/series.conf
+++ b/series.conf
@@ -1146,6 +1146,7 @@
patches.kernel.org/5.2.9-123-hwmon-nct7802-Fix-wrong-detection-of-in4-presen.patch
patches.kernel.org/5.2.9-124-hwmon-lm75-Fixup-tmp75b-clr_mask.patch
patches.kernel.org/5.2.9-125-drm-i915-Fix-wrong-escape-clock-divisor-init-fo.patch
+ patches.kernel.org/5.2.9-126-ALSA-firewire-fix-a-memory-leak-bug.patch
########################################################
# Build fixes that apply to the vanilla kernel too.