[patch 4.19.6 2/2] BFS strengthen superblock sanity checking.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



part 2 of the patch set: a one-liner that strengthens the superblock
sanity checking.
From: Tigran Aivazian <aivazian.tigran@xxxxxxxxx>
Subject: [PATCH 4.19.6 2/2] BFS updates

Strengthen the superblock sanity checking (supersedes the code
that went into 4.19.6).

Signed-off-by: Tigran Aivazian <aivazian.tigran@xxxxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 inode.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- fs/bfs/inode.c.0	2018-12-02 20:49:00.525461354 +0000
+++ fs/bfs/inode.c	2018-12-02 20:49:51.054686779 +0000
@@ -350,7 +350,7 @@
 	s->s_magic = BFS_MAGIC;
 
 	if (le32_to_cpu(bfs_sb->s_start) > le32_to_cpu(bfs_sb->s_end) ||
-	    le32_to_cpu(bfs_sb->s_start) < BFS_BSIZE) {
+	    le32_to_cpu(bfs_sb->s_start) < sizeof(struct bfs_super_block) + sizeof(struct bfs_dirent)) {
 		printf("Superblock is corrupted\n");
 		goto out1;
 	}

[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux