7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hyunchul Lee [ Upstream commit 418452b43d722b3c1e9a711c9f49f3dbe2afaf34 ] ntfs_inode_attr_pwrite() locks an attribute folio before copying a new attribute image into it, but taking the folio lock does not wait for an already-running writeback BIO to complete. The writeback path can unlock the folio while PG_writeback remains set and the BIO still references the folio memory. Fixes: 115380f9a2f9 ("ntfs: update mft operations") Cc: stable@vger.kernel.org Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Sasha Levin --- fs/ntfs/inode.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c index a777de8a80c72..b3c5219c7b770 100644 --- a/fs/ntfs/inode.c +++ b/fs/ntfs/inode.c @@ -3739,6 +3739,8 @@ static s64 __ntfs_inode_non_resident_attr_pwrite(struct inode *vi, folio_lock(folio); } + folio_wait_writeback(folio); + if (count == PAGE_SIZE) { offset = 0; attr_len = count; -- 2.53.0