diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2012-08-17 14:41:05 -0400 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2012-08-17 14:41:05 -0400 |
commit | 14d6db106d37829f2c46890bec7b3969a7d7f694 (patch) | |
tree | be465020f3397d4637857597f2f9ae75d463fa8f | |
parent | ddc948f77adf2997c263ac3fff56b40d641be7d2 (diff) | |
download | longterm-queue-2.6.34-14d6db106d37829f2c46890bec7b3969a7d7f694.tar.gz |
xfs: add missing unlock patch to prevent regression.
Herton notes:
-----
> commit b52a360b2aa1c59ba9970fb0f52bbb093fcc7a24 upstream.
>
> Fixes a possible memory corruption when the link is larger than
> MAXPATHLEN and XFS_DEBUG is not enabled. This also remove the
> S_ISLNK assert, since the inode mode is checked previously in
> xfs_readlink_by_handle() and via VFS.
>
> Updated to address concerns raised by Ben Hutchings about the loose
> attention paid to 32- vs 64-bit values, and the lack of handling a
> potentially negative pathlen value:
> - Changed type of "pathlen" to be xfs_fsize_t, to match that of
> ip->i_d.di_size
> - Added checking for a negative pathlen to the too-long pathlen
> test, and generalized the message that gets reported in that case
> to reflect the change
> As a result, if a negative pathlen were encountered, this function
> would return EFSCORRUPTED (and would fail an assertion for a debug
> build)--just as would a too-long pathlen.
>
> Signed-off-by: Alex Elder <aelder@sgi.com>
> Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> [PG: no xfs_alert in 2.6.34; use xfs_fs_cmn_err(CE_ALERT, ...) instead]
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
[...]
commit 9b025eb3a89e041bab6698e3858706be2385d692 ("xfs: Fix missing
xfs_iunlock() on error recovery path in xfs_readlink()") addresses a
regression with this change, something to consider for inclusion too.
-----
Reported-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-rw-r--r-- | queue/series | 2 | ||||
-rw-r--r-- | queue/xfs-Fix-missing-xfs_iunlock-on-error-recovery-path-i.patch | 35 |
2 files changed, 37 insertions, 0 deletions
diff --git a/queue/series b/queue/series index c4b2ce1..8d363aa 100644 --- a/queue/series +++ b/queue/series @@ -11,6 +11,8 @@ cifs-fix-possible-memory-corruption-in-CIFSFindNext.patch cifs-fix-dentry-refcount-leak-when-opening-a-FIFO-on.patch hfsplus-Fix-potential-buffer-overflows.patch xfs-Fix-possible-memory-corruption-in-xfs_readlink.patch +# below needed in conjunction with the above. +xfs-Fix-missing-xfs_iunlock-on-error-recovery-path-i.patch KVM-Remove-ability-to-assign-a-device-without-iommu-.patch KVM-Device-assignment-permission-checks.patch KVM-Ensure-all-vcpus-are-consistent-with-in-kernel-i.patch diff --git a/queue/xfs-Fix-missing-xfs_iunlock-on-error-recovery-path-i.patch b/queue/xfs-Fix-missing-xfs_iunlock-on-error-recovery-path-i.patch new file mode 100644 index 0000000..9fa42b6 --- /dev/null +++ b/queue/xfs-Fix-missing-xfs_iunlock-on-error-recovery-path-i.patch @@ -0,0 +1,35 @@ +From 35d4b735f295132ff0d163eb2db21460755456a5 Mon Sep 17 00:00:00 2001 +From: Jan Kara <jack@suse.cz> +Date: Wed, 11 Jan 2012 18:52:10 +0000 +Subject: [PATCH] xfs: Fix missing xfs_iunlock() on error recovery path in + xfs_readlink() + +commit 9b025eb3a89e041bab6698e3858706be2385d692 upstream. + +Commit b52a360b forgot to call xfs_iunlock() when it detected corrupted +symplink and bailed out. Fix it by jumping to 'out' instead of doing return. + +CC: Carlos Maiolino <cmaiolino@redhat.com> +Signed-off-by: Jan Kara <jack@suse.cz> +Reviewed-by: Alex Elder <elder@kernel.org> +Reviewed-by: Dave Chinner <dchinner@redhat.com> +Signed-off-by: Ben Myers <bpm@sgi.com> +Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> + +diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c +index c682c5d..a5a5856 100644 +--- a/fs/xfs/xfs_vnodeops.c ++++ b/fs/xfs/xfs_vnodeops.c +@@ -573,7 +573,8 @@ xfs_readlink( + "%s: inode (%llu) bad symlink length (%lld)", __func__, + (unsigned long long) ip->i_ino, (long long) pathlen); + ASSERT(0); +- return XFS_ERROR(EFSCORRUPTED); ++ error = XFS_ERROR(EFSCORRUPTED); ++ goto out; + } + + +-- +1.7.12.rc2 + |