+ block-partitions-efic-fix-bound-check.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Subject: + block-partitions-efic-fix-bound-check.patch added to -mm tree
To: amiettinen@xxxxxxxxxx,hdoyu@xxxxxxxxxx,matt.fleming@xxxxxxxxx,wad@xxxxxxxxxxxx
From: akpm@xxxxxxxxxxxxxxxxxxxx
Date: Tue, 19 Nov 2013 16:04:58 -0800


The patch titled
     Subject: block/partitions/efi.c: fix bound check
has been added to the -mm tree.  Its filename is
     block-partitions-efic-fix-bound-check.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/block-partitions-efic-fix-bound-check.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/block-partitions-efic-fix-bound-check.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Antti P Miettinen <amiettinen@xxxxxxxxxx>
Subject: block/partitions/efi.c: fix bound check

Use ARRAY_SIZE instead of sizeof to get proper max for label length.

Signed-off-by: Antti P Miettinen <amiettinen@xxxxxxxxxx>
Reviewed-by: Hiroshi Doyu <hdoyu@xxxxxxxxxx>
Tested-by: Hiroshi Doyu <hdoyu@xxxxxxxxxx>
Cc: Will Drewry <wad@xxxxxxxxxxxx>
Cc: Matt Fleming <matt.fleming@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 block/partitions/efi.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff -puN block/partitions/efi.c~block-partitions-efic-fix-bound-check block/partitions/efi.c
--- a/block/partitions/efi.c~block-partitions-efic-fix-bound-check
+++ a/block/partitions/efi.c
@@ -96,6 +96,7 @@
  * - Code works, detects all the partitions.
  *
  ************************************************************/
+#include <linux/kernel.h>
 #include <linux/crc32.h>
 #include <linux/ctype.h>
 #include <linux/math64.h>
@@ -715,8 +716,8 @@ int efi_partition(struct parsed_partitio
 		efi_guid_unparse(&ptes[i].unique_partition_guid, info->uuid);
 
 		/* Naively convert UTF16-LE to 7 bits. */
-		label_max = min(sizeof(info->volname) - 1,
-				sizeof(ptes[i].partition_name));
+		label_max = min(ARRAY_SIZE(info->volname) - 1,
+				ARRAY_SIZE(ptes[i].partition_name));
 		info->volname[label_max] = 0;
 		while (label_count < label_max) {
 			u8 c = ptes[i].partition_name[label_count] & 0xff;
_

Patches currently in -mm which might be from amiettinen@xxxxxxxxxx are

block-partitions-efic-fix-bound-check.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux