util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug: libfdisk/dos.c: Extended partition number == 1? -> crash
@ 2014-10-06 17:51 Christoph Hoopmann
  2014-10-07  9:51 ` Karel Zak
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hoopmann @ 2014-10-06 17:51 UTC (permalink / raw)
  To: util-linux


[-- Attachment #1.1: Type: text/plain, Size: 944 bytes --]

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

-- 
Christoph Hoopmann
Jabber: choopm@jabber.ccc.de
https://www.0pointer.org/

[-- Attachment #1.2: 0xAB689BB7.asc --]
[-- Type: application/pgp-keys, Size: 11124 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bug: libfdisk/dos.c: Extended partition number == 1? -> crash
  2014-10-06 17:51 Bug: libfdisk/dos.c: Extended partition number == 1? -> crash Christoph Hoopmann
@ 2014-10-07  9:51 ` Karel Zak
  0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2014-10-07  9:51 UTC (permalink / raw)
  To: Christoph Hoopmann; +Cc: util-linux

On Mon, Oct 06, 2014 at 07:51:20PM +0200, Christoph Hoopmann wrote:
> seems like I discovered a crash in util-linux-2.25.1:
... 
> 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!

> 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

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-10-07  9:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-06 17:51 Bug: libfdisk/dos.c: Extended partition number == 1? -> crash Christoph Hoopmann
2014-10-07  9:51 ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).