| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
The MBR partition pseudo-UUID is generated from table ID and partition
partno. The final UUID size limit is 37 bytes. The table ID has to be
restricted to keep compiler happy (for MBR the table ID is 8 bytes
as string).
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
| |
UBI is volume manager rather than filesystem. Note that libblkid has
optimized RAIDs probing (don't search for another filesystems is RAID
detected). We also don't search for RAIDs on very small devices, but
this optimization is ignored for UBI char devices (size=1byte).
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
UBI is a volume management system that can be used on a raw flash
partition for providing multiple logical volumes. Detecting UBI
superblock may be useful for tools wanting to simplify or automate
attaching UBI.
Please note it's not directly related to the ubifs support which is just
a filesystem working on top of UBI volume.
In other words: UBI can be used on MTD partition (e.g. /dev/mtdblock0)
while ubifs can be used on UBI volume (e.g. /dev/ubi0_0).
This patch adds simple code reading UBI version and unique number and
setting it in the blkid_probe.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The HPE (formerly SGI) enhanced XFS has changed its magic
version number to allow the use of EXFS and community XFS
filesystems at the same time.
This patch adds HPE EXFS support to libblkid.
[kzak@redhat.com: - removed EXFS log prober, it uses the same magic
string as XFS log]
Signed-off-by: Mark Tinguely <mark.tinguely@hpe.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Since the kernel version 4.12 there is a new dm-integrity module
that provides an emulated per-sector metadata format for storing data integrity.
This patch adds dm-integrity magic signature to blkid to recognize such
a block device.
Signed-off-by: Milan Broz <gmazyland@gmail.com>
|
|
|
|
|
|
|
| |
We've added UUID_LIBS in f77a4d1087 but I don't see what it
was good for.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
|
|
|
|
|
|
|
| |
For some reason kernel commit e980f62353c697cbf0c4325e43df6e44399aeb64
add extra warning when the ioctl is used for DM devices. It seems we
can avoid this ioctl when the device has dm/uuid.
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1469532
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|\
| |
| |
| |
| |
| |
| |
| | |
* 'master' of https://github.com/pali/util-linux:
tests: update UDF test, add ID_FS_VERSION
libblkid: udf: Add support for ID_FS_VERSION
libblkid: udf: Fix types
libblkid: udf: De-duplicate code for dstring decoding
|
| |
| |
| |
| | |
Set ID_FS_VERSION to Minimum UDF Read Revision.
|
| | |
|
| | |
|
|/
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The libblkid probing functions returns the first successful result of
the filesystem/RAID/PT. Unfortunately, some signatures is possible to
detect by more ways or device may contains more copies (e.g. GPT).
This is no problem when we wipe signatures from the device. In this
case we zeroize on-device signature and re-scan for the signature (by
blkid_probe_step_back()).
The problem is if we want to read all permutations without the device
modification (for example wipefs(8) dry run).
This patch add blkid_probe_hide_range(). The function remove (zeroize)
specified signature from in-memory cached buffers. If the buffer is
later re-used by probing functions then the signature is invisible and
we can try detect another variant of the magic string.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
| |
The function blkid_probe_new_value() is unnecessary.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
| |
First byte of dstring is OSTA Compression ID and the last byte is length of
recorded bytes (including first byte). Last byte is not a part of recorded
characters, therefore it should not be treated as data to decode.
|
|
|
|
|
|
|
|
|
|
|
| |
When detecting block size of UDF filesystem, try to use also block size
512, 1024, 2048 and 4096. This would allow blkid to detect UDF filesystem
in image file created from 4K hard disk (which should have UDF block size
4096).
Before this patch only UDF images with block size of 512 and 2048 were
detected as only block size from blkid_probe_get_sectorsize() and 2048 were
used (blkid_probe_get_sectorsize() returns for disk images 512).
|
|
|
|
| |
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
| |
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BLOCK_SIZE(sb) should be unsigned so that the left shift is defined.
This was the warning:
../libblkid/src/superblocks/exfat.c: In function 'probe_exfat':
../libblkid/src/superblocks/exfat.c:40:42: warning: '<<' in boolean context, did you mean '<' ? [-Wint-in-bool-context]
#define CLUSTER_SIZE(sb) (BLOCK_SIZE(sb) << (sb)->bpc_bits)
~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
../libblkid/src/superblocks/exfat.c:122:14: note: in expansion of macro 'CLUSTER_SIZE'
if (!sb || !CLUSTER_SIZE(sb))
^~~~~~~~~~~~
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
../login-utils/last.c: In function ‘main’:
../login-utils/last.c:624:23: warning: ‘%s’ directive writing up to 31 bytes into a region of size 27 [-Wformat-overflow=]
sprintf(path, "/dev/%s", ut->ut_line);
^~ ~~
../login-utils/last.c:624:3: note: ‘sprintf’ output between 6 and 37 bytes into a destination of size 32
sprintf(path, "/dev/%s", ut->ut_line);
../libblkid/src/devname.c: In function 'probe_one':
../libblkid/src/devname.c:166:29: warning: '%s' directive writing up to 255 bytes into a region of size 245 [-Wformat-overflow=]
sprintf(path, "/sys/block/%s/slaves", de->d_name);
^~
../libblkid/src/devname.c:166:3: note: 'sprintf' output between 19 and 274 bytes into a destination of size 256
sprintf(path, "/sys/block/%s/slaves", de->d_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
We got some errors on Alpine Linux where $LTLIBINTL is non-empty:
./.libs/libcommon.a(libcommon_la-blkdev.o): In function `open_blkdev_or_file':
lib/blkdev.c:282: undefined reference to `libintl_gettext
collect2: error: ld returned 1 exit status
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ensure that reported UUID always contains only lowercase hexadecimal digits
and is always 16 characters length, padded with zero digits.
Volume Set Identifier is converted to UTF-8 before generating UUID from it.
As it could potentially contain any Unicode character. So correctly handle
both 8bit and 16bit OSTA Compressed Unicode encodings.
Disks which have only lowercase hexadecimal digits in Volume Set Identifier
would have same UUID as before this patch.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Unicode
String encoded in 8bit OSTA Compressed Unicode contains one Unicode
codepoint per 8bits. Maximal Unicode codepoint is U+FF. Which effectively
means that it is equivalent to Latin1 encoding.
Before this patch libblkid copied raw 8bit OSTA Compressed Unicode from
disk and treated it as UTF-8. It worked fine just for UTF-8 invariants,
other characters were incorrectly encoded. This patch fixes this problem.
Note that processing UUID is not fixed in this patch.
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
* 'master' of https://github.com/pali/util-linux:
tests: Add UDF CD-ROM hybrid image (ISO+Joliet+UDF) created by Nero 6
tests: Fix test output for low-probe-udf to contain UDF data
Revert "libblkid: Probe UDF volumes for ISO9660 info as well"
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This reverts commit 8053b51c7601c4a7e5f2eca45610b8228f53d408.
Reporting meaningless ID_FS_LABEL=UDF_Volume written in that commit was
caused by reading wrong value for UDF label and it was fixed in commit
2f2730bc77c972d613cfec421468c84f15749708.
So after this revert blkid reports for UDF filesystems label of UDF
filesystem and not label of ISO (if present) like other systems. In most
cases UDF and ISO labels are same (sometimes just one is upper case).
Commit 8053b51c7601c4a7e5f2eca45610b8228f53d408 just fixed result, not
reason why blkid reported different UDF Label as Windows. Real reason was
fixed in 2f2730bc77c972d613cfec421468c84f15749708.
|
|/
|
|
|
|
|
|
| |
This new function can be use to enquiry what partition names libblkid is
aware of. First use of this information will be in partx(8) to make bash
completion to work without a magic list.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
| |
in loop
|
|
|
|
|
|
|
|
|
|
|
| |
Fix compiler warnings seen on Linux/i586 and OSX/travis.
#type #format #cast
unsigned long %lu -
uint64_t PRIu64 -
fdisk_sector_t %ju (uintmax_t)
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is possible to perform out of boundary read accesses due to
insufficient boundary checks in probe_hfsplus.
The first issue occurs if the leaf count in a B-node is too
small. The second happens while parsing a unicode description which
is longer than 255 UTF-8 characters. The length is stored in a 16 bit
integer, but the array in the struct is limited to 255 * 2, which is
in sync with Apple's Open Source HFS+ implementation (HFSUniStr255).
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Following condition can be true if minix file system is corrupt, and versio
number is found to be greater than 3. It is fair to say described scenario
is unlikely.
libblkid/src/superblocks/minix.c:107:13: warning: variable 'zone_size' is
used uninitialized whenever
'if' condition is false [-Wsometimes-uninitialized]
} else if (version == 3) {
^~~~~~~~~~~~
libblkid/src/superblocks/minix.c:121:6: note: uninitialized use occurs here
if (zone_size != 0 || ninodes == 0 || ninodes == UINT32_MAX)
^~~~~~~~~
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
|
|
|
| |
libblkid/src/superblocks/drbdmanage.c:38:42: warning: too long
initializer-string for array of char(no space for nul char)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
| |
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
|
|
|
|
|
| |
The SEND_UEVENT=yes|no line is not properly parsed, because the offset
jumps one byte too far behind the equal sign. Therefore, every
configuration that contains the line "SEND_UEVENT=yes" still does not
send an uevent.
The fix is simple: adjust the offset to be "12" instead of "13".
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Else these variables will cause following warning:
libblkid/src/superblocks/superblocks.c:165:29: warning: symbol
'superblocks_drv' was not declared. Should it be static?
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
|
|
|
| |
text-utils/rev.c:68:9: warning: symbol 'buf' was not declared. Should it be
static?
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
|
|
|
|
|
|
| |
text-utils/tailf.c:69:21: warning: Using plain integer as NULL pointer
Since many 'struct option' has used zero as NULL make them more readable in
same go by reindenting, and using named argument requirements.
Reference: https://lwn.net/Articles/93577/
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
| |
Now wipefs always inform about MBR as about PMBR. That's bug.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The BEFS prober is quite trusting of whatever data is fed to it and
performs almost no bounds checks. There don't seem to be any
out-of-bounds writes as far as I can tell, but there are many ways a
corrupted image could cause libblkid to read OOB and segfault, or hang
in an infinite loop.
This fix makes a few sanity-checks of the superblock, add bounds checks
wherever they seem needed, and crudely checks for cycles in the B+ tree.
Signed-off-by: Alden Tondettar <alden.tondettar@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
If a GUID Partition Table claims to have more than 2**25 entries, or if the
size of each entry is not exactly 128 bytes, libblkid can read out of bounds
and segfault. Perform the appropriate checks.
[kzak@redhat.com: - fix typo]
Signed-off-by: Alden Tondettar <alden.tondettar@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
The NTFS prober does not validate certain fields in struct file_attribute,
and could attempt to read the disk label from outside the space allocated
for the Master File Table. Perform the appropriate checks.
Note that one variable (attr_off) is now 64-bit, so a check for integer
overflow has been removed as unneeded/confusing.
Signed-off-by: Alden Tondettar <alden.tondettar@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A corrupted ZFS filesystem can trigger 32-bit endian-conversions of
unintended memory locations in zfs_extract_guid_name(), in several ways:
* The variable "left" (number of bytes remaining in the buffer) does not
account for the 12 bytes of the nvlist header.
* The field nvp->nvp_namelen (name length in name/value pair) is rounded
up to the nearest multiple of 4, but only the unrounded size is checked.
* The fields nvs->nvs_type, nvs_strlen, etc. are modified _before_ checking
if they are within bounds.
* A negative value of nvp->nvp_namelen will bypass the check that
nvp->nvp_namelen fits into nvp->nvp_size (size of name/value pair).
This allows for mangling of locations up to 12 + 3 + 8 == 23
bytes beyond the end of stack-based buff[4096], and up to 2**31 bytes
before its beginning.
Furthermore some debugging messages are printed from unchecked memory
locations, possibly resulting in OOB reads or setuid programs leaking
sensitive data when LIBBLKID_DEBUG is set.
This fix attempts to correct all of these problems. It also eliminates the
stack-based buffer (in case anything else was missed) and refactors things
a bit to (hopefully) make it easier to spot any mistakes.
Signed-off-by: Alden Tondettar <alden.tondettar@gmail.com>
|