[Parted-maintainers] Bug#995682: segfaults / fails to find filesystem, when passed full disk

Trent W. Buck trentbuck at gmail.com
Mon Oct 4 03:58:35 BST 2021


Package: fatresize
Version: 1.1.0-1
Severity: normal
File: /sbin/fatresize

This script reliably produces segfaults on Debian 11.
It works fine on Debian 10.




-- System Information:
Debian Release: 11.0
  APT prefers stable-updates
  APT policy: (990, 'stable-updates'), (990, 'stable-security'), (990, 'stable'), (500, 'proposed-updates'), (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-8-amd64 (SMP w/8 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
-------------- next part --------------
#!/bin/sh -ex
wget -nv 'https://www.freedos.org/download/download/FD12LITE.zip'
unzip FD12LITE.zip
/sbin/parted FD12LITE.img print
truncate --size=64M FD12LITE.img
/usr/sbin/fatresize --info     FD12LITE.img || :
/usr/sbin/fatresize --size=max FD12LITE.img || :
/usr/sbin/fatresize --size=64M FD12LITE.img || :
/sbin/parted FD12LITE.img print
coredumpctl info
-------------- next part --------------
bash5$ with-temp-dir
with-temp-dir: entering directory `/tmp/with-temp-dir.HWnWLv'
This directory will be deleted when you exit.
bash5$ ~/Desktop/kb/fatresize-problem.sh
+ wget -nv https://www.freedos.org/download/download/FD12LITE.zip
2021-10-04 13:49:46 URL:http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/FD12LITE.zip [30493975/30493975] -> "FD12LITE.zip" [1]
+ unzip FD12LITE.zip
Archive:  FD12LITE.zip
  inflating: FD12LITE.img            
  inflating: FD12LITE.vmdk           
  inflating: README.md               
+ /sbin/parted FD12LITE.img print
WARNING: You are not superuser.  Watch out for permissions.
Model:  (file)
Disk /tmp/with-temp-dir.HWnWLv/FD12LITE.img: 32.5MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      32.3kB  32.4MB  32.4MB  primary  fat16        boot

+ truncate --size=64M FD12LITE.img
+ /usr/sbin/fatresize --info FD12LITE.img
fatresize 1.1.0 (20201114)
part(start=0, end=131071, length=131072)
Error: Could not detect file system.
+ :
+ /usr/sbin/fatresize --size=max FD12LITE.img
fatresize 1.1.0 (20201114)
part(start=0, end=131071, length=131072)
Error: Could not detect file system.
+ :
+ /usr/sbin/fatresize --size=64M FD12LITE.img
fatresize 1.1.0 (20201114)
part(start=0, end=131071, length=131072)
Segmentation fault (core dumped)
+ :
+ /sbin/parted FD12LITE.img print
WARNING: You are not superuser.  Watch out for permissions.
Model:  (file)
Disk /tmp/with-temp-dir.HWnWLv/FD12LITE.img: 67.1MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      32.3kB  32.4MB  32.4MB  primary  fat16        boot

+ coredumpctl info
           PID: 3878651 (fatresize)
           UID: 1000 (twb)
           GID: 1000 (twb)
        Signal: 11 (SEGV)
     Timestamp: Mon 2021-10-04 13:49:46 AEDT (820ms ago)
  Command Line: /usr/sbin/fatresize --size=64M FD12LITE.img
    Executable: /usr/sbin/fatresize
 Control Group: /user.slice/user-1000.slice/user at 1000.service/app.slice/app-org.gnome.Terminal.slice/vte-spawn-decd9040-9743-4d37-8dc7-24ab214ad59f.scope
          Unit: user at 1000.service
     User Unit: vte-spawn-decd9040-9743-4d37-8dc7-24ab214ad59f.scope
         Slice: user-1000.slice
     Owner UID: 1000 (twb)
       Boot ID: a604735c949746bcb36ab91b0fca536f
    Machine ID: 029d2e3fb4ee4d5eaa67c315db3ba66d
      Hostname: hera
       Storage: /var/lib/systemd/coredump/core.fatresize.1000.a604735c949746bcb36ab91b0fca536f.3878651.1633315786000000.zst
       Message: Process 3878651 (fatresize) of user 1000 dumped core.
                
                Stack trace of thread 3878651:
                #0  0x00007fc81eb9d419 ped_disk_get_partition_by_sector (libparted.so.2 + 0x13419)
                #1  0x000055ce2c7a9c8a n/a (fatresize + 0x2c8a)
                #2  0x00007fc81e9ece4a __libc_start_main (libc.so.6 + 0x27e4a)
                #3  0x000055ce2c7aa15a n/a (fatresize + 0x315a)
-------------- next part --------------
bash5$ mmdebstrap  --aptopt='Acquire::http::Proxy "http://odin:3142"' --dpkgopt=force-unsafe-io --variant=apt buster /dev/null --include=parted,fatresize,wget,ca-certificates,unzip --customize-hook='copy-in fatresize-problem.sh /' --customize-hook='chroot $1 ./fatresize-problem.sh'
I: automatically chosen mode: unshare
I: chroot architecture amd64 is equal to the host's architecture
I: automatically chosen format: tar
I: using /tmp/mmdebstrap.toKs23Dbpl as tempdir
I: running apt-get update...
done
I: downloading packages with apt...
done
I: extracting archives...
done
I: installing essential packages...
done
I: installing remaining packages inside the chroot...
done
done
done
I: running special hook: copy-in fatresize-problem.sh /
I: running --customize-hook in shell: sh -c 'chroot $1 ./fatresize-problem.sh' exec /tmp/mmdebstrap.toKs23Dbpl
+ wget -nv https://www.freedos.org/download/download/FD12LITE.zip
2021-10-04 02:57:14 URL:http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/FD12LITE.zip [30493975/30493975] -> "FD12LITE.zip" [1]
+ unzip FD12LITE.zip
Archive:  FD12LITE.zip
  inflating: FD12LITE.img            
  inflating: FD12LITE.vmdk           
  inflating: README.md               
+ /sbin/parted FD12LITE.img print
/sys/firmware/dmi/tables/smbios_entry_point: Permission denied
/dev/mem: No such file or directory
Model:  (file)
Disk /FD12LITE.img: 32.5MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      32.3kB  32.4MB  32.4MB  primary  fat16        boot

+ truncate --size=64M FD12LITE.img
+ /usr/sbin/fatresize --info FD12LITE.img
/sys/firmware/dmi/tables/smbios_entry_point: Permission denied
/dev/mem: No such file or directory
fatresize 1.0.2 (06/16/18)
FAT: fat16
Size: 32417280
Min size: 32450048
Max size: 67108864
+ /usr/sbin/fatresize --size=max FD12LITE.img
/sys/firmware/dmi/tables/smbios_entry_point: Permission denied
/dev/mem: No such file or directory
Illegal new volume size
Usage: fatresize [options] device (e.g. /dev/hda1, /dev/sda2)
    Resize an FAT16/FAT32 volume non-destructively:

    -s, --size SIZE    Resize volume to SIZE[k|M|G|ki|Mi|Gi] bytes
    -i, --info         Show volume information
    -p, --progress     Show progress
    -q, --quite        Be quite
    -v, --verbose      Verbose
    -h, --help         Display this help

Please report bugs to mouse at altlinux.org
+ :
+ /usr/sbin/fatresize --size=64M FD12LITE.img
/sys/firmware/dmi/tables/smbios_entry_point: Permission denied
/dev/mem: No such file or directory
fatresize 1.0.2 (06/16/18)
sh: 1: udevadm: not found
sh: 1: udevadm: not found
+ /sbin/parted FD12LITE.img print
/sys/firmware/dmi/tables/smbios_entry_point: Permission denied
/dev/mem: No such file or directory
Model:  (file)
Disk /FD12LITE.img: 67.1MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      32.3kB  64.0MB  64.0MB  primary  fat16        boot

+ coredumpctl info
./fatresize-problem.sh: 10: ./fatresize-problem.sh: coredumpctl: not found
E: run_chroot failed: E: command failed: chroot $1 ./fatresize-problem.sh
W: listening on child socket failed: 
I: removing tempdir /tmp/mmdebstrap.toKs23Dbpl...


More information about the Parted-maintainers mailing list