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:14:40 +0000 |
commit | 9acaa764a4df8d589011ff597bba2afc05d6e78b (patch) | |
tree | 46f77b3c3227956430d4811f6993567ce834cba7 /meta/recipes-extended/parted/parted-3.1 | |
parent | d7b8ae19464a3fe87822376b541b3d6865fe6115 (diff) | |
download | openembedded-core-9acaa764a4df8d589011ff597bba2afc05d6e78b.tar.gz openembedded-core-9acaa764a4df8d589011ff597bba2afc05d6e78b.tar.bz2 openembedded-core-9acaa764a4df8d589011ff597bba2afc05d6e78b.zip |
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.
Signed-off-by: Ming Liu <ming.liu@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'meta/recipes-extended/parted/parted-3.1')
-rw-r--r-- | meta/recipes-extended/parted/parted-3.1/fix-dvh-overflows.patch | 35 |
1 files changed, 35 insertions, 0 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 @@ +Upstream-Status: Pending + +Signed-off-by: Ming Liu <ming.liu@windriver.com> +--- + 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 */ |