Linux-parisc archive on lore.kernel.org
 help / color / Atom feed
* [PATCH palo] ext2: fix ext4 group cache
@ 2019-08-04 15:26 James Bottomley
  0 siblings, 0 replies; only message in thread
From: James Bottomley @ 2019-08-04 15:26 UTC (permalink / raw)
  To: Parisc List

The ext4 group cache is truncated because the read that populates it
is assuming ext2 fixed group size and not using the ext4 variable
group size.  This only shows up with large inode numbers because the
read stops before their contents is read.  The upshot is when you try
to do ext2_iget() for an ext4 inode above a certain number it fails
because the group descriptor is random junk.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
---
 ipl/ext2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ipl/ext2.c b/ipl/ext2.c
index 96f6e4d..0729429 100644
--- a/ipl/ext2.c
+++ b/ipl/ext2.c
@@ -287,7 +287,7 @@ int ext2_mount(long cons_dev, long p_offset, long quiet)
 	if (Debug) printf("ext2 block size %d\n", ext2_blocksize);
 
 	/* read in the group descriptors (immediately follows superblock) */
-	cons_read(dev, gds, ngroups * sizeof(struct ext2_group_desc),
+	cons_read(dev, gds, ngroups * group_size,
 		  partition_offset +
                   ext2_blocksize * (EXT2_MIN_BLOCK_SIZE/ext2_blocksize + 1));
 	for (i = 0; i < ngroups; i++)
-- 
2.16.4


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-04 15:26 [PATCH palo] ext2: fix ext4 group cache James Bottomley

Linux-parisc archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-parisc/0 linux-parisc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-parisc linux-parisc/ https://lore.kernel.org/linux-parisc \
		linux-parisc@vger.kernel.org linux-parisc@archiver.kernel.org
	public-inbox-index linux-parisc


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-parisc


AGPL code for this site: git clone https://public-inbox.org/ public-inbox