linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL] hfsplus updates for Linux 3.1
@ 2011-07-22 15:27 Christoph Hellwig
  2011-09-15 14:48 ` [PATCH 0/2] hfsplus regression fixes Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2011-07-22 15:27 UTC (permalink / raw)
  To: torvalds; +Cc: linux-fsdevel, linux-kernel

Hi Linus,

please pull the hfsplus updates for this merge window.  The patches are
largely bugfixes, but now that we have sorted the issues with
incorrectly used 32-bit types we can finally enable support for volumes
larger than 2 Terrabytes.

The following changes since commit ca56a95eedcc95f8fea7b49c87565cd961d74fe2:

  Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 (2011-06-29 18:18:48 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/hch/hfsplus.git for-linus

Alexey Khoroshilov (3):
      hfsplus: Fix double iput of the same inode in hfsplus_fill_super()
      hfsplus: add error checking for hfs_find_init()
      hfsplus: Add error propagation for hfsplus_ext_write_extent_locked

Anton Salikhmetov (1):
      hfsplus: assignments inside `if' condition clean-up

Christoph Hellwig (3):
      hfsplus: fix overflow in hfsplus_get_block
      hfsplus: fix overflow in hfsplus_read_wrapper
      hfsplus: lift the 2TB size limit

Naohiro Aota (1):
      hfsplus: Add additional range check to handle on-disk corruptions

Seth Forshee (2):
      hfsplus: add missing call to bio_put()
      hfsplus: ensure bio requests are not smaller than the hardware sectors

 fs/hfsplus/brec.c       |    4 ++
 fs/hfsplus/catalog.c    |   14 +++++--
 fs/hfsplus/dir.c        |    8 +++-
 fs/hfsplus/extents.c    |   50 +++++++++++++++++-------
 fs/hfsplus/hfsplus_fs.h |   18 +++++++-
 fs/hfsplus/inode.c      |   12 +++--
 fs/hfsplus/part_tbl.c   |   32 +++++++++-------
 fs/hfsplus/super.c      |   45 +++++++++++++++-------
 fs/hfsplus/unicode.c    |   35 +++++++++++++----
 fs/hfsplus/wrapper.c    |   97 ++++++++++++++++++++++++++++++++++-------------
 10 files changed, 224 insertions(+), 91 deletions(-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 0/2] hfsplus regression fixes
  2011-07-22 15:27 [GIT PULL] hfsplus updates for Linux 3.1 Christoph Hellwig
@ 2011-09-15 14:48 ` Christoph Hellwig
  2011-09-15 14:48   ` [PATCH 1/2] hfsplus: Fix kfree of wrong pointers in hfsplus_fill_super() error path Christoph Hellwig
  2011-09-15 14:48   ` [PATCH 2/2] hfsplus: fix filesystem size checks Christoph Hellwig
  0 siblings, 2 replies; 4+ messages in thread
From: Christoph Hellwig @ 2011-09-15 14:48 UTC (permalink / raw)
  To: torvalds; +Cc: linux-fsdevel, linux-kernel

Hi Linus,

two small patches to fix regressions introduced in the Linux 3.1 cycle.

Given that it's just two patches I have't bothered setting up an
alternate git tree for now.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] hfsplus: Fix kfree of wrong pointers in hfsplus_fill_super() error path
  2011-09-15 14:48 ` [PATCH 0/2] hfsplus regression fixes Christoph Hellwig
@ 2011-09-15 14:48   ` Christoph Hellwig
  2011-09-15 14:48   ` [PATCH 2/2] hfsplus: fix filesystem size checks Christoph Hellwig
  1 sibling, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2011-09-15 14:48 UTC (permalink / raw)
  To: torvalds; +Cc: linux-fsdevel, linux-kernel

From: Seth Forshee <seth.forshee@canonical.com>

Commit 6596528 (hfsplus: ensure bio requests are not smaller than the
hardware sectors) changed the pointers used for volume header allocations
but failed to free the correct pointers in the error path path of
hfsplus_fill_super() and hfsplus_read_wrapper.

The second hunk came from a separate patch by Pavel Ivanov.

Reported-by: Pavel Ivanov <paivanof@gmail.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Christoph Hellwig <hch@tuxera.com>
Cc: <stable@kernel.org>
---
 fs/hfsplus/super.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6/fs/hfsplus/super.c
===================================================================
--- linux-2.6.orig/fs/hfsplus/super.c	2011-09-10 11:34:46.271616471 -0400
+++ linux-2.6/fs/hfsplus/super.c	2011-09-11 10:44:13.349746484 -0400
@@ -525,8 +525,8 @@ out_close_cat_tree:
 out_close_ext_tree:
 	hfs_btree_close(sbi->ext_tree);
 out_free_vhdr:
-	kfree(sbi->s_vhdr);
-	kfree(sbi->s_backup_vhdr);
+	kfree(sbi->s_vhdr_buf);
+	kfree(sbi->s_backup_vhdr_buf);
 out_unload_nls:
 	unload_nls(sbi->nls);
 	unload_nls(nls);
Index: linux-2.6/fs/hfsplus/wrapper.c
===================================================================
--- linux-2.6.orig/fs/hfsplus/wrapper.c	2011-09-11 10:44:36.949746343 -0400
+++ linux-2.6/fs/hfsplus/wrapper.c	2011-09-11 10:44:49.679746266 -0400
@@ -272,9 +272,9 @@ reread:
 	return 0;
 
 out_free_backup_vhdr:
-	kfree(sbi->s_backup_vhdr);
+	kfree(sbi->s_backup_vhdr_buf);
 out_free_vhdr:
-	kfree(sbi->s_vhdr);
+	kfree(sbi->s_vhdr_buf);
 out:
 	return error;
 }

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] hfsplus: fix filesystem size checks
  2011-09-15 14:48 ` [PATCH 0/2] hfsplus regression fixes Christoph Hellwig
  2011-09-15 14:48   ` [PATCH 1/2] hfsplus: Fix kfree of wrong pointers in hfsplus_fill_super() error path Christoph Hellwig
@ 2011-09-15 14:48   ` Christoph Hellwig
  1 sibling, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2011-09-15 14:48 UTC (permalink / raw)
  To: torvalds; +Cc: linux-fsdevel, linux-kernel

From: Christoph Hellwig <hch@tuxera.com>

generic_check_addressable can't deal with hfsplus's larger than page size
allocation blocks, so simply opencode the checks that we actually need
in hfsplus_fill_super.

Signed-off-by: Christoph Hellwig <hch@tuxera.com>
Reported-by: Pavel Ivanov <paivanof@gmail.com>
Tested-by: Pavel Ivanov <paivanof@gmail.com>

Index: linux-2.6/fs/hfsplus/super.c
===================================================================
--- linux-2.6.orig/fs/hfsplus/super.c	2011-09-15 10:26:10.059350285 -0400
+++ linux-2.6/fs/hfsplus/super.c	2011-09-15 10:26:24.960348414 -0400
@@ -344,6 +344,7 @@ static int hfsplus_fill_super(struct sup
 	struct inode *root, *inode;
 	struct qstr str;
 	struct nls_table *nls = NULL;
+	u64 last_fs_block, last_fs_page;
 	int err;
 
 	err = -EINVAL;
@@ -399,9 +400,13 @@ static int hfsplus_fill_super(struct sup
 	if (!sbi->rsrc_clump_blocks)
 		sbi->rsrc_clump_blocks = 1;
 
-	err = generic_check_addressable(sbi->alloc_blksz_shift,
-					sbi->total_blocks);
-	if (err) {
+	err = -EFBIG;
+	last_fs_block = sbi->total_blocks - 1;
+	last_fs_page = (last_fs_block << sbi->alloc_blksz_shift) >>
+			PAGE_CACHE_SHIFT;
+
+	if ((last_fs_block > (sector_t)(~0ULL) >> (sbi->alloc_blksz_shift - 9)) ||
+	    (last_fs_page > (pgoff_t)(~0ULL))) {
 		printk(KERN_ERR "hfs: filesystem size too large.\n");
 		goto out_free_vhdr;
 	}

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-09-15 14:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-22 15:27 [GIT PULL] hfsplus updates for Linux 3.1 Christoph Hellwig
2011-09-15 14:48 ` [PATCH 0/2] hfsplus regression fixes Christoph Hellwig
2011-09-15 14:48   ` [PATCH 1/2] hfsplus: Fix kfree of wrong pointers in hfsplus_fill_super() error path Christoph Hellwig
2011-09-15 14:48   ` [PATCH 2/2] hfsplus: fix filesystem size checks Christoph Hellwig

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).