Blame SOURCES/0089-fs-ntfs3-Check-for-NULL-if-ATTR_EA_INFO-is-incorrect.patch

Kmods SIG 8b815c
From 35afb70dcfe4eb445060dd955e5b67d962869ce5 Mon Sep 17 00:00:00 2001
Kmods SIG 8b815c
From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Kmods SIG 8b815c
Date: Wed, 29 Sep 2021 19:29:52 +0300
Kmods SIG 8b815c
Subject: [Backport 35afb70dcfe4] src: Check for NULL if ATTR_EA_INFO is
Kmods SIG 8b815c
 incorrect
Kmods SIG 8b815c
Kmods SIG 8b815c
This can be reason for reported panic
Kmods SIG 8b815c
https://lore.kernel.org/ntfs3/f9de5807-2311-7374-afb0-bc5dffb522c0@gmail.com/
Kmods SIG 8b815c
Fixes: 4342306f0f0d ("src: Add file operations and implementation")
Kmods SIG 8b815c
Kmods SIG 8b815c
Reported-by: Mohammad Rasim <mohammad.rasim96@gmail.com>
Kmods SIG 8b815c
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Kmods SIG 8b815c
---
Kmods SIG 8b815c
 src/frecord.c | 4 +++-
Kmods SIG 8b815c
 1 file changed, 3 insertions(+), 1 deletion(-)
Kmods SIG 8b815c
Kmods SIG 8b815c
diff --git a/src/frecord.c b/src/frecord.c
Kmods SIG 8b815c
index 9a53f809576d0b795ebb6ed2834792a60be463b0..007602badd9000ce190dd5a0ad13e0618aa27e83 100644
Kmods SIG 8b815c
--- a/src/frecord.c
Kmods SIG 8b815c
+++ b/src/frecord.c
Kmods SIG 8b815c
@@ -3080,7 +3080,9 @@ static bool ni_update_parent(struct ntfs_inode *ni, struct NTFS_DUP_INFO *dup,
Kmods SIG 8b815c
 			const struct EA_INFO *info;
Kmods SIG 8b815c
 
Kmods SIG 8b815c
 			info = resident_data_ex(attr, sizeof(struct EA_INFO));
Kmods SIG 8b815c
-			dup->ea_size = info->size_pack;
Kmods SIG 8b815c
+			/* If ATTR_EA_INFO exists 'info' can't be NULL. */
Kmods SIG 8b815c
+			if (info)
Kmods SIG 8b815c
+				dup->ea_size = info->size_pack;
Kmods SIG 8b815c
 		}
Kmods SIG 8b815c
 	}
Kmods SIG 8b815c
 
Kmods SIG 8b815c
-- 
Kmods SIG 8b815c
2.31.1
Kmods SIG 8b815c