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

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1842437

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/1842437/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to