diff options
| author | Ming Liu <ming.liu@windriver.com> | 2013-02-26 09:19:44 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-02-28 23:15:48 +0000 |
| commit | 399ca5da8c4ff7e62e13c82b1dc82e80a56fce37 (patch) | |
| tree | 88bf99a5606bc2af4da5a472b956a90b9dbad3e0 | |
| parent | 9f1c471ed47372dfff214fff7f73f861f9821491 (diff) | |
| download | poky-399ca5da8c4ff7e62e13c82b1dc82e80a56fce37.tar.gz | |
parted: fix several integer overflows
Integer overflows were found in libparted/labels/dvh.c, while attemptting
to assign unsigned int values to int types in some places. These overflows
only can be observed on BE platforms like MIPS, when the "WORDS_BIGENDIAN"
macro is defined in parted.
Defined by unsigned int instead.
(From OE-Core rev: 9acaa764a4df8d589011ff597bba2afc05d6e78b)
Signed-off-by: Ming Liu <ming.liu@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-extended/parted/parted-3.1/fix-dvh-overflows.patch | 35 | ||||
| -rw-r--r-- | meta/recipes-extended/parted/parted_3.1.bb | 5 |
2 files changed, 38 insertions, 2 deletions
diff --git a/meta/recipes-extended/parted/parted-3.1/fix-dvh-overflows.patch b/meta/recipes-extended/parted/parted-3.1/fix-dvh-overflows.patch new file mode 100644 index 0000000000..b1eae97988 --- /dev/null +++ b/meta/recipes-extended/parted/parted-3.1/fix-dvh-overflows.patch | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | Upstream-Status: Pending | ||
| 2 | |||
| 3 | Signed-off-by: Ming Liu <ming.liu@windriver.com> | ||
| 4 | --- | ||
| 5 | dvh.h | 10 +++++----- | ||
| 6 | 1 file changed, 5 insertions(+), 5 deletions(-) | ||
| 7 | |||
| 8 | Index: parted-3.1/libparted/labels/dvh.h | ||
| 9 | =================================================================== | ||
| 10 | --- parted-3.1.orig/libparted/labels/dvh.h 2013-02-25 10:46:13.204477586 +0800 | ||
| 11 | +++ parted-3.1/libparted/labels/dvh.h 2013-02-25 10:47:20.954477065 +0800 | ||
| 12 | @@ -112,8 +112,8 @@ struct device_parameters { | ||
| 13 | |||
| 14 | struct volume_directory { | ||
| 15 | char vd_name[VDNAMESIZE]; /* name */ | ||
| 16 | - int vd_lbn; /* logical block number */ | ||
| 17 | - int vd_nbytes; /* file length in bytes */ | ||
| 18 | + unsigned int vd_lbn; /* logical block number */ | ||
| 19 | + unsigned int vd_nbytes; /* file length in bytes */ | ||
| 20 | }; | ||
| 21 | |||
| 22 | /* | ||
| 23 | @@ -125,9 +125,9 @@ struct volume_directory { | ||
| 24 | * NOTE: pt_firstlbn SHOULD BE CYLINDER ALIGNED | ||
| 25 | */ | ||
| 26 | struct partition_table { /* one per logical partition */ | ||
| 27 | - int pt_nblks; /* # of logical blks in partition */ | ||
| 28 | - int pt_firstlbn; /* first lbn of partition */ | ||
| 29 | - int pt_type; /* use of partition */ | ||
| 30 | + unsigned int pt_nblks; /* # of logical blks in partition */ | ||
| 31 | + unsigned int pt_firstlbn; /* first lbn of partition */ | ||
| 32 | + int pt_type; /* use of partition */ | ||
| 33 | }; | ||
| 34 | |||
| 35 | #define PTYPE_VOLHDR 0 /* partition is volume header */ | ||
diff --git a/meta/recipes-extended/parted/parted_3.1.bb b/meta/recipes-extended/parted/parted_3.1.bb index 21d3a66b70..079b29593d 100644 --- a/meta/recipes-extended/parted/parted_3.1.bb +++ b/meta/recipes-extended/parted/parted_3.1.bb | |||
| @@ -4,13 +4,14 @@ LICENSE = "GPLv3+" | |||
| 4 | LIC_FILES_CHKSUM = "file://COPYING;md5=2f31b266d3440dd7ee50f92cf67d8e6c" | 4 | LIC_FILES_CHKSUM = "file://COPYING;md5=2f31b266d3440dd7ee50f92cf67d8e6c" |
| 5 | SECTION = "console/tools" | 5 | SECTION = "console/tools" |
| 6 | DEPENDS = "ncurses readline util-linux" | 6 | DEPENDS = "ncurses readline util-linux" |
| 7 | PR = "r0" | 7 | PR = "r1" |
| 8 | 8 | ||
| 9 | SRC_URI = "${GNU_MIRROR}/parted/parted-${PV}.tar.xz \ | 9 | SRC_URI = "${GNU_MIRROR}/parted/parted-${PV}.tar.xz \ |
| 10 | file://no_check.patch \ | 10 | file://no_check.patch \ |
| 11 | file://syscalls.patch \ | 11 | file://syscalls.patch \ |
| 12 | file://fix-git-version-gen.patch \ | 12 | file://fix-git-version-gen.patch \ |
| 13 | file://fix-doc-mandir.patch" | 13 | file://fix-doc-mandir.patch \ |
| 14 | file://fix-dvh-overflows.patch" | ||
| 14 | 15 | ||
| 15 | SRC_URI[md5sum] = "5d89d64d94bcfefa9ce8f59f4b81bdcb" | 16 | SRC_URI[md5sum] = "5d89d64d94bcfefa9ce8f59f4b81bdcb" |
| 16 | SRC_URI[sha256sum] = "5e9cc1f91eaf016e5033d85b9b893fd6d3ffaca532a48de1082df9b94225ca15" | 17 | SRC_URI[sha256sum] = "5e9cc1f91eaf016e5033d85b9b893fd6d3ffaca532a48de1082df9b94225ca15" |
