GNU bug report logs - #15366
MBR disk signature not random enough

Previous Next

Package: parted;

Reported by: Philip Rowlands <phr+coreutils <at> dimebar.com>

Date: Fri, 13 Sep 2013 13:08:01 UTC

Severity: normal

Done: Phillip Susi <psusi <at> ubuntu.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Philip Rowlands <phr+coreutils <at> dimebar.com>
To: 15366 <at> debbugs.gnu.org
Subject: bug#15366: MBR disk signature not random enough
Date: Fri, 13 Sep 2013 14:06:30 +0100
libparted/labels/dos.c:generate_random_id()
is used to create a new mbr_signature where none exists. The possible 
return values for generate_random_id() range from 0 to 999999, derived 
from the tv_usec field of gettimeofday(2).

This limits the actual value written to mbr_signature to 0.023% of the 
possible uint32 values.

I don't know how many MBRs in the world libparted has written the 
mbr_signature to, but the chance of collisions are greatly increased by 
having an artificially restricted value.

Is there a better libc-provided rand(3)/random(3) function which can be 
used to provide a full 32 bits of randomness?

I haven't checked all the other mklabel types, but it's possible they 
have similar limitations. gpt.c uses uuid_generate() which delegates the 
task to libuuid. Perhaps this could be used (with truncated output) for 
the MBR signature?

Cheers,
Phil




This bug report was last modified 11 years and 274 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.