Skip to contentSkip to conversation

Bug: libfdisk/dos.c: Extended partition number == 1? -> crash

DISCUSSION Christoph Hoopmann 2 participants 2 messages Oct 6, 2014 – Oct 7, 2014 Util-Linux package

lore
Share & tools
lore
#0 lore raw

To whom it may concern,

seems like I discovered a crash in util-linux-2.25.1:
If you've created an extended partition using number 1, fdisk/cfdisk/whateveruseslibfdisk will crash when adding a new logical partition.

Steps to reproduce:
fdisk /dev/sda
o, n, e, 1, .., n, l ->

fdisk: libfdisk/src/dos.c:1161: add_logical: Assertion 'self_label(cxt)->ext_index' failed

This does happen since 2.25, seems to come from [1]. Versions prior to 2.25 (2.24 tested) aren't effected and so are able to write a partition layout without primary partitions.

During testing of this bug, I noticed a second crash when writing the partition table to the harddisk. I'm not aware of how to reproduce it.

Regards

[1]
http://git.kernel.org/cgit/utils/util-linux/util-linux.git/commit/libfdisk/src/dos.c?id=613596b3873a0d7d45396e066eee097b082ff833

Signature · 3 lines
Christoph Hoopmann
Jabber: [email protected]
https://www.0pointer.org/
maintainer
#1 lore raw
Quoted 1 line · Christoph Hoopmann

seems like I discovered a crash in util-linux-2.25.1:

...

Quoted 2 lines

fdisk: libfdisk/src/dos.c:1161: add_logical: Assertion 'self_label(cxt)->ext_index' failed

The assert() is nonsense, ext_index=0 is absolutely valid. Sorry. Fixed in master branch, will be in fixed in 2.25.2 too. Thanks!

Quoted 2 lines

During testing of this bug, I noticed a second crash when writing the partition table to the harddisk. I'm not aware of how to reproduce it.

hmm...

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com