fs/ntfs3: Harden against integer overflows
[platform/kernel/linux-starfive.git] / fs / ntfs3 / xattr.c
index 7de8718..ea582b4 100644 (file)
@@ -107,7 +107,7 @@ static int ntfs_read_ea(struct ntfs_inode *ni, struct EA_FULL **ea,
                return -EFBIG;
 
        /* Allocate memory for packed Ea. */
-       ea_p = kmalloc(size + add_bytes, GFP_NOFS);
+       ea_p = kmalloc(size_add(size, add_bytes), GFP_NOFS);
        if (!ea_p)
                return -ENOMEM;