From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, "Theodore Tso" <tytso@mit.edu>,
Zheng Liu <wenqing.lz@taobao.com>, Jan Kara <jack@suse.cz>
Subject: [ 48/48] ext4: avoid hang when mounting non-journal filesystems with orphan list
Date: Fri, 11 Oct 2013 12:36:55 -0700 [thread overview]
Message-ID: <20131011193642.442583175@linuxfoundation.org> (raw)
In-Reply-To: <20131011193637.253208688@linuxfoundation.org>
3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Theodore Ts'o <tytso@mit.edu>
commit 0e9a9a1ad619e7e987815d20262d36a2f95717ca upstream.
When trying to mount a file system which does not contain a journal,
but which does have a orphan list containing an inode which needs to
be truncated, the mount call with hang forever in
ext4_orphan_cleanup() because ext4_orphan_del() will return
immediately without removing the inode from the orphan list, leading
to an uninterruptible loop in kernel code which will busy out one of
the CPU's on the system.
This can be trivially reproduced by trying to mount the file system
found in tests/f_orphan_extents_inode/image.gz from the e2fsprogs
source tree. If a malicious user were to put this on a USB stick, and
mount it on a Linux desktop which has automatic mounts enabled, this
could be considered a potential denial of service attack. (Not a big
deal in practice, but professional paranoids worry about such things,
and have even been known to allocate CVE numbers for such problems.)
-js: This is a fix for CVE-2013-2015.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Acked-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ext4/namei.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -2054,7 +2054,8 @@ int ext4_orphan_del(handle_t *handle, st
int err = 0;
/* ext4_handle_valid() assumes a valid handle_t pointer */
- if (handle && !ext4_handle_valid(handle))
+ if (handle && !ext4_handle_valid(handle) &&
+ !(EXT4_SB(inode->i_sb)->s_mount_state & EXT4_ORPHAN_FS))
return 0;
mutex_lock(&EXT4_SB(inode->i_sb)->s_orphan_lock);
next prev parent reply other threads:[~2013-10-11 19:36 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-11 19:36 [ 00/48] 3.4.66-stable review Greg Kroah-Hartman
2013-10-11 19:36 ` [ 01/48] cpqarray: fix info leak in ida_locked_ioctl() Greg Kroah-Hartman
2013-10-11 19:36 ` [ 02/48] cciss: fix info leak in cciss_ioctl32_passthru() Greg Kroah-Hartman
2013-10-11 19:36 ` [ 03/48] gianfar: Change default HW Tx queue scheduling mode Greg Kroah-Hartman
2013-10-11 19:36 ` [ 04/48] caif: Add missing braces to multiline if in cfctrl_linkup_request Greg Kroah-Hartman
2013-10-11 19:36 ` [ 05/48] net: sctp: fix smatch warning in sctp_send_asconf_del_ip Greg Kroah-Hartman
2013-10-11 19:36 ` [ 06/48] net: flow_dissector: fix thoff for IPPROTO_AH Greg Kroah-Hartman
2013-10-11 19:36 ` [ 07/48] netpoll: fix NULL pointer dereference in netpoll_cleanup Greg Kroah-Hartman
2013-10-11 19:36 ` [ 08/48] net: sctp: fix ipv6 ipsec encryption bug in sctp_v6_xmit Greg Kroah-Hartman
2013-10-11 19:36 ` [ 09/48] resubmit bridge: fix message_age_timer calculation Greg Kroah-Hartman
2013-10-11 19:36 ` [ 10/48] bridge: Clamp forward_delay when enabling STP Greg Kroah-Hartman
2013-10-11 19:36 ` [ 11/48] ip: use ip_hdr() in __ip_make_skb() to retrieve IP header Greg Kroah-Hartman
2013-10-11 19:36 ` [ 12/48] ip: generate unique IP identificator if local fragmentation is allowed Greg Kroah-Hartman
2013-10-11 19:36 ` [ 13/48] ipv6: udp packets following an UFO enqueued packet need also be handled by UFO Greg Kroah-Hartman
2013-10-11 19:36 ` [ 14/48] via-rhine: fix VLAN priority field (PCP, IEEE 802.1p) Greg Kroah-Hartman
2013-10-11 19:36 ` [ 15/48] dm9601: fix IFF_ALLMULTI handling Greg Kroah-Hartman
2013-10-11 19:36 ` [ 16/48] bonding: Fix broken promiscuity reference counting issue Greg Kroah-Hartman
2013-10-11 19:36 ` [ 17/48] ipv4 igmp: use in_dev_put in timer handlers instead of __in_dev_put Greg Kroah-Hartman
2013-10-11 19:36 ` [ 18/48] ipv6 mcast: use in6_dev_put in timer handlers instead of __in6_dev_put Greg Kroah-Hartman
2013-10-11 19:36 ` [ 19/48] ll_temac: Reset dma descriptors indexes on ndo_open Greg Kroah-Hartman
2013-10-11 19:36 ` [ 20/48] ASoC: max98095: a couple array underflows Greg Kroah-Hartman
2013-10-11 19:36 ` [ 21/48] ASoC: 88pm860x: array overflow in snd_soc_put_volsw_2r_st() Greg Kroah-Hartman
2013-10-11 19:36 ` [ 22/48] powerpc/iommu: Use GFP_KERNEL instead of GFP_ATOMIC in iommu_init_table() Greg Kroah-Hartman
2013-10-11 19:36 ` [ 23/48] powerpc/vio: Fix modalias_show return values Greg Kroah-Hartman
2013-10-11 19:36 ` [ 24/48] powerpc: Fix parameter clobber in csum_partial_copy_generic() Greg Kroah-Hartman
2013-10-11 19:36 ` [ 25/48] powerpc: Restore registers on error exit from csum_partial_copy_generic() Greg Kroah-Hartman
2013-10-11 19:36 ` [ 26/48] Bluetooth: Fix security level for peripheral role Greg Kroah-Hartman
2013-10-11 19:36 ` [ 27/48] Bluetooth: Fix encryption key size " Greg Kroah-Hartman
2013-10-11 19:36 ` [ 28/48] esp_scsi: Fix tag state corruption when autosensing Greg Kroah-Hartman
2013-10-11 19:36 ` [ 29/48] sparc64: Fix ITLB handler of null page Greg Kroah-Hartman
2013-10-11 19:36 ` [ 30/48] sparc64: Remove RWSEM export leftovers Greg Kroah-Hartman
2013-10-11 19:36 ` [ 31/48] sparc64: Fix off by one in trampoline TLB mapping installation loop Greg Kroah-Hartman
2013-10-11 19:36 ` [ 32/48] sparc64: Fix not SRAed %o5 in 32-bit traced syscall Greg Kroah-Hartman
2013-10-11 19:36 ` [ 33/48] sparc32: Fix exit flag passed from traced sys_sigreturn Greg Kroah-Hartman
2013-10-11 19:36 ` [ 34/48] kernel/kmod.c: check for NULL in call_usermodehelper_exec() Greg Kroah-Hartman
2013-10-11 22:36 ` Tetsuo Handa
2013-10-13 21:50 ` Greg KH
2013-10-11 19:36 ` [ 35/48] USB: serial: option: Ignore card reader interface on Huawei E1750 Greg Kroah-Hartman
2013-10-11 19:36 ` [ 36/48] ib_srpt: Destroy cm_id before destroying QP Greg Kroah-Hartman
2013-10-11 19:36 ` [ 37/48] ib_srpt: always set response for task management Greg Kroah-Hartman
2013-10-11 19:36 ` [ 38/48] rtlwifi: Align private space in rtl_priv struct Greg Kroah-Hartman
2013-10-11 19:36 ` [ 39/48] p54usb: add USB ID for Corega WLUSB2GTST USB adapter Greg Kroah-Hartman
2013-10-11 19:36 ` [ 40/48] dmaengine: imx-dma: fix lockdep issue between irqhandler and tasklet Greg Kroah-Hartman
2013-10-11 19:36 ` [ 41/48] dmaengine: imx-dma: fix callback path in tasklet Greg Kroah-Hartman
2013-10-11 19:36 ` [ 42/48] dmaengine: imx-dma: fix slow path issue in prep_dma_cyclic Greg Kroah-Hartman
2013-10-11 19:36 ` [ 43/48] staging: comedi: ni_65xx: (bug fix) confine insn_bits to one subdevice Greg Kroah-Hartman
2013-10-11 19:36 ` [ 44/48] mm, show_mem: suppress page counts in non-blockable contexts Greg Kroah-Hartman
2013-10-11 19:36 ` [ 45/48] ACPI / IPMI: Fix atomic context requirement of ipmi_msg_handler() Greg Kroah-Hartman
2013-10-11 19:36 ` [ 46/48] tile: use a more conservative __my_cpu_offset in CONFIG_PREEMPT Greg Kroah-Hartman
2013-10-11 19:36 ` [ 47/48] Btrfs: change how we queue blocks for backref checking Greg Kroah-Hartman
2013-10-11 19:36 ` Greg Kroah-Hartman [this message]
2013-10-11 21:56 ` [ 00/48] 3.4.66-stable review Guenter Roeck
2013-10-11 22:12 ` Greg Kroah-Hartman
2013-10-12 0:50 ` Guenter Roeck
2013-10-13 16:04 ` Greg Kroah-Hartman
2013-10-17 13:16 ` Ben Hutchings
2013-10-11 22:15 ` Greg Kroah-Hartman
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=20131011193642.442583175@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=jack@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tytso@mit.edu \
--cc=wenqing.lz@taobao.com \
/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).