* [PATCH] parted: fix several integer overflows
@ 2013-02-25 5:03 Ming Liu
2013-02-25 23:55 ` Saul Wold
0 siblings, 1 reply; 3+ messages in thread
From: Ming Liu @ 2013-02-25 5:03 UTC (permalink / raw)
To: openembedded-core
Integer overflows was found in libparted/labels/dvh.c, while attemptting
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.
Signed-off-by: Ming Liu <ming.liu@windriver.com>
---
.../parted/parted-3.1/fix-dvh-overflows.patch | 34 ++++++++++++++++++++++
meta/recipes-extended/parted/parted_3.1.bb | 5 ++--
2 files changed, 37 insertions(+), 2 deletions(-)
create mode 100644 meta/recipes-extended/parted/parted-3.1/fix-dvh-overflows.patch
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 0000000..0768642
--- /dev/null
+++ b/meta/recipes-extended/parted/parted-3.1/fix-dvh-overflows.patch
@@ -0,0 +1,34 @@
+Upstream-Status: Pending
+
+---
+ dvh.h | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+Index: parted-3.1/libparted/labels/dvh.h
+===================================================================
+--- parted-3.1.orig/libparted/labels/dvh.h 2013-02-25 10:46:13.204477586 +0800
++++ parted-3.1/libparted/labels/dvh.h 2013-02-25 10:47:20.954477065 +0800
+@@ -112,8 +112,8 @@ struct device_parameters {
+
+ struct volume_directory {
+ char vd_name[VDNAMESIZE]; /* name */
+- int vd_lbn; /* logical block number */
+- int vd_nbytes; /* file length in bytes */
++ unsigned int vd_lbn; /* logical block number */
++ unsigned int vd_nbytes; /* file length in bytes */
+ };
+
+ /*
+@@ -125,9 +125,9 @@ struct volume_directory {
+ * NOTE: pt_firstlbn SHOULD BE CYLINDER ALIGNED
+ */
+ struct partition_table { /* one per logical partition */
+- int pt_nblks; /* # of logical blks in partition */
+- int pt_firstlbn; /* first lbn of partition */
+- int pt_type; /* use of partition */
++ unsigned int pt_nblks; /* # of logical blks in partition */
++ unsigned int pt_firstlbn; /* first lbn of partition */
++ int pt_type; /* use of partition */
+ };
+
+ #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 21d3a66..079b295 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+"
LIC_FILES_CHKSUM = "file://COPYING;md5=2f31b266d3440dd7ee50f92cf67d8e6c"
SECTION = "console/tools"
DEPENDS = "ncurses readline util-linux"
-PR = "r0"
+PR = "r1"
SRC_URI = "${GNU_MIRROR}/parted/parted-${PV}.tar.xz \
file://no_check.patch \
file://syscalls.patch \
file://fix-git-version-gen.patch \
- file://fix-doc-mandir.patch"
+ file://fix-doc-mandir.patch \
+ file://fix-dvh-overflows.patch"
SRC_URI[md5sum] = "5d89d64d94bcfefa9ce8f59f4b81bdcb"
SRC_URI[sha256sum] = "5e9cc1f91eaf016e5033d85b9b893fd6d3ffaca532a48de1082df9b94225ca15"
--
1.7.11
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] parted: fix several integer overflows
2013-02-25 5:03 [PATCH] parted: fix several integer overflows Ming Liu
@ 2013-02-25 23:55 ` Saul Wold
2013-02-26 0:55 ` Ming Liu
0 siblings, 1 reply; 3+ messages in thread
From: Saul Wold @ 2013-02-25 23:55 UTC (permalink / raw)
To: Ming Liu; +Cc: openembedded-core
On 02/24/2013 09:03 PM, Ming Liu wrote:
> Integer overflows was found in libparted/labels/dvh.c, while attemptting
> 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.
>
> Signed-off-by: Ming Liu <ming.liu@windriver.com>
> ---
> .../parted/parted-3.1/fix-dvh-overflows.patch | 34 ++++++++++++++++++++++
> meta/recipes-extended/parted/parted_3.1.bb | 5 ++--
> 2 files changed, 37 insertions(+), 2 deletions(-)
> create mode 100644 meta/recipes-extended/parted/parted-3.1/fix-dvh-overflows.patch
>
> 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 0000000..0768642
> --- /dev/null
> +++ b/meta/recipes-extended/parted/parted-3.1/fix-dvh-overflows.patch
> @@ -0,0 +1,34 @@
> +Upstream-Status: Pending
> +
Please add Signed-off-by: to the patch also.
Thanks
Sau!
> +---
> + dvh.h | 10 +++++-----
> + 1 file changed, 5 insertions(+), 5 deletions(-)
> +
> +Index: parted-3.1/libparted/labels/dvh.h
> +===================================================================
> +--- parted-3.1.orig/libparted/labels/dvh.h 2013-02-25 10:46:13.204477586 +0800
> ++++ parted-3.1/libparted/labels/dvh.h 2013-02-25 10:47:20.954477065 +0800
> +@@ -112,8 +112,8 @@ struct device_parameters {
> +
> + struct volume_directory {
> + char vd_name[VDNAMESIZE]; /* name */
> +- int vd_lbn; /* logical block number */
> +- int vd_nbytes; /* file length in bytes */
> ++ unsigned int vd_lbn; /* logical block number */
> ++ unsigned int vd_nbytes; /* file length in bytes */
> + };
> +
> + /*
> +@@ -125,9 +125,9 @@ struct volume_directory {
> + * NOTE: pt_firstlbn SHOULD BE CYLINDER ALIGNED
> + */
> + struct partition_table { /* one per logical partition */
> +- int pt_nblks; /* # of logical blks in partition */
> +- int pt_firstlbn; /* first lbn of partition */
> +- int pt_type; /* use of partition */
> ++ unsigned int pt_nblks; /* # of logical blks in partition */
> ++ unsigned int pt_firstlbn; /* first lbn of partition */
> ++ int pt_type; /* use of partition */
> + };
> +
> + #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 21d3a66..079b295 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+"
> LIC_FILES_CHKSUM = "file://COPYING;md5=2f31b266d3440dd7ee50f92cf67d8e6c"
> SECTION = "console/tools"
> DEPENDS = "ncurses readline util-linux"
> -PR = "r0"
> +PR = "r1"
>
> SRC_URI = "${GNU_MIRROR}/parted/parted-${PV}.tar.xz \
> file://no_check.patch \
> file://syscalls.patch \
> file://fix-git-version-gen.patch \
> - file://fix-doc-mandir.patch"
> + file://fix-doc-mandir.patch \
> + file://fix-dvh-overflows.patch"
>
> SRC_URI[md5sum] = "5d89d64d94bcfefa9ce8f59f4b81bdcb"
> SRC_URI[sha256sum] = "5e9cc1f91eaf016e5033d85b9b893fd6d3ffaca532a48de1082df9b94225ca15"
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] parted: fix several integer overflows
2013-02-25 23:55 ` Saul Wold
@ 2013-02-26 0:55 ` Ming Liu
0 siblings, 0 replies; 3+ messages in thread
From: Ming Liu @ 2013-02-26 0:55 UTC (permalink / raw)
To: Saul Wold; +Cc: openembedded-core
On 02/26/2013 07:55 AM, Saul Wold wrote:
> On 02/24/2013 09:03 PM, Ming Liu wrote:
>> Integer overflows was found in libparted/labels/dvh.c, while attemptting
>> 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.
>>
>> Signed-off-by: Ming Liu <ming.liu@windriver.com>
>> ---
>> .../parted/parted-3.1/fix-dvh-overflows.patch | 34
>> ++++++++++++++++++++++
>> meta/recipes-extended/parted/parted_3.1.bb | 5 ++--
>> 2 files changed, 37 insertions(+), 2 deletions(-)
>> create mode 100644
>> meta/recipes-extended/parted/parted-3.1/fix-dvh-overflows.patch
>>
>> 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 0000000..0768642
>> --- /dev/null
>> +++ b/meta/recipes-extended/parted/parted-3.1/fix-dvh-overflows.patch
>> @@ -0,0 +1,34 @@
>> +Upstream-Status: Pending
>> +
> Please add Signed-off-by: to the patch also.
OK, got it. I will send V1.
the best,
thank you
>
> Thanks
> Sau!
>
>> +---
>> + dvh.h | 10 +++++-----
>> + 1 file changed, 5 insertions(+), 5 deletions(-)
>> +
>> +Index: parted-3.1/libparted/labels/dvh.h
>> +===================================================================
>> +--- parted-3.1.orig/libparted/labels/dvh.h 2013-02-25
>> 10:46:13.204477586 +0800
>> ++++ parted-3.1/libparted/labels/dvh.h 2013-02-25
>> 10:47:20.954477065 +0800
>> +@@ -112,8 +112,8 @@ struct device_parameters {
>> +
>> + struct volume_directory {
>> + char vd_name[VDNAMESIZE]; /* name */
>> +- int vd_lbn; /* logical block number */
>> +- int vd_nbytes; /* file length in bytes */
>> ++ unsigned int vd_lbn; /* logical block number */
>> ++ unsigned int vd_nbytes; /* file length in bytes */
>> + };
>> +
>> + /*
>> +@@ -125,9 +125,9 @@ struct volume_directory {
>> + * NOTE: pt_firstlbn SHOULD BE CYLINDER ALIGNED
>> + */
>> + struct partition_table { /* one per logical partition */
>> +- int pt_nblks; /* # of logical blks in partition */
>> +- int pt_firstlbn; /* first lbn of partition */
>> +- int pt_type; /* use of partition */
>> ++ unsigned int pt_nblks; /* # of logical blks in partition */
>> ++ unsigned int pt_firstlbn; /* first lbn of partition */
>> ++ int pt_type; /* use of partition */
>> + };
>> +
>> + #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 21d3a66..079b295 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+"
>> LIC_FILES_CHKSUM =
>> "file://COPYING;md5=2f31b266d3440dd7ee50f92cf67d8e6c"
>> SECTION = "console/tools"
>> DEPENDS = "ncurses readline util-linux"
>> -PR = "r0"
>> +PR = "r1"
>>
>> SRC_URI = "${GNU_MIRROR}/parted/parted-${PV}.tar.xz \
>> file://no_check.patch \
>> file://syscalls.patch \
>> file://fix-git-version-gen.patch \
>> - file://fix-doc-mandir.patch"
>> + file://fix-doc-mandir.patch \
>> + file://fix-dvh-overflows.patch"
>>
>> SRC_URI[md5sum] = "5d89d64d94bcfefa9ce8f59f4b81bdcb"
>> SRC_URI[sha256sum] =
>> "5e9cc1f91eaf016e5033d85b9b893fd6d3ffaca532a48de1082df9b94225ca15"
>>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-02-26 1:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-25 5:03 [PATCH] parted: fix several integer overflows Ming Liu
2013-02-25 23:55 ` Saul Wold
2013-02-26 0:55 ` Ming Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox