libblkid: broken calculation of blkid_probe size for ubiN_M

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

 



Hi,

Today I discovered libblkid can't recognize my UBI volume with ubifs
filesystem. The code in libblkid/src/superblocks/ubifs.c seems
alright, but it's never used because of:
# LIBBLKID_DEBUG=lowprobe,buffer blkid /dev/ubi0_0
(...)
4166: libblkid: LOWPROBE: [59] ubifs:
4166: libblkid:   BUFFER:         ignore: request out of probing area

Above error comes from blkid_probe_get_buffer and its
pr->off + pr->size < real_off + len
condition. In my case its evaulated as:
0 + 1 < 0 + 4
(pr->size is 1 which looks wrong obviously).

My UBI MTD partition is detected as:
[    0.834197] Creating 1 MTD partitions on "brcmnand.0":
[    0.839318] 0x000000000000-0x000008000000 : "ubi"

And attached using:
ubiattach -m 0

If you take a look at blkid_verify, you can see it calls:
blkid_probe_set_device(cache->probe, fd, 0, 0)
(the last 0 argument is "size" variable). So the source of the problem
seems to be "size" calculation inside blkid_probe_set_device. It has
something like:
if (S_ISCHR(sb.st_mode))
        devsiz = 1; /* UBI devices are char... */
pr->size = size ? (uint64_t)size : devsiz;

While I managed to debug and track down this issue, I'm not familiar
enough with libblkid to fix it. Could someone take a look at this and
help me, please?

-- 
Rafał
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux