linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: stable@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Eric Whitney <enwlinux@gmail.com>,
	"Theodore Ts'o" <tytso@mit.edu>, Jiri Slaby <jslaby@suse.cz>
Subject: [PATCH 3.12 39/50] ext4: fix error return from ext4_ext_handle_uninitialized_extents()
Date: Mon,  5 May 2014 14:43:21 +0200	[thread overview]
Message-ID: <e3794f95677d19a6c31d7716c277ad8fb3f53884.1399292849.git.jslaby@suse.cz> (raw)
In-Reply-To: <7d4f4737432af6216e86975e587331b9d8b08063.1399292849.git.jslaby@suse.cz>
In-Reply-To: <cover.1399292849.git.jslaby@suse.cz>

From: Eric Whitney <enwlinux@gmail.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit ce37c42919608e96ade3748fe23c3062a0a966c5 upstream.

Commit 3779473246 breaks the return of error codes from
ext4_ext_handle_uninitialized_extents() in ext4_ext_map_blocks().  A
portion of the patch assigns that function's signed integer return
value to an unsigned int.  Consequently, negatively valued error codes
are lost and can be treated as a bogus allocated block count.

Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 fs/ext4/extents.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index e678549ec994..bd048b6addad 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4159,7 +4159,7 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
 	struct ext4_extent newex, *ex, *ex2;
 	struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
 	ext4_fsblk_t newblock = 0;
-	int free_on_err = 0, err = 0, depth;
+	int free_on_err = 0, err = 0, depth, ret;
 	unsigned int allocated = 0, offset = 0;
 	unsigned int allocated_clusters = 0;
 	struct ext4_allocation_request ar;
@@ -4220,9 +4220,13 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
 			if (!ext4_ext_is_uninitialized(ex))
 				goto out;
 
-			allocated = ext4_ext_handle_uninitialized_extents(
+			ret = ext4_ext_handle_uninitialized_extents(
 				handle, inode, map, path, flags,
 				allocated, newblock);
+			if (ret < 0)
+				err = ret;
+			else
+				allocated = ret;
 			goto out3;
 		}
 	}
-- 
1.9.2


  parent reply	other threads:[~2014-05-05 12:50 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-05 12:28 [PATCH 3.12 00/50] 3.12.19-stable review Jiri Slaby
2014-05-05 12:42 ` [PATCH 3.12 01/50] openvswitch: fix vport-netdev unregister Jiri Slaby
2014-05-05 12:42 ` [PATCH 3.12 02/50] brcmsmac: fix deadlock on missing firmware Jiri Slaby
2014-05-05 12:42 ` [PATCH 3.12 03/50] /dev/mem: handle out-of-bounds read/write Jiri Slaby
2014-05-05 12:42 ` [PATCH 3.12 04/50] drivers/net: tulip_remove_one needs to call pci_disable_device() Jiri Slaby
2014-05-05 12:42 ` [PATCH 3.12 05/50] Bluetooth: Add support for Intel Bluetooth device [8087:0a2a] Jiri Slaby
2014-05-05 12:42 ` [PATCH 3.12 06/50] iommu/amd: Fix PASID format in INVALIDATE_IOTLB_PAGES command Jiri Slaby
2014-05-05 12:42 ` [PATCH 3.12 07/50] usbatm: Fix dynamic_debug / ratelimited atm_dbg and atm_rldbg macros Jiri Slaby
2014-05-05 12:42 ` [PATCH 3.12 08/50] printk: pr_debug_ratelimited: check state first to reduce "callbacks suppressed" messages Jiri Slaby
2014-05-05 12:42 ` [PATCH 3.12 09/50] dcache: restore error on restart in prepend_path Jiri Slaby
2014-05-05 12:42 ` [PATCH 3.12 10/50] __dentry_path() fixes Jiri Slaby
2014-05-05 12:42 ` [PATCH 3.12 11/50] i2c: i801: enable Intel BayTrail SMBUS Jiri Slaby
2014-05-05 12:42 ` [PATCH 3.12 12/50] e1000e: Fix no connectivity when driver loaded with cable out Jiri Slaby
2014-05-05 12:42 ` [PATCH 3.12 13/50] ACPI / EC: Process rather than discard events in acpi_ec_clear Jiri Slaby
2014-05-05 12:42 ` [PATCH 3.12 14/50] ARM: 7840/1: LPAE: don't reject mapping /dev/mem above 4GB Jiri Slaby
2014-05-05 12:42 ` [PATCH 3.12 15/50] x86/quirks: Add workaround for AMD F16h Erratum792 Jiri Slaby
2014-05-05 12:42 ` [PATCH 3.12 16/50] amd64_edac: Fix logic to determine channel for F15 M30h processors Jiri Slaby
2014-05-05 12:42 ` [PATCH 3.12 17/50] backing_dev: fix hung task on sync Jiri Slaby
2014-05-05 12:43 ` [PATCH 3.12 18/50] bdi: avoid oops on device removal Jiri Slaby
2014-05-05 12:43 ` [PATCH 3.12 19/50] virtio_balloon: don't softlockup on huge balloon changes Jiri Slaby
2014-05-05 12:43 ` [PATCH 3.12 20/50] ipmi: Fix a race restarting the timer Jiri Slaby
2014-05-05 12:43 ` [PATCH 3.12 21/50] KVM: ioapic: fix assignment of ioapic->rtc_status.pending_eoi (CVE-2014-0155) Jiri Slaby
2014-05-05 12:43 ` [PATCH 3.12 22/50] net: ipv4: current group_info should be put after using Jiri Slaby
2014-05-05 12:43 ` [PATCH 3.12 24/50] powerpc/8xx: mfspr SPRN_TBRx in lieu of mftb/mftbu is not supported Jiri Slaby
2014-05-05 12:43 ` [PATCH 3.12 25/50] ACPI / sleep: remove panic in case hardware has changed after S4 Jiri Slaby
2014-05-05 12:43 ` [PATCH 3.12 26/50] user namespace: fix incorrect memory barriers Jiri Slaby
2014-05-05 12:43 ` [PATCH 3.12 27/50] x86: Adjust irq remapping quirk for older revisions of 5500/5520 chipsets Jiri Slaby
2014-05-05 12:43 ` [PATCH 3.12 28/50] PCI: designware: Fix RC BAR to be single 64-bit non-prefetchable memory BAR Jiri Slaby
2014-05-05 12:43 ` [PATCH 3.12 29/50] PCI: designware: Fix iATU programming for cfg1, io and mem viewport Jiri Slaby
2014-05-05 12:43 ` [PATCH 3.12 30/50] ACPI / button: Add ACPI Button event via netlink routine Jiri Slaby
2014-05-05 12:43 ` [PATCH 3.12 31/50] staging: comedi: 8255_pci: initialize MITE data window Jiri Slaby
2014-05-05 12:43 ` [PATCH 3.12 32/50] tty: Set correct tty name in 'active' sysfs attribute Jiri Slaby
2014-05-05 12:43 ` [PATCH 3.12 33/50] tty: Fix low_latency BUG Jiri Slaby
2014-05-05 12:43 ` [PATCH 3.12 35/50] Bluetooth: Fix removing Long Term Key Jiri Slaby
2014-05-05 12:43 ` [PATCH 3.12 36/50] xfs: fix directory hash ordering bug Jiri Slaby
2014-05-05 12:43 ` [PATCH 3.12 37/50] Btrfs: skip submitting barrier for missing device Jiri Slaby
2014-05-05 12:43 ` [PATCH 3.12 38/50] Btrfs: fix deadlock with nested trans handles Jiri Slaby
2014-05-05 12:43 ` Jiri Slaby [this message]
2014-05-05 12:43 ` [PATCH 3.12 40/50] ext4: fix partial cluster handling for bigalloc file systems Jiri Slaby
2014-05-05 12:43 ` [PATCH 3.12 41/50] ext4: fix premature freeing of partial clusters split across leaf blocks Jiri Slaby
2014-05-05 12:43 ` [PATCH 3.12 42/50] jffs2: Fix segmentation fault found in stress test Jiri Slaby
2014-05-05 12:43 ` [PATCH 3.12 43/50] jffs2: Fix crash due to truncation of csize Jiri Slaby
2014-05-05 12:43 ` [PATCH 3.12 44/50] jffs2: avoid soft-lockup in jffs2_reserve_space_gc() Jiri Slaby
2014-05-05 12:43 ` [PATCH 3.12 45/50] jffs2: remove from wait queue after schedule() Jiri Slaby
2014-05-05 12:43 ` [PATCH 3.12 46/50] sparc32: fix build failure for arch_jump_label_transform Jiri Slaby
2014-05-05 12:43 ` [PATCH 3.12 47/50] sparc64: don't treat 64-bit syscall return codes as 32-bit Jiri Slaby
2014-05-05 12:43 ` [PATCH 3.12 48/50] sparc64: Make sure %pil interrupts are enabled during hypervisor yield Jiri Slaby
2014-05-05 12:43 ` [PATCH 3.12 49/50] wait: fix reparent_leader() vs EXIT_DEAD->EXIT_ZOMBIE race Jiri Slaby
2014-05-05 12:43 ` [PATCH 3.12 50/50] exit: call disassociate_ctty() before exit_task_namespaces() Jiri Slaby
2014-05-05 15:45 ` [PATCH 3.12 00/50] 3.12.19-stable review Guenter Roeck
2014-05-06 14:57 ` Shuah Khan
2014-05-09  8:32   ` Jiri Slaby

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e3794f95677d19a6c31d7716c277ad8fb3f53884.1399292849.git.jslaby@suse.cz \
    --to=jslaby@suse.cz \
    --cc=enwlinux@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).