lkml.org 
[lkml]   [2023]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] ntfs : fix shift-out-of-bounds in ntfs_iget
Date
Added a check to the compression_unit so that out of bound doesn't
occur.

Signed-off-by: Manas Ghandat <ghandatmanas@gmail.com>
Reported-by: syzbot+4768a8f039aa677897d0@syzkaller.appspotmail.com
---
fs/ntfs/inode.c | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c
index 6c3f38d66579..2ee100a7df32 100644
--- a/fs/ntfs/inode.c
+++ b/fs/ntfs/inode.c
@@ -1077,6 +1077,17 @@ static int ntfs_read_locked_inode(struct inode *vi)
goto unm_err_out;
}
if (a->data.non_resident.compression_unit) {
+ if(a->data.non_resident.compression_unit +
+ vol->cluster_size_bits > 32) {
+ ntfs_error(vi->i_sb, "Found "
+ "non-standard "
+ "compression unit (%u). "
+ "Cannot handle this.",
+ a->data.non_resident.
+ compression_unit);
+ err = -EOPNOTSUPP;
+ goto unm_err_out;
+ }
ni->itype.compressed.block_size = 1U <<
(a->data.non_resident.
compression_unit +
--
2.37.2
\
 
 \ /
  Last update: 2023-08-08 20:03    [W:0.279 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site