linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	alan@lxorguk.ukuu.org.uk, Lukas Czerner <lczerner@redhat.com>,
	Eugene Shatokhin <eugene.shatokhin@rosalab.ru>,
	"Theodore Tso" <tytso@mit.edu>
Subject: [ 16/71] ext4: fix memory leak in ext4_xattr_set_acl()s error path
Date: Tue, 15 Jan 2013 14:54:13 -0800	[thread overview]
Message-ID: <20130115225341.614255634@linuxfoundation.org> (raw)
In-Reply-To: <20130115225340.367496998@linuxfoundation.org>

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

------------------

From: Eugene Shatokhin <eugene.shatokhin@rosalab.ru>

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 <lczerner@redhat.com>
Signed-off-by: Eugene Shatokhin <eugene.shatokhin@rosalab.ru>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/ext4/acl.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- a/fs/ext4/acl.c
+++ b/fs/ext4/acl.c
@@ -450,8 +450,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))



  parent reply	other threads:[~2013-01-15 22:55 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
2013-01-15 22:53 ` [ 01/71] powerpc: Fix CONFIG_RELOCATABLE=y CONFIG_CRASH_DUMP=n build Greg Kroah-Hartman
2013-01-15 22:53 ` [ 02/71] powerpc/vdso: Remove redundant locking in update_vsyscall_tz() Greg Kroah-Hartman
2013-01-15 22:54 ` [ 03/71] s390/cio: fix pgid reserved check Greg Kroah-Hartman
2013-01-15 22:54 ` [ 04/71] mm: compaction: fix echo 1 > compact_memory return error issue Greg Kroah-Hartman
2013-01-15 22:54 ` [ 05/71] mm: use aligned zone start for pfn_to_bitidx calculation Greg Kroah-Hartman
2013-01-15 22:54 ` [ 06/71] Revert "ath9k_hw: Update AR9003 high_power tx gain table" Greg Kroah-Hartman
2013-01-15 22:54 ` [ 07/71] ath9k: ar9003: fix OTP register offsets for AR9340 Greg Kroah-Hartman
2013-01-15 22:54 ` [ 08/71] firewire: net: Fix handling of fragmented multicast/broadcast packets Greg Kroah-Hartman
2013-01-15 22:54 ` [ 09/71] SCSI: mvsas: fix undefined bit shift Greg Kroah-Hartman
2013-01-15 22:54 ` [ 10/71] SCSI: qla2xxx: Test and clear FCPORT_UPDATE_NEEDED atomically Greg Kroah-Hartman
2013-01-15 22:54 ` [ 11/71] sata_promise: fix hardreset lockdep error Greg Kroah-Hartman
2013-01-15 22:54 ` [ 12/71] libata: set dma_mode to 0xff in reset Greg Kroah-Hartman
2013-01-15 22:54 ` [ 13/71] libata: fix Null pointer dereference on disk error Greg Kroah-Hartman
2013-01-15 22:54 ` [ 14/71] target/tcm_fc: fix the lockdep warning due to inconsistent lock state Greg Kroah-Hartman
2013-01-15 22:54 ` [ 15/71] mfd: Only unregister platform devices allocated by the mfd core Greg Kroah-Hartman
2013-01-15 22:54 ` Greg Kroah-Hartman [this message]
2013-01-15 22:54 ` [ 17/71] SUNRPC: Ensure that we free the rpc_task after cleanups are done Greg Kroah-Hartman
2013-01-15 22:54 ` [ 18/71] SUNRPC: Ensure we release the socket write lock if the rpc_task exits early Greg Kroah-Hartman
2013-01-17 15:14   ` Herton Ronaldo Krzesinski
2013-01-17 16:03     ` Greg Kroah-Hartman
2013-01-15 22:54 ` [ 19/71] jffs2: hold erase_completion_lock on exit Greg Kroah-Hartman
2013-01-15 22:54 ` [ 20/71] i2400m: add Intel 6150 device IDs Greg Kroah-Hartman
2013-01-15 22:54 ` [ 21/71] drm/i915: make the panel fitter work on pipes B and C on IVB Greg Kroah-Hartman
2013-01-15 22:54 ` [ 22/71] RDMA/nes: Fix for crash when registering zero length MR for CQ Greg Kroah-Hartman
2013-01-15 22:54 ` [ 23/71] RDMA/nes: Fix for terminate timer crash Greg Kroah-Hartman
2013-01-15 22:54 ` [ 24/71] ring-buffer: Fix race between integrity check and readers Greg Kroah-Hartman
2013-01-17 20:02   ` Herton Ronaldo Krzesinski
2013-01-15 22:54 ` [ 25/71] dm ioctl: prevent unsafe change to dm_ioctl data_size Greg Kroah-Hartman
2013-01-15 22:54 ` [ 26/71] staging: vt6656: [BUG] out of bound array reference in RFbSetPower Greg Kroah-Hartman
2013-01-15 22:54 ` [ 27/71] staging: vt6656: 64 bit fixes: use u32 for QWORD definition Greg Kroah-Hartman
2013-01-15 22:54 ` [ 28/71] staging: vt6656: 64 bit fixes : correct all type sizes Greg Kroah-Hartman
2013-01-15 22:54 ` [ 29/71] staging: vt6656: 64 bit fixes: fix long warning messages Greg Kroah-Hartman
2013-01-15 22:54 ` [ 30/71] staging: vt6656: 64bit fixes: key.c/h change unsigned long to u32 Greg Kroah-Hartman
2013-01-15 22:54 ` [ 31/71] staging: vt6656: 64bit fixes: vCommandTimerWait change calculation of timer Greg Kroah-Hartman
2013-01-15 22:54 ` [ 32/71] video: mxsfb: fix crash when unblanking the display Greg Kroah-Hartman
2013-01-15 22:54 ` [ 33/71] ext4: fix extent tree corruption caused by hole punch Greg Kroah-Hartman
2013-01-15 22:54 ` [ 34/71] jbd2: fix assertion failure in jbd2_journal_flush() Greg Kroah-Hartman
2013-01-15 22:54 ` [ 35/71] ext4: do not try to write superblock on ro remount w/o journal Greg Kroah-Hartman
2013-01-15 22:54 ` [ 36/71] ext4: lock i_mutex when truncating orphan inodes Greg Kroah-Hartman
2013-01-17 20:07   ` Herton Ronaldo Krzesinski
2013-01-18  0:46     ` Greg Kroah-Hartman
2013-01-18  3:47       ` Herton Ronaldo Krzesinski
2013-01-18  3:56         ` Theodore Ts'o
2013-01-18 21:27           ` Greg Kroah-Hartman
2013-01-15 22:54 ` [ 37/71] aoe: do not call bdi_init after blk_alloc_queue Greg Kroah-Hartman
2013-01-15 22:54 ` [ 38/71] udf: fix memory leak while allocating blocks during write Greg Kroah-Hartman
2013-01-15 22:54 ` [ 39/71] udf: dont increment lenExtents while writing to a hole Greg Kroah-Hartman
2013-01-15 22:54 ` [ 40/71] thp, memcg: split hugepage for memcg oom on cow Greg Kroah-Hartman
2013-01-15 22:54 ` [ 41/71] x86, amd: Disable way access filter on Piledriver CPUs Greg Kroah-Hartman
2013-01-15 22:54 ` [ 42/71] ACPI : do not use Lid and Sleep button for S5 wakeup Greg Kroah-Hartman
2013-01-15 22:54 ` [ 43/71] rtnetlink: Compute and store minimum ifinfo dump size Greg Kroah-Hartman
2013-01-15 22:54 ` [ 44/71] rtnetlink: Fix problem with buffer allocation Greg Kroah-Hartman
2013-01-15 22:54 ` [ 45/71] rtnetlink: fix rtnl_calcit() and rtnl_dump_ifinfo() Greg Kroah-Hartman
2013-01-15 22:54 ` [ 46/71] epoll: prevent missed events on EPOLL_CTL_MOD Greg Kroah-Hartman
2013-01-15 22:54 ` [ 47/71] ASoC: wm2000: Fix sense of speech clarity enable Greg Kroah-Hartman
2013-01-15 22:54 ` [ 48/71] ALSA: pxa27x: fix ac97 cold reset Greg Kroah-Hartman
2013-01-15 22:54 ` [ 49/71] staging: comedi: prevent auto-unconfig of manually configured devices Greg Kroah-Hartman
2013-01-15 22:54 ` [ 50/71] staging: comedi: comedi_test: fix race when cancelling command Greg Kroah-Hartman
2013-01-15 22:54 ` [ 51/71] staging: r8712u: Add new device ID Greg Kroah-Hartman
2013-01-15 22:54 ` [ 52/71] staging: speakup: avoid out-of-range access in synth_init() Greg Kroah-Hartman
2013-01-15 22:54 ` [ 53/71] staging: speakup: avoid out-of-range access in synth_add() Greg Kroah-Hartman
2013-01-15 22:54 ` [ 54/71] radeon/kms: force rn50 chip to always report connected on analog output Greg Kroah-Hartman
2013-01-15 22:54 ` [ 55/71] mac80211: use del_timer_sync for final sta cleanup timer deletion Greg Kroah-Hartman
2013-01-15 22:54 ` [ 56/71] USB: option: add Nexpring NP10T terminal id Greg Kroah-Hartman
2013-01-15 22:54 ` [ 57/71] USB: option: blacklist network interface on ZTE MF880 Greg Kroah-Hartman
2013-01-15 22:54 ` [ 58/71] USB: option: Add new MEDIATEK PID support Greg Kroah-Hartman
2013-01-15 22:54 ` [ 59/71] USB: option: add Telekom Speedstick LTE II Greg Kroah-Hartman
2013-01-15 22:54 ` [ 60/71] usb: ftdi_sio: Crucible Technologies COMET Caller ID - pid added Greg Kroah-Hartman
2013-01-15 22:54 ` [ 61/71] USB: cdc-acm: Add support for "PSC Scanning, Magellan 800i" Greg Kroah-Hartman
2013-01-15 22:54 ` [ 62/71] usb: gadget: dummy: fix enumeration with g_multi Greg Kroah-Hartman
2013-01-15 22:55 ` [ 63/71] USB: Increase reset timeout Greg Kroah-Hartman
2013-01-15 22:55 ` [ 64/71] USB: hub: handle claim of enabled remote wakeup after reset Greg Kroah-Hartman
2013-01-15 22:55 ` [ 65/71] xhci: Handle HS bulk/ctrl endpoints that dont NAK Greg Kroah-Hartman
2013-01-15 22:55 ` [ 66/71] GFS2: Test bufdata with buffer locked and gfs2_log_lock held Greg Kroah-Hartman
2013-01-15 22:55 ` [ 67/71] intel-iommu: Free old page tables before creating superpage Greg Kroah-Hartman
2013-01-15 22:55 ` [ 68/71] KVM: PPC: 44x: fix DCR read/write Greg Kroah-Hartman
2013-01-15 22:55 ` [ 69/71] Revert "drm/i915: no lvds quirk for Zotac ZDBOX SD ID12/ID13" Greg Kroah-Hartman
2013-01-15 22:55 ` [ 70/71] staging: comedi: dont hijack hardware device private data Greg Kroah-Hartman
2013-01-15 22:55 ` [ 71/71] staging: comedi: Kconfig: COMEDI_NI_AT_A2150 should select COMEDI_FC Greg Kroah-Hartman
2013-01-15 23:49 ` [ 00/71] 3.0.59-stable review Peter Senna Tschudin
2013-01-16  0:06   ` Greg Kroah-Hartman
2013-01-16  3:47 ` Shuah Khan

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=20130115225341.614255634@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=eugene.shatokhin@rosalab.ru \
    --cc=lczerner@redhat.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).