[PATCH] FS NTFS3: Fix shift-out-of-bounds in attr_set_size
From: mirimmad
Date: Sat Apr 08 2023 - 13:27:33 EST
From: Immad Mir <mirimmad17@xxxxxxxxx>
The bug can be fixed by changing type of 'align'
from u32 to u64
Reported-by: syzbot+14a2433710a3affee84e@xxxxxxxxxxxxxxxxxxxxxxxxx
Link: https://syzkaller.appspot.com/bug?extid=14a2433710a3affee84e
Signed-off-by: Immad Mir <mirimmad17@xxxxxxxxx>
---
fs/ntfs3/attrib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ntfs3/attrib.c b/fs/ntfs3/attrib.c
index 5e6bafb10..c306aa087 100644
--- a/fs/ntfs3/attrib.c
+++ b/fs/ntfs3/attrib.c
@@ -415,7 +415,7 @@ int attr_set_size(struct ntfs_inode *ni, enum ATTR_TYPE type,
CLST next_svcn, pre_alloc = -1, done = 0;
bool is_ext, is_bad = false;
bool dirty = false;
- u32 align;
+ u64 align;
struct MFT_REC *rec;
again:
--
2.40.0