The patch titled
     fs/partitions/ldm.c: fix buffer overflow again
has been removed from the -mm tree.  Its filename was
     fs-partitions-ldmc-fix-buffer-overflow-again.patch

This patch was dropped because it was merged into mainline or a subsystem tree

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: fs/partitions/ldm.c: fix buffer overflow again
From: Timo Warns <[email protected]>

c340b1d640001 ("fs/partitions/ldm.c: fix oops caused by corrupted
partition table") was incomplete and incorrect.  It does not consider that
for subsequent fragments, previously allocated memory is used.

Signed-off-by: Timo Warns <[email protected]>
Cc: Eugene Teo <[email protected]>
Cc: Harvey Harrison <[email protected]>
Cc: Richard Russon <[email protected]>
Reported-by: Ben Hutchings <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
---

 fs/partitions/ldm.c |    5 +++++
 1 file changed, 5 insertions(+)

diff -puN fs/partitions/ldm.c~fs-partitions-ldmc-fix-buffer-overflow-again 
fs/partitions/ldm.c
--- a/fs/partitions/ldm.c~fs-partitions-ldmc-fix-buffer-overflow-again
+++ a/fs/partitions/ldm.c
@@ -1335,6 +1335,11 @@ static bool ldm_frag_add (const u8 *data
 
        list_add_tail (&f->list, frags);
 found:
+       if (rec >= f->num) {
+               ldm_error("REC value (%d) exceeds NUM value (%d)", rec, f->num);
+               return false;
+       }
+
        if (f->map & (1 << rec)) {
                ldm_error ("Duplicate VBLK, part %d.", rec);
                f->map &= 0x7F;                 /* Mark the group as broken */
_

Patches currently in -mm which might be from [email protected] are

origin.patch
fs-partitions-efic-corrupted-guid-partition-tables-can-cause-kernel-oops.patch

_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to