bug-parted
[Top][All Lists]
Advanced

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

test t4100-dvh-partition-limits.sh failed on mips platform


From: Ming Liu
Subject: test t4100-dvh-partition-limits.sh failed on mips platform
Date: Sat, 16 Feb 2013 10:41:46 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2


Hi,

Test bases on commit: 1c659d5cc6830c6f4f26660e9049582afbad3fd3 maint: avoid new warning/error with gcc-4.8.0 20130105.

Error messages:
--- exp 2013-02-05 03:06:23.819999844 +0000
+++ out 2013-02-05 03:06:23.879999844 +0000
@@ -1,10 +1,6 @@
+Error: Can't have a partition outside the disk!
Model: (file)
Disk loop-file: 4294970342s
Sector size (logical/physical): 512B/512B
-Partition Table: dvh
+Partition Table: unknown
Disk Flags:
-
-Number Start End Size Type File system Name
Flags
- 9 0s 4095s 4096s extended
- 1 4294967295s 4294968294s 1000s primary
-


This issue is caused by integer overflows in libparted/labels/dvh.c, line 416, 417:
......

416         pt->pt_nblks = PED_CPU_TO_BE32 (part->geom.length);
417         pt->pt_firstlbn = PED_CPU_TO_BE32 (part->geom.start);

......

A unsigned int was return calling PED_CPU_TO_BE32, while it's assigned to pt->pt_nblks(int type), overflow may occurs if it's a magnitude value like: 4294967295. This overflow only can be observed when run test case t4100-dvh-partition-limits.sh on BE platforms like MIPS, when the "WORDS_BIGENDIAN" macro is defined.
Attached patch is going to fix it.

the best,
thank you


Attachment: 0001-dvh-fix-several-integer-overflows.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]