From: Greg Kroah-Hartman Date: Mon, 14 Jan 2013 17:34:10 +0000 (-0800) Subject: 3.7-stable patches X-Git-Tag: v3.7.3~68 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=74f6fc9243d2d5e9163da5c1c1df29d6ef25a1c5;p=thirdparty%2Fkernel%2Fstable-queue.git 3.7-stable patches added patches: ext4-fix-memory-leak-in-ext4_xattr_set_acl-s-error-path.patch ext4-fix-possible-use-after-free-with-metadata-csum.patch mfd-only-unregister-platform-devices-allocated-by-the-mfd-core.patch mfd-remove-unicode-byte-order-marks-from-da9055.patch mfd-wm8994-add-support-for-wm1811-rev-e.patch --- diff --git a/queue-3.7/ext4-fix-memory-leak-in-ext4_xattr_set_acl-s-error-path.patch b/queue-3.7/ext4-fix-memory-leak-in-ext4_xattr_set_acl-s-error-path.patch new file mode 100644 index 00000000000..f9449dc71eb --- /dev/null +++ b/queue-3.7/ext4-fix-memory-leak-in-ext4_xattr_set_acl-s-error-path.patch @@ -0,0 +1,39 @@ +From 24ec19b0ae83a385ad9c55520716da671274b96c Mon Sep 17 00:00:00 2001 +From: Eugene Shatokhin +Date: Thu, 8 Nov 2012 15:11:11 -0500 +Subject: ext4: fix memory leak in ext4_xattr_set_acl()'s error path + +From: Eugene Shatokhin + +commit 24ec19b0ae83a385ad9c55520716da671274b96c upstream. + +In ext4_xattr_set_acl(), if ext4_journal_start() returns an error, +posix_acl_release() will not be called for 'acl' which may result in a +memory leak. + +This patch fixes that. + +Reviewed-by: Lukas Czerner +Signed-off-by: Eugene Shatokhin +Signed-off-by: "Theodore Ts'o" +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ext4/acl.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/fs/ext4/acl.c ++++ b/fs/ext4/acl.c +@@ -423,8 +423,10 @@ ext4_xattr_set_acl(struct dentry *dentry + + retry: + handle = ext4_journal_start(inode, EXT4_DATA_TRANS_BLOCKS(inode->i_sb)); +- if (IS_ERR(handle)) +- return PTR_ERR(handle); ++ if (IS_ERR(handle)) { ++ error = PTR_ERR(handle); ++ goto release_and_out; ++ } + error = ext4_set_acl(handle, inode, type, acl); + ext4_journal_stop(handle); + if (error == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries)) diff --git a/queue-3.7/ext4-fix-possible-use-after-free-with-metadata-csum.patch b/queue-3.7/ext4-fix-possible-use-after-free-with-metadata-csum.patch new file mode 100644 index 00000000000..4a496ad26f3 --- /dev/null +++ b/queue-3.7/ext4-fix-possible-use-after-free-with-metadata-csum.patch @@ -0,0 +1,44 @@ +From aeb1e5d69a5be592e86a926be73efb38c55af404 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Thu, 29 Nov 2012 21:21:22 -0500 +Subject: ext4: fix possible use after free with metadata csum + +From: Theodore Ts'o + +commit aeb1e5d69a5be592e86a926be73efb38c55af404 upstream. + +Commit fa77dcfafeaa introduces block bitmap checksum calculation into +ext4_new_inode() in the case that block group was uninitialized. +However we brelse() the bitmap buffer before we attempt to checksum it +so we have no guarantee that the buffer is still there. + +Fix this by releasing the buffer after the possible checksum +computation. + +Signed-off-by: Lukas Czerner +Signed-off-by: "Theodore Ts'o" +Acked-by: Darrick J. Wong +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ext4/ialloc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/ext4/ialloc.c ++++ b/fs/ext4/ialloc.c +@@ -762,7 +762,6 @@ got: + + BUFFER_TRACE(block_bitmap_bh, "dirty block bitmap"); + err = ext4_handle_dirty_metadata(handle, NULL, block_bitmap_bh); +- brelse(block_bitmap_bh); + + /* recheck and clear flag under lock if we still need to */ + ext4_lock_group(sb, group); +@@ -775,6 +774,7 @@ got: + ext4_group_desc_csum_set(sb, group, gdp); + } + ext4_unlock_group(sb, group); ++ brelse(block_bitmap_bh); + + if (err) + goto fail; diff --git a/queue-3.7/mfd-only-unregister-platform-devices-allocated-by-the-mfd-core.patch b/queue-3.7/mfd-only-unregister-platform-devices-allocated-by-the-mfd-core.patch new file mode 100644 index 00000000000..3bc656a3bb5 --- /dev/null +++ b/queue-3.7/mfd-only-unregister-platform-devices-allocated-by-the-mfd-core.patch @@ -0,0 +1,68 @@ +From b9fbb62eb61452d728c39b2e5020739c575aac53 Mon Sep 17 00:00:00 2001 +From: Charles Keepax +Date: Fri, 9 Nov 2012 16:15:28 +0000 +Subject: mfd: Only unregister platform devices allocated by the mfd core + +From: Charles Keepax + +commit b9fbb62eb61452d728c39b2e5020739c575aac53 upstream. + +mfd_remove_devices would iterate over all devices sharing a parent with +an mfd device regardless of whether they were allocated by the mfd core +or not. This especially caused problems when the device structure was +not contained within a platform_device, because to_platform_device is +used on each device pointer. + +This patch defines a device_type for mfd devices and checks this is +present from mfd_remove_devices_fn before processing the device. + +Signed-off-by: Charles Keepax +Tested-by: Peter Tyser +Reviewed-by: Mark Brown +Signed-off-by: Samuel Ortiz +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mfd/mfd-core.c | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +--- a/drivers/mfd/mfd-core.c ++++ b/drivers/mfd/mfd-core.c +@@ -21,6 +21,10 @@ + #include + #include + ++static struct device_type mfd_dev_type = { ++ .name = "mfd_device", ++}; ++ + int mfd_cell_enable(struct platform_device *pdev) + { + const struct mfd_cell *cell = mfd_get_cell(pdev); +@@ -91,6 +95,7 @@ static int mfd_add_device(struct device + goto fail_device; + + pdev->dev.parent = parent; ++ pdev->dev.type = &mfd_dev_type; + + if (parent->of_node && cell->of_compatible) { + for_each_child_of_node(parent->of_node, np) { +@@ -204,10 +209,16 @@ EXPORT_SYMBOL(mfd_add_devices); + + static int mfd_remove_devices_fn(struct device *dev, void *c) + { +- struct platform_device *pdev = to_platform_device(dev); +- const struct mfd_cell *cell = mfd_get_cell(pdev); ++ struct platform_device *pdev; ++ const struct mfd_cell *cell; + atomic_t **usage_count = c; + ++ if (dev->type != &mfd_dev_type) ++ return 0; ++ ++ pdev = to_platform_device(dev); ++ cell = mfd_get_cell(pdev); ++ + /* find the base address of usage_count pointers (for freeing) */ + if (!*usage_count || (cell->usage_count < *usage_count)) + *usage_count = cell->usage_count; diff --git a/queue-3.7/mfd-remove-unicode-byte-order-marks-from-da9055.patch b/queue-3.7/mfd-remove-unicode-byte-order-marks-from-da9055.patch new file mode 100644 index 00000000000..1abfa2c136e --- /dev/null +++ b/queue-3.7/mfd-remove-unicode-byte-order-marks-from-da9055.patch @@ -0,0 +1,69 @@ +From 90a38d999739f35f4fc925c875e6ee518546b66c Mon Sep 17 00:00:00 2001 +From: Geert Uytterhoeven +Date: Mon, 15 Oct 2012 22:44:45 +0200 +Subject: mfd: Remove Unicode Byte Order Marks from da9055 + +From: Geert Uytterhoeven + +commit 90a38d999739f35f4fc925c875e6ee518546b66c upstream. + +Older gcc (< 4.4) doesn't like files starting with Unicode BOMs: + +include/linux/mfd/da9055/core.h:1: error: stray ‘\357’ in program +include/linux/mfd/da9055/core.h:1: error: stray ‘\273’ in program +include/linux/mfd/da9055/core.h:1: error: stray ‘\277’ in program +include/linux/mfd/da9055/pdata.h:1: error: stray ‘\357’ in program +include/linux/mfd/da9055/pdata.h:1: error: stray ‘\273’ in program +include/linux/mfd/da9055/pdata.h:1: error: stray ‘\277’ in program +include/linux/mfd/da9055/reg.h:1: error: stray ‘\357’ in program +include/linux/mfd/da9055/reg.h:1: error: stray ‘\273’ in program +include/linux/mfd/da9055/reg.h:1: error: stray ‘\277’ in program + +Remove the BOMs, the rest of the files is plain ASCII anyway. + +Output of "file" before: + +include/linux/mfd/da9055/core.h: UTF-8 Unicode (with BOM) C program text +include/linux/mfd/da9055/pdata.h: UTF-8 Unicode (with BOM) C program text +include/linux/mfd/da9055/reg.h: UTF-8 Unicode (with BOM) C program text + +Output of "file" after: + +include/linux/mfd/da9055/core.h: ASCII C program text +include/linux/mfd/da9055/pdata.h: ASCII C program text +include/linux/mfd/da9055/reg.h: ASCII C program text + +Signed-off-by: Geert Uytterhoeven +Signed-off-by: Samuel Ortiz +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/mfd/da9055/core.h | 2 +- + include/linux/mfd/da9055/pdata.h | 2 +- + include/linux/mfd/da9055/reg.h | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +--- a/include/linux/mfd/da9055/core.h ++++ b/include/linux/mfd/da9055/core.h +@@ -1,4 +1,4 @@ +-/* ++/* + * da9055 declarations for DA9055 PMICs. + * + * Copyright(c) 2012 Dialog Semiconductor Ltd. +--- a/include/linux/mfd/da9055/pdata.h ++++ b/include/linux/mfd/da9055/pdata.h +@@ -1,4 +1,4 @@ +-/* Copyright (C) 2012 Dialog Semiconductor Ltd. ++/* Copyright (C) 2012 Dialog Semiconductor Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by +--- a/include/linux/mfd/da9055/reg.h ++++ b/include/linux/mfd/da9055/reg.h +@@ -1,4 +1,4 @@ +-/* ++/* + * DA9055 declarations for DA9055 PMICs. + * + * Copyright(c) 2012 Dialog Semiconductor Ltd. diff --git a/queue-3.7/mfd-wm8994-add-support-for-wm1811-rev-e.patch b/queue-3.7/mfd-wm8994-add-support-for-wm1811-rev-e.patch new file mode 100644 index 00000000000..589f7fed418 --- /dev/null +++ b/queue-3.7/mfd-wm8994-add-support-for-wm1811-rev-e.patch @@ -0,0 +1,29 @@ +From fee546ce8cfd9dea1f53175f627e17ef5ff05df4 Mon Sep 17 00:00:00 2001 +From: Mark Brown +Date: Fri, 23 Nov 2012 12:05:33 +0900 +Subject: mfd: wm8994: Add support for WM1811 rev E + +From: Mark Brown + +commit fee546ce8cfd9dea1f53175f627e17ef5ff05df4 upstream. + +This is supported identically to the previous revisions. + +Signed-off-by: Mark Brown +Signed-off-by: Samuel Ortiz +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mfd/wm8994-core.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/mfd/wm8994-core.c ++++ b/drivers/mfd/wm8994-core.c +@@ -557,6 +557,7 @@ static __devinit int wm8994_device_init( + case 1: + case 2: + case 3: ++ case 4: + regmap_patch = wm1811_reva_patch; + patch_regs = ARRAY_SIZE(wm1811_reva_patch); + break; diff --git a/queue-3.7/series b/queue-3.7/series index d84e5c9ae23..d7b9636c67c 100644 --- a/queue-3.7/series +++ b/queue-3.7/series @@ -48,3 +48,8 @@ libata-fix-null-pointer-dereference-on-disk-error.patch target-file-fix-32-bit-highmem-breakage-for-sgl-iovec-mapping.patch target-tcm_fc-fix-the-lockdep-warning-due-to-inconsistent-lock-state.patch sbp-target-fix-error-path-in-sbp_make_tpg.patch +mfd-wm8994-add-support-for-wm1811-rev-e.patch +mfd-only-unregister-platform-devices-allocated-by-the-mfd-core.patch +mfd-remove-unicode-byte-order-marks-from-da9055.patch +ext4-fix-memory-leak-in-ext4_xattr_set_acl-s-error-path.patch +ext4-fix-possible-use-after-free-with-metadata-csum.patch