Skip to content

Commit 08acbdd

Browse files
Revert "UBIFS: Fix potential integer overflow in allocation"
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]>
1 parent 49d2e05 commit 08acbdd

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
@@ -1288,11 +1288,10 @@ static int truncate_data_node(const struct ubifs_info *c, const struct inode *in
12881288
int *new_len)
12891289
{
12901290
void *buf;
1291-
int err, compr_type;
1292-
u32 dlen, out_len, old_dlen;
1291+
int err, dlen, compr_type, out_len, old_dlen;
12931292

12941293
out_len = le32_to_cpu(dn->size);
1295-
buf = kmalloc_array(out_len, WORST_COMPR_FACTOR, GFP_NOFS);
1294+
buf = kmalloc(out_len * WORST_COMPR_FACTOR, GFP_NOFS);
12961295
if (!buf)
12971296
return -ENOMEM;
12981297

0 commit comments

Comments
 (0)