Xenial: libblkid: fix false-positive/misdetection of nilfs2 filesystem with udev

Bug #1842437 reported by Mauricio Faria de Oliveira on 2019-09-03
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
util-linux (Ubuntu)
Undecided
Unassigned
Xenial
Medium
Mauricio Faria de Oliveira

Bug Description

[Impact]

 * Users / systemd can fail to mount a filesystem by UUID
   (e.g., during boot, triggering emergency shell prompt)
   if the magic bytes for the nilfs filesystem are written
   to the right place in a partition of another filesystem,
   (for whatever reason or coincidence).

 * Note this can happen after the filesystem/mount is working
   correctly, so a change of behavior/problem can potentially
   be noticed when trying to mount the filesystem again, which
   can very well be the next time the system boots.

 * This happens because if udev blkid detects more than one
   filesystem, it does not print the UUID env vars required
   to create the /dev/disk/by-id symlinks and other things.

 * The fix enhances the check for valid nilfs superblock by
   specifically checking a value read from disk to be valid/
   within a value range, which addresses this one occurrence
   and prevents a lot more.

[Test Case]

 * Synthetic test case written for this problem on comment #6.

[Regression Potential]

 * Low. The code is contained in the probe for the nilfs filesystem.

 * This just makes it be more restrictive about the possibly valid
   values for a few bytes read from disk (that now need to be within
   the acceptable range of valid values) so this only decreases false-
   positives, and cannot increase false-negatives of valid filesystems.

[Original Description]

The nilfs filesystem has a backup superblock at the end of the device.

If the magic number is coincidentally found at the right position
and the filesystem is on a partition/not-wholedisk device,
the only check left is for checksum verification,
which is explicitly ignored in 'udev built-in blkid'.

This causes blkid to detect one actually valid filesystem with a
superblock at the beginning of the device (e.g., ext4), and then
an invalid nilfs2 filesystem due to a coincidental magic number
at the end of the device.

And this causes blkid to break out of the safeprobe routine
(which expects a single filesystem to be detected), and not
print the UUIDs, thus not creating /dev/disk/by-uuid/ links
which prevent mounting the partition by-uuid at boot time,
causing emergency shell/boot failures.

This upstream fix resolved the problem by introducing a check
for the 'bytes' paramenters in the superblock, which is read
from disk, and turns out to have an out-of-range value.

- 'liblkid: Add length check in probe_nilfs2 before crc32'
https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/commit/?id=ac681a310c32319423297544833932f4d689a7a2

$ git describe --contains ac681a310c32319423297544833932f4d689a7a2
v2.29-rc1~172

Xenial, which is v2.27.1-based, is the only release that needs it.
Bionic is v2.31.1, so all post-Xenial supported releases have it.

Changed in util-linux (Ubuntu):
status: New → Fix Released
Changed in util-linux (Ubuntu Xenial):
status: New → In Progress
assignee: nobody → Mauricio Faria de Oliveira (mfo)
importance: Undecided → Medium

Problem:

- the ext4 filesystem is detected correctly at the beginning of the partition.
- the nilfs2 filesystem is detected incorrectly at the end of the partition.
- the nilfs2 checksum is invalid, but that is ignored by udev builtin blkid.
- the detection of more than one filesystems causes an error and stop blkid.

# LIBBLKID_DEBUG=all udevadm test-builtin blkid /sys/block/loop0/loop0p1
...
30555: libblkid: LOWPROBE: [28] ext4:
30555: libblkid: LOWPROBE: reuse buffer: off=1024 len=1024 pr=0x558f3ea3dec0
30555: libblkid: LOWPROBE: magic sboff=56, kboff=1
30555: libblkid: LOWPROBE: call probefunc()
30555: libblkid: LOWPROBE: reuse buffer: off=1024 len=1024 pr=0x558f3ea3dec0
30555: libblkid: PROBE: ext2_sb.compat = 0000003C:00000246:0000007B
30555: libblkid: LOWPROBE: assigning UUID [superblocks]
30555: libblkid: LOWPROBE: assigning VERSION [superblocks]
30555: libblkid: LOWPROBE: assigning TYPE [superblocks]
30555: libblkid: LOWPROBE: assigning USAGE [superblocks]
...
30555: libblkid: LOWPROBE: [63] nilfs2:
30555: libblkid: LOWPROBE: call probefunc()
30555: libblkid: LOWPROBE: reuse buffer: off=1024 len=1024 pr=0x558f3ea3dec0
30555: libblkid: LOWPROBE: reuse buffer: off=1072689152 len=4096 pr=0x558f3ea3dec0
30555: libblkid: LOWPROBE: incorrect checksum for type nilfs2, got 3F8DC6BA, expected 2D2D206B
30555: libblkid: LOWPROBE: assigning SBBADCSUM [superblocks]
30555: libblkid: LOWPROBE: nilfs2: primary=0, backup=1, swap=1
30555: libblkid: LOWPROBE: assigning LABEL [superblocks]
30555: libblkid: LOWPROBE: assigning UUID [superblocks]
30555: libblkid: LOWPROBE: assigning VERSION [superblocks]
30555: libblkid: LOWPROBE: assigning TYPE [superblocks]
30555: libblkid: LOWPROBE: assigning USAGE [superblocks]
...
30555: libblkid: LOWPROBE: ERROR: superblocks chain: ambivalent result detected (2 filesystems)!
...

# echo $?
1

udev builtin blkid ignores the checksum error:

nilfs_valid_sb() @ nilfs.c:96

 return blkid_probe_verify_csum(pr, crc, le32_to_cpu(sb->s_sum));

blkid_probe_verify_csum() @ probe.c:1576-1687

        if (csum != expected) {
  ...
                DBG(LOWPROBE, ul_debug(
                                "incorrect checksum for type %s,"
                                " got %"PRIX64", expected %"PRIX64"",
  ...
                 * Accept bad checksum if BLKID_SUBLKS_BADCSUM flags is set
  ...
                        blkid_probe_set_value(pr, "SBBADCSUM", (unsigned char *) "1", 2);
                        goto accept;
                }
                return 0; /* bad checksum */
 ...
 accept:
  return 1;

from debug:

 586: libblkid: LOWPROBE: incorrect checksum for type nilfs2, got 56C7A81B, expected 2D2D206B
 586: libblkid: LOWPROBE: assigning SBBADCSUM [superblocks]

and udev blkid uses that flag:

builtin_blkid() @ udev-builtin-blkid.c:264-268

        blkid_probe_set_superblocks_flags(pr,
  ...
                BLKID_SUBLKS_BADCSUM);

with debug we could confirm that other fields in the backup superblock are invalid,
such as the device size, which was not checked for not being a whole-disk device,
and the bytes length, which is greater than the superblock structure size (8243 vs 1024).

so, the fix to check for the bytes field not being out-of-range resolves this case.

primary superblock
586: libblkid: LOWPROBE: nilfs2: nilfs_valid_sb:77 :: entry
586: libblkid: LOWPROBE: nilfs2: nilfs_valid_sb:80 :: not sb or not magic

backup superblock
586: libblkid: LOWPROBE: nilfs2: nilfs_valid_sb:77 :: entry
586: libblkid: LOWPROBE: nilfs2: nilfs_valid_sb:84 :: is_bak 1
586: libblkid: LOWPROBE: nilfs2: nilfs_valid_sb:85 :: is_wholedisk 0
586: libblkid: LOWPROBE: nilfs2: nilfs_valid_sb:86 :: sb->s_dev_size 3_472_328_296_366_616_623
586: libblkid: LOWPROBE: nilfs2: nilfs_valid_sb:87 :: pr->size 1_072_693_248
586: libblkid: LOWPROBE: nilfs2: nilfs_valid_sb:96 :: bytes 8243
586: libblkid: LOWPROBE: incorrect checksum for type nilfs2, got 56C7A81B, expected 2D2D206B
586: libblkid: LOWPROBE: assigning SBBADCSUM [superblocks]
586: libblkid: LOWPROBE: nilfs2: primary=0, backup=1
586: libblkid: LOWPROBE: nilfs2: primary=0, backup=1, swap=1

original package:
--------

# dpkg -s libblkid1 | grep ^Version:
Version: 2.27.1-6ubuntu3.8

# LIBBLKID_DEBUG=all udevadm test-builtin blkid /sys/block/loop0/loop0p1
...
4924: libblkid: LOWPROBE: [28] ext4:
4924: libblkid: LOWPROBE: reuse buffer: off=1024 len=1024 pr=0x55fe3cbdcec0
4924: libblkid: LOWPROBE: magic sboff=56, kboff=1
4924: libblkid: LOWPROBE: call probefunc()
4924: libblkid: LOWPROBE: reuse buffer: off=1024 len=1024 pr=0x55fe3cbdcec0
4924: libblkid: PROBE: ext2_sb.compat = 0000003C:00000246:0000007B
4924: libblkid: LOWPROBE: assigning UUID [superblocks]
4924: libblkid: LOWPROBE: assigning VERSION [superblocks]
4924: libblkid: LOWPROBE: assigning TYPE [superblocks]
4924: libblkid: LOWPROBE: assigning USAGE [superblocks]
...
4924: libblkid: LOWPROBE: [63] nilfs2:
4924: libblkid: LOWPROBE: call probefunc()
4924: libblkid: LOWPROBE: reuse buffer: off=1024 len=1024 pr=0x55fe3cbdcec0
4924: libblkid: LOWPROBE: reuse buffer: off=1072689152 len=4096 pr=0x55fe3cbdcec0
4924: libblkid: LOWPROBE: incorrect checksum for type nilfs2, got 46498012, expected 2D2D206B
4924: libblkid: LOWPROBE: assigning SBBADCSUM [superblocks]
4924: libblkid: LOWPROBE: nilfs2: primary=0, backup=1, swap=1
4924: libblkid: LOWPROBE: assigning LABEL [superblocks]
4924: libblkid: LOWPROBE: assigning UUID [superblocks]
4924: libblkid: LOWPROBE: assigning VERSION [superblocks]
4924: libblkid: LOWPROBE: assigning TYPE [superblocks]
4924: libblkid: LOWPROBE: assigning USAGE [superblocks]
...
4924: libblkid: LOWPROBE: ERROR: superblocks chain: ambivalent result detected (2 filesystems)!
...
# echo $?
1

modified package:
--------

# dpkg -s libblkid1 | grep ^Version:
Version: 2.27.1-6ubuntu3.8+test20190903b1

# LIBBLKID_DEBUG=all udevadm test-builtin blkid /sys/block/loop0/loop0p1
...
7289: libblkid: LOWPROBE: [28] ext4:
7289: libblkid: LOWPROBE: reuse buffer: off=1024 len=1024 pr=0x5604292b7ec0
7289: libblkid: LOWPROBE: magic sboff=56, kboff=1
7289: libblkid: LOWPROBE: call probefunc()
7289: libblkid: LOWPROBE: reuse buffer: off=1024 len=1024 pr=0x5604292b7ec0
7289: libblkid: PROBE: ext2_sb.compat = 0000003C:00000246:0000007B
7289: libblkid: LOWPROBE: assigning UUID [superblocks]
7289: libblkid: LOWPROBE: assigning VERSION [superblocks]
7289: libblkid: LOWPROBE: assigning TYPE [superblocks]
7289: libblkid: LOWPROBE: assigning USAGE [superblocks]
...
7289: libblkid: LOWPROBE: [63] nilfs2:
7289: libblkid: LOWPROBE: call probefunc()
7289: libblkid: LOWPROBE: reuse buffer: off=1024 len=1024 pr=0x5604292b7ec0
7289: libblkid: LOWPROBE: reuse buffer: off=1072689152 len=4096 pr=0x5604292b7ec0
7289: libblkid: LOWPROBE: [64] exfat:
...
7289: libblkid: LOWPROBE: returning UUID value
ID_FS_UUID=bac40f54-41c7-4a5a-a3f2-87bf23546e9c
...
# echo $?
0

Download full text (6.5 KiB)

This problem can be reproduced with a synthetic test case.

Essentially,
1) create a zero-filled disk image with one partition.
2) format it as ext4.
3) insert the nilfs2 magic bytes at the right position.
4) insert the nilfs2 bytes field at the right position.

--

Step 1)

 # dd if=/dev/zero of=test.img bs=512 count=$((16 * 2048)) # 16 MiB

 # dev=$(losetup --find --show test.img)

 # parted $dev --script 'mklabel msdos'
 # parted $dev --script "mkpart primary 1s $((16 * 2048 - 1))s"

 # parted $dev --script 'unit s' --script 'print'
 Model: Loopback device (loopback)
 Disk /dev/loop0: 32768s
 Sector size (logical/physical): 512B/512B
 Partition Table: msdos
 Disk Flags:

 Number Start End Size Type File system Flags
  1 1s 32767s 32767s primary

 # hexdump -C $dev
 ... <partition table until 0x200 (first sector) > ...
 *
 000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
 00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
 *
 01000000

 # printf '\x00\x00\x00\x00\x00\x00\x34\x34' | hexdump -C
 00000000 00 00 00 00 00 00 34 34 |......44|
 00000008

 # partprobe $dev
 # part=${dev}p1

Step 2)

 # mkfs.ext4 $part

Steps 3 and 4)

 From gdb/source:

 (gdb) ptype/o struct nilfs_super_block
 /* offset | size */ type = struct nilfs_super_block {
 ...
 /* 6 | 2 */ uint16_t s_magic;
 /* 8 | 2 */ uint16_t s_bytes;
 ...

 #define NILFS_SB_MAGIC 0x3434
 #define NILFS_SB_OFFSET 0x400
 #define NILFS_SBB_OFFSET(_sz) ((((_sz) / 0x200) - 8) * 0x200)

 Then (magic is 0x3434, bytes is 0x0401 == 1025 in litte endian -- value targeted at the fix)

 # printf '\x00\x00\x00\x00\x00\x00\x34\x34\x01\x04' | dd of=$part bs=1 count=10 conv=notrunc seek=$(( ( (16 * 2048 - 1) - 8) * 512 ))

 # hexdump -C $part
 00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
 *
 00ffee00 00 00 00 00 00 00 34 34 01 04 00 00 00 00 00 00 |......44........|
 00ffee10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
 *
 00fffe00

Original Package)

 # LIBBLKID_DEBUG=all udevadm test-builtin blkid /sys/block/$(basename $dev)/$(basename $part)
 ...
 9576: libblkid: LOWPROBE: [28] ext4:
 9576: libblkid: LOWPROBE: reuse buffer: off=1024 len=1024 pr=0x55744f2daec0
 9576: libblkid: LOWPROBE: magic sboff=56, kboff=1
 9576: libblkid: LOWPROBE: call probefunc()
 9576: libblkid: LOWPROBE: reuse buffer: off=1024 len=1024 pr=0x55744f2daec0
 9576: libblkid: PROBE: ext2_sb.compat = 0000003C:00000242:0000007B
 9576: libblkid: LOWPROBE: assigning UUID [superblocks]
 9576: libblkid: LOWPROBE: assigning VERSION [superblocks]
 9576: libblkid: LOWPROBE: assigning TYPE [superblocks]
 9576: libblkid: LOWPROBE: assigning USAGE [superblocks]
 9576: libblkid: LOWPROBE: <-- leaving probing loop (type=ext4) [SUBLKS idx=28]
 ...
 9576: libblkid: LOWPROBE: [63] nilfs2:
 9576: libblkid: LOWPROBE: call probefunc()
 9576: libblkid: LOWPROBE: ...

Read more...

Attaching the debdiff with the fix.

This is waiting on validation from the reported user
that the boot problem does not happen anymore -- but
has already been validated on the running system to
produce the correct/expected behavior (UUID / other
values are printed by 'udevadm test-builtin blkdid').

I'll be out the next week, so this should probably
be handled by Guilherme Piccoli during this time.

description: updated
Changed in util-linux (Ubuntu Xenial):
assignee: Mauricio Faria de Oliveira (mfo) → Guilherme G. Piccoli (gpiccoli)

The reporter confirmed the boot problem doesn't happen anymore.
Moving forward with the SRU.

Changed in util-linux (Ubuntu Xenial):
assignee: Guilherme G. Piccoli (gpiccoli) → Mauricio Faria de Oliveira (mfo)
tags: added: sts
Eric Desrochers (slashd) on 2019-09-17
tags: added: sts-sponsor-slashd
Eric Desrochers (slashd) wrote :

@mfo,

Unfortunately the build ftbfs as follow:

https://launchpadlibrarian.net/443016838/buildlog_ubuntu-xenial-amd64.util-linux_2.27.1-6ubuntu3.9_BUILDING.txt.gz
.......
masks:
script: openpty failed: No such file or directory
Makefile:11211: recipe for target 'check-recursive' failed
make[3]: *** [check-recursive] Terminated
debian/rules:177: recipe for target 'override_dh_auto_test' failed
make[1]: *** [override_dh_auto_test] Terminated
debian/rules:54: recipe for target 'build' failed
make: *** [build] Terminated
E: Caught signal ‘Terminated’: terminating immediately
.......

Investigation is going to be needed.

- Eric

Eric Desrochers (slashd) wrote :

Maybe a kernel change between your successful built and my today sponsoring build failure ?

Eric, thanks for reporting that.

I couldn't reproduce the build failure on LXC with apt dist-upgrade on xenial-updates nor xenial-proposed, and it built successfully on PPAs a while ago (for the test packages), so it seems something changed in the PPA builders.

I'll investigate this as per our discussion on IRC, and get back to you.

Thanks,
Mauricio

The problem is reproducible in the sbuild-launchpad-chroot for xenial/amd64,
using the source package for util-linux currently in xenial-updates
(i.e., no regression from debdiff, as expected since changes/error are unrelated)

The minimal command-line for that is:

$ /build/util-linux-kzgHhT/util-linux-2.27.1/script -c echo Hallo World /dev/null </dev/null >/build/util-linux-kzgHhT/util-linux-2.27.1/tests/output/script/buffering-race

script: openpty failed: No such file or directory
Terminated

There was a suspicion about the kernel version difference/regression (4.4.0-159 and -161),
but that's was not the root cause of the issue.

Looking into other areas.

Ah, this is bug 1843674, checking for similar fixes.
(thanks Matthew Ruffell for pointing it out on IRC.)

s/this is bug/this is _similar_ to/

Workaround of disabling the 4 tests in the 'script' component
(which calls openpty() upfront and thus cause the failure)
makes the test-suite finish successfully.

$ ./tests/run.sh \
  --srcdir=/build/util-linux-kzgHhT/util-linux-2.27.1 \
  --builddir=/build/util-linux-kzgHhT/util-linux-2.27.1 \
  --parallel --nonroot --verbose \
  --exclude='script/buffering-race script/options script/race script/replay'

...

"""
  All 166 tests PASSED
"""

Eric Desrochers (slashd) wrote :
tags: added: ftbfs

The real fix for the openpty() problem on Launchpad xenial buildd
is in livecd-rootfs currently in xenial-proposed, and is verified.
(LP 1844504 comment 15)

Once the Launchpad builders are updated with that, we can proceed
with another build attempt, and hopefully move this SRU forward.

Thanks to Colin Watson (cjwatson) for quickly fixing livecd-rootfs.

cheers,
Mauricio

Eric Desrochers (slashd) wrote :

@mfo,

I will gladly resume the sponsoring as soon as LP: #1844504 is "Fix Released" and util-linux builds fine.

Thanks for your good work on this Mauricio !

Eric, thanks! Really appreciate your help debugging this issue.

Per Colin's comment, he mentions on #launchpad-ops (internal)
when there are launchpad chroot changes -- so we can confirm
it's been updated after the package becomes Fix Released.

Eric,

The fix to xenial livecd-rootfs / launchpad buildd chroot has been rolled out.

I just confirmed that /dev/ptmx is OK with a test package build on Launchpad PPA.

  ...
  dh_clean
  # Check /dev/ptmx|pts/
  ls -l /dev/ptmx
  crw-rw-rw- 1 root root 5, 2 Oct 4 08:13 /dev/ptmx
  ls -l /dev/pts/*
  c--------- 1 root root 5, 2 Oct 4 11:25 /dev/pts/ptmx
  make[1]: Leaving directory '/<<BUILDDIR>>/test-pkg-1.0+devpts1'
  ...

Now testing a build of util-linux, and hopefully we can move forward with the SRU again.

cheers,
Mauricio

And this debdiff / util-linux on xenial builds fine again!
Built on all architectures on PPA [1].

cheers,
Mauricio

[1] https://launchpad.net/~mfo/+archive/ubuntu/lp1842437

Eric Desrochers (slashd) wrote :

[STS-Sponsor]

Sponsored in Bionic.

Thanks Mauricio for your great work on this bug and the FTBFS situation.

- Eric

Hello Mauricio, or anyone else affected,

Accepted util-linux into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/util-linux/2.27.1-6ubuntu3.9 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in util-linux (Ubuntu Xenial):
status: In Progress → Fix Committed

All autopkgtests for the newly accepted util-linux (2.27.1-6ubuntu3.9) for xenial have finished running.
The following regressions have been reported in tests triggered by the package:

nplan/0.32~16.04.7 (s390x, armhf)
systemd/229-4ubuntu21.22 (amd64)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/xenial/update_excuses.html#util-linux

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

The reported failures for autopkgtest are unrelated
to this change on the probe of the nilfs filesystem.

Two are apparently failures in handling test reboot,
and another is lack of a kernel module.

I'll ask for retries on these, and do a quick check
on this module error.

Details:
---

nplan:armhf

 autopkgtest [10:35:43]: test process requested reboot with marker config
 Unexpected error:
 ...
 VirtSubproc.Timeout
 autopkgtest [10:37:09]: ERROR: testbed failure: unexpected eof from the testbed

nplan:s390x

 autopkgtest [10:20:42]: test integration.py: [-----------------------
 modprobe: FATAL: Module cfg80211 not found in directory /lib/modules/4.4.0-165-generic
 ...
 subprocess.CalledProcessError: Command '['modprobe', 'cfg80211']' returned non-zero exit status 1
 ...
 integration.py FAIL non-zero exit status 1

systemd:amd64

 sudo: /tmp/autopkgtest-run-wrapper: command not found
 Exit request sent.
 <VirtSubproc>: failure: timed out waiting for testbed to reboot
 autopkgtest [11:39:57]: ERROR: testbed failure: cannot send to testbed: [Errno 32] Broken pipe

No problems with the autopkgtest results for this SRU:

- nplan xenial/s390x [1] is failing since September 1st
- nplan xenial/armhf [2] is failing since May 14th
- systemd xenial/amd [3] passed with a re-run [4] (thanks ddstret)

cheers,
Mauricio

[1] https://autopkgtest.ubuntu.com/packages/nplan/xenial/s390x
[2] https://autopkgtest.ubuntu.com/packages/nplan/xenial/armhf
[3] https://autopkgtest.ubuntu.com/packages/systemd/xenial/amd64
[4] https://objectstorage.prodstack4-5.canonical.com/v1/AUTH_77e2ada1e7a84929a74ba3b87153c0ac/autopkgtest-xenial/xenial/amd64/s/systemd/20191010_142631_c890a@/log.gz

Verification done with xenial-proposed.

# dpkg -s libblkid1 | grep -i version
Version: 2.27.1-6ubuntu3.9

# apt-cache madison libblkid1 | grep xenial-proposed
 libblkid1 | 2.27.1-6ubuntu3.9 | http://archive.ubuntu.com/ubuntu xenial-proposed/main amd64 Packages

Test steps are described in comment #6.

Only one filesystem (ext4) is detected:

# udevadm test-builtin blkid /sys/block/$(basename $dev)/$(basename $part)
...
ID_FS_UUID=aadbf085-7ce7-43e4-a149-ad11d997b710
ID_FS_UUID_ENC=aadbf085-7ce7-43e4-a149-ad11d997b710
ID_FS_VERSION=1.0
ID_FS_TYPE=ext4
ID_FS_USAGE=filesystem
...

# echo $?
0

The verbose log shows nilfs is not detected:

# LIBBLKID_DEBUG=all udevadm test-builtin blkid /sys/block/$(basename $dev)/$(basename $part)
...
2177: libblkid: LOWPROBE: [63] nilfs2:
2177: libblkid: LOWPROBE: call probefunc()
2177: libblkid: LOWPROBE: reuse buffer: off=1024 len=1024 pr=0x5598289abc80
2177: libblkid: LOWPROBE: reuse buffer: off=16772608 len=4096 pr=0x5598289abc80
2177: libblkid: LOWPROBE: [64] exfat:
...

tags: added: verification-done-xenial
Eric Desrochers (slashd) on 2019-10-15
tags: removed: sts-sponsor-slashd

The verification of the Stable Release Update for util-linux has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package util-linux - 2.27.1-6ubuntu3.9

---------------
util-linux (2.27.1-6ubuntu3.9) xenial; urgency=medium

  * d/p/libblkid-nilfs2-add-length-check-before-crc32.patch:
    Fix misdetection/false-positive of nilfs2 filesystem on
    device with magic bytes coincidentally on end of device
    and bad checksum ignored by udev blkid. (LP: #1842437)

 -- Mauricio Faria de Oliveira <email address hidden> Tue, 03 Sep 2019 11:32:50 -0300

Changed in util-linux (Ubuntu Xenial):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers