mirror of
https://github.com/torvalds/linux.git
synced 2026-09-12 04:23:03 +02:00
ntfs: fix incorrect MFT record pointer passed to ntfs_attr_record_resize
ntfs_new_attr_flags() passes the wrong MFT record to ntfs_attr_record_resize().
When the attribute is in an extent record, ctx->mrec points to the extent
but the function receives the base record pointer m, causing incorrect
size calculations in memmove.
Fix by passing ctx->mrec (the actual MFT record containing the attribute)
instead of m (the base MFT record) to ntfs_attr_record_resize().
Fixes: fc053f05ca ("ntfs: add reparse and ea operations")
Cc: stable@vger.kernel.org
Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
This commit is contained in:
parent
0e4c839905
commit
8d139e3635
|
|
@ -764,7 +764,7 @@ static int ntfs_new_attr_flags(struct ntfs_inode *ni, __le32 fattr)
|
|||
memmove((u8 *)a + mp_ofs, (u8 *)a + old_mp_ofs, mp_size);
|
||||
}
|
||||
|
||||
err = ntfs_attr_record_resize(m, a, arec_size);
|
||||
err = ntfs_attr_record_resize(ctx->mrec, a, arec_size);
|
||||
if (unlikely(err))
|
||||
goto err_out;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user