linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs/ntfs3: Check for NULL if ATTR_EA_INFO is incorrect
@ 2021-09-29 16:35 Konstantin Komarov
  2021-09-29 17:44 ` Kari Argillander
  2021-10-03 17:50 ` Kari Argillander
  0 siblings, 2 replies; 8+ messages in thread
From: Konstantin Komarov @ 2021-09-29 16:35 UTC (permalink / raw)
  To: ntfs3; +Cc: linux-kernel, linux-fsdevel

This can be reason for reported panic.
Fixes: 4342306f0f0d ("fs/ntfs3: Add file operations and implementation")

Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
---
 fs/ntfs3/frecord.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
index 9a53f809576d..007602badd90 100644
--- a/fs/ntfs3/frecord.c
+++ b/fs/ntfs3/frecord.c
@@ -3080,7 +3080,9 @@ static bool ni_update_parent(struct ntfs_inode *ni, struct NTFS_DUP_INFO *dup,
                        const struct EA_INFO *info;
 
                        info = resident_data_ex(attr, sizeof(struct EA_INFO));
-                       dup->ea_size = info->size_pack;
+                       /* If ATTR_EA_INFO exists 'info' can't be NULL. */
+                       if (info)
+                               dup->ea_size = info->size_pack;
                }
        }
 
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-10-11 20:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-29 16:35 [PATCH] fs/ntfs3: Check for NULL if ATTR_EA_INFO is incorrect Konstantin Komarov
2021-09-29 17:44 ` Kari Argillander
2021-10-03 17:50 ` Kari Argillander
2021-10-04 20:39   ` Mohammad Rasim
2021-10-06 14:47     ` Konstantin Komarov
     [not found]       ` <2998a9b9-8ea0-6a44-7093-66c7a08dcab2@gmail.com>
2021-10-11 16:55         ` Konstantin Komarov
2021-10-11 20:56           ` Mohammad Rasim
2021-10-06 14:51   ` Konstantin Komarov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).