lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200427181957.1606257-2-hch@lst.de>
Date:   Mon, 27 Apr 2020 20:19:47 +0200
From:   Christoph Hellwig <hch@....de>
To:     linux-ext4@...r.kernel.org, viro@...iv.linux.org.uk
Cc:     jack@...e.cz, tytso@....edu, adilger@...ger.ca,
        riteshh@...ux.ibm.com, amir73il@...il.com,
        linux-fsdevel@...r.kernel.org, linux-unionfs@...r.kernel.org,
        syzbot+77fa5bdb65cc39711820@...kaller.appspotmail.com
Subject: [PATCH 01/11] ext4: fix EXT4_MAX_LOGICAL_BLOCK macro

From: Ritesh Harjani <riteshh@...ux.ibm.com>

ext4 supports max number of logical blocks in a file to be 0xffffffff.
(This is since ext4_extent's ee_block is __le32).
This means that EXT4_MAX_LOGICAL_BLOCK should be 0xfffffffe (starting
from 0 logical offset). This patch fixes this.

The issue was seen when ext4 moved to iomap_fiemap API and when
overlayfs was mounted on top of ext4. Since overlayfs was missing
filemap_check_ranges(), so it could pass a arbitrary huge length which
lead to overflow of map.m_len logic.

This patch fixes that.

Fixes: d3b6f23f7167 ("ext4: move ext4_fiemap to use iomap framework")
Reported-by: syzbot+77fa5bdb65cc39711820@...kaller.appspotmail.com
Signed-off-by: Ritesh Harjani <riteshh@...ux.ibm.com>
Reviewed-by: Jan Kara <jack@...e.cz>
Signed-off-by: Christoph Hellwig <hch@....de>
---
 fs/ext4/ext4.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 91eb4381cae5b..ad2dbf6e49245 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -722,7 +722,7 @@ enum {
 #define EXT4_MAX_BLOCK_FILE_PHYS	0xFFFFFFFF
 
 /* Max logical block we can support */
-#define EXT4_MAX_LOGICAL_BLOCK		0xFFFFFFFF
+#define EXT4_MAX_LOGICAL_BLOCK		0xFFFFFFFE
 
 /*
  * Structure of an inode on the disk
-- 
2.26.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ