Skip to content

Commit 3259dd7

Browse files
richardweinbergergregkh
authored andcommitted
Revert "UBIFS: Fix potential integer overflow in allocation"
commit 08acbdd upstream. This reverts commit 353748a. It bypassed the linux-mtd review process and fixes the issue not as it should. Cc: Kees Cook <[email protected]> Cc: Silvio Cesare <[email protected]> Cc: [email protected] Signed-off-by: Richard Weinberger <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a230db3 commit 3259dd7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

fs/ubifs/journal.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,11 +1283,10 @@ static int truncate_data_node(const struct ubifs_info *c, const struct inode *in
12831283
int *new_len)
12841284
{
12851285
void *buf;
1286-
int err, compr_type;
1287-
u32 dlen, out_len, old_dlen;
1286+
int err, dlen, compr_type, out_len, old_dlen;
12881287

12891288
out_len = le32_to_cpu(dn->size);
1290-
buf = kmalloc_array(out_len, WORST_COMPR_FACTOR, GFP_NOFS);
1289+
buf = kmalloc(out_len * WORST_COMPR_FACTOR, GFP_NOFS);
12911290
if (!buf)
12921291
return -ENOMEM;
12931292

0 commit comments

Comments
 (0)