lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 6 Mar 2018 14:07:13 +0000
From:   Joakim Tjernlund <Joakim.Tjernlund@...inera.com>
To:     "lczerner@...hat.com" <lczerner@...hat.com>,
        "kzak@...hat.com" <kzak@...hat.com>
CC:     "linux-ext4@...r.kernel.org" <linux-ext4@...r.kernel.org>,
        "tytso@....edu" <tytso@....edu>,
        "sandeen@...hat.com" <sandeen@...hat.com>
Subject: Re: EXT4-fs (mmcblk0p1): couldn't mount as ext3 due to feature
 incompatibilities

On Tue, 2018-03-06 at 14:38 +0100, Karel Zak wrote:
> CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
> 
> 
> On Tue, Mar 06, 2018 at 02:11:10PM +0100, Lukas Czerner wrote:
> > > > > Seems like it only hits when mounting from fstab, I have
> > > > > 
> > > > > LABEL=BOOT            /boot           auto            noatime         1 2
> > > > > 
> > > > > Anyhow, Eric's patch solved the problem.
> > > > 
> > > > BTW which distro was this happening on?
> > > 
> > > This is on Gentoo
> > > 
> > >  Jocke
> > 
> > It's good that Eric's patch fixes the complainig, however the question
> > is why is it trying the other fs when you have specified auto and blkid
> > is able to recognize it. Weird.
> > 
> > Do you know how the mount is called from your init script ?
> > 
> > Can you reproduce it by running mount -a (probably using a different
> > file system since it's /boot we're talking about here).
> > 
> > If so then please can you use these debug environment variables and show
> > us the output ?
> > 
> > LIBMOUNT_DEBUG=all LIBBLKID_DEBUG=all mount -a
> 
> I guess the problem is "mount -a -t <pattern>", and it's libmount bug.
> 
> The option -t is used in two ways by mount(8), for -a it's pattern
> to filter fstab, and for standard mount operation it FS type.
> 
> Unfortunately the current -a implementation does not zeroize the
> pattern when try to mount the selected FS and "auto" is not translated
> to FS type (because -t <type> is expected).
> 
> And there is fallback code in libmount to use /{proc,etc}/filesystems if FS is
> unknown... in this file ext3 is before ext4. That's the story :-)
> 
> I'll fix it.
> 
> Anyway, it would be nice to have LIBMOUNT_DEBUG=all (or =0xffff for
> old versions) output to be sure it's really the -a issue.
> 
> You can try to reproduce:
> 
>  # echo 'LABEL="TESTBABY" /mnt/test auto noatime 0 0' >> /etc/fstab
>  # mount -av -t nosomething

Not sure I got this right but I umonted /boot and fstab has 
  LABEL=BOOT		/boot		auto		noatime		1 2
did:
export LIBMOUNT_DEBUG=all 
mount -av -t nosomething
2974: libmount:     INIT: library debug mask: 0xffff
2974: libmount:     INIT: library version: 2.26.0
2974: libmount:     INIT:     feature: assert
2974: libmount:     INIT:     feature: debug
Available "LIBMOUNT_DEBUG=<name>[,...]|<mask>" debug masks:
   all      [0xffff] : info about all subsystems
   cache    [0x0004] : paths and tags cache
   cxt      [0x0200] : library context (handler)
   diff     [0x0400] : mountinfo changes tracking
   fs       [0x0040] : FS abstraction
   help     [0x0001] : this help
   locks    [0x0010] : mtab and utab locking
   options  [0x0008] : mount options parsing
   tab      [0x0020] : fstab, mtab, moutninfo routines
   update   [0x0080] : mtab, utab updates
   utils    [0x0100] : misc library utils
   monitor  [0x0800] : mount tables monitor
2974: libmount:      CXT: [0x10021870]: ----> allocate 
2974: libmount:      CXT: [0x10021870]: enabling flag 0010
2974: libmount:      CXT: [0x10021870]: <---- reset [status=0] ---->
2974: libmount:       FS: [0x10021908]: free [refcount=0]
2974: libmount:      TAB: [0x10021908]: alloc
2974: libmount:    CACHE: [0x10021940]: alloc
2974: libmount:      TAB: [0x10021908]: /etc/fstab: start parsing [entries=0, filter=not]
2974: libmount:      TAB: [0x10021908]: add entry: LABEL=BOOT /boot
2974: libmount:      TAB: [0x10021908]: add entry: LABEL=ROOT /
2974: libmount:      TAB: [0x10021908]: add entry: LABEL=SWAP none
2974: libmount:      TAB: [0x10021908]: add entry: none /tmp
2974: libmount:      TAB: [0x10021908]: add entry: none /tftpboot/log
2974: libmount:      TAB: [0x10021908]: add entry: /boot /opt/kernel
2974: libmount:      TAB: [0x10021908]: add entry: LABEL=ROOT /opt/fs
2974: libmount:      TAB: [0x10021908]: add entry: LABEL=ROOT /opt/appl
2974: libmount:      TAB: [0x10021908]: add entry: LABEL=ROOT /opt/boot
2974: libmount:      TAB: [0x10021908]: add entry: LABEL=ROOT /var/log
2974: libmount:      TAB: [0x10021908]: add entry: LABEL=ROOT /btrfs_root
2974: libmount:       FS: [0x100225e8]: free [refcount=0]
2974: libmount:      TAB: [0x10021908]: /etc/fstab: stop parsing (11 entries)
2974: libmount:      TAB: [0x10021908]: parsing done [filename=/etc/fstab, rc=0]
2974: libmount:      CXT: [0x10021870]: next-mount: trying /boot
2974: libmount:      TAB: [0x100219a8]: alloc
2974: libmount:    UTILS: mtab: /etc/mtab
2974: libmount:    UTILS: /etc/mtab: irregular/non-writable
2974: libmount:      TAB: [0x100219a8]: mtab parse: #1 read mountinfo
2974: libmount:      TAB: [0x100219a8]: /proc/self/mountinfo: start parsing [entries=0, filter=not]
2974: libmount:      TAB: [0x100219a8]: add entry: /dev/mmcblk0p3 /
2974: libmount:    CACHE: canonicalize path /proc/self/mountinfo
2974: libmount:      TAB: TID for /proc/self/mountinfo is 2974
2974: libmount:      TAB: [0x100219a8]: add entry: devtmpfs /dev
2974: libmount:      TAB: [0x100219a8]: add entry: proc /proc
2974: libmount:      TAB: [0x100219a8]: add entry: tmpfs /run
2974: libmount:      TAB: [0x100219a8]: add entry: mqueue /dev/mqueue
2974: libmount:      TAB: [0x100219a8]: add entry: devpts /dev/pts
2974: libmount:      TAB: [0x100219a8]: add entry: shm /dev/shm
2974: libmount:      TAB: [0x100219a8]: add entry: sysfs /sys
2974: libmount:      TAB: [0x100219a8]: add entry: debugfs /sys/kernel/debug
2974: libmount:      TAB: [0x100219a8]: add entry: none /tmp
2974: libmount:      TAB: [0x100219a8]: add entry: none /tftpboot/log
2974: libmount:      TAB: [0x100219a8]: add entry: /dev/mmcblk0p1 /opt/kernel
2974: libmount:      TAB: [0x100219a8]: add entry: /dev/mmcblk0p3 /opt/fs
2974: libmount:      TAB: [0x100219a8]: add entry: /dev/mmcblk0p3 /opt/appl
2974: libmount:      TAB: [0x100219a8]: add entry: /dev/mmcblk0p3 /opt/boot
2974: libmount:      TAB: [0x100219a8]: add entry: /dev/mmcblk0p3 /var/log
2974: libmount:      TAB: [0x100219a8]: add entry: /dev/mmcblk0p3 /btrfs_root
2974: libmount:      TAB: [0x100219a8]: add entry: binfmt_misc /proc/sys/fs/binfmt_misc
2974: libmount:      TAB: [0x100219a8]: add entry: /dev/mmcblk0p3 /opt/kernel
2974: libmount:       FS: [0x10024058]: free [refcount=0]
2974: libmount:      TAB: [0x100219a8]: /proc/self/mountinfo: stop parsing (19 entries)
2974: libmount:      TAB: [0x100219a8]: parsing done [filename=/proc/self/mountinfo, rc=0]
2974: libmount:      TAB: [0x100219a8]: mtab parse: #2 read utab
2974: libmount:      CXT: [0x10021870]: mtab requested [nents=19]
2974: libmount:       FS: [0x10021b18]: is FS mounted? [target=/boot]
2974: libmount:      TAB: lookup fs-root for 'LABEL=BOOT'
2974: libmount:      TAB: FS root result: /
2974: libmount:    CACHE: [0x10021940]: add entry [ 1] (tag): /dev/mmcblk0p1: LABEL
2974: libmount:    CACHE: [0x10021940]: canonicalize path /boot
2974: libmount:    CACHE: [0x10021940]: add entry [ 2] (path): /boot: /boot
2974: libmount:      TAB: [0x100219a8]: mnt_table_is_fs_mounted: /dev/mmcblk0p1 [rc=0]
2974: libmount:      CXT: [0x10021870]: mount: preparing
2974: libmount:      CXT: [0x10021870]: use default optsmode
2974: libmount:      CXT: [0x10021870]: OPTSMODE: ignore=0, append=0, prepend=1, replace=0, force=0, fstab=1, mtab=1
2974: libmount:      CXT: [0x10021870]: fstab not required -- skip
2974: libmount:      CXT: [0x10021870]: merging mount flags
2974: libmount:      CXT: [0x10021870]: final flags: VFS=00000400 user=00000000
2974: libmount:      CXT: [0x10021870]: mount: evaluating permissions
2974: libmount:      CXT: [0x10021870]: mount: fixing optstr
2974: libmount:      CXT: [0x10021870]: mount: fixing vfs optstr
2974: libmount:      CXT: applying 0x00001024 flags to 'noatime'
2974: libmount:      CXT: new optstr 'rw,noatime'
2974: libmount:      CXT: [0x10021870]: mount: fixing user optstr
2974: libmount:      CXT: applying 0x00000000 flags to '(null)'
2974: libmount:      CXT: new optstr '(null)'
2974: libmount:      CXT: [0x10021870]: fixed options [rc=0]: vfs: 'rw,noatime' fs: '(null)' user: '(null)', optstr: 'rw,noatime'
2974: libmount:      CXT: [0x10021870]: preparing source path
2974: libmount:      CXT: [0x10021870]: srcpath 'LABEL=BOOT'
2974: libmount:      CXT: [0x10021870]: final srcpath '/dev/mmcblk0p1'
2974: libmount:      CXT: [0x10021870]: preparing target path
2974: libmount:      CXT: [0x10021870]: final target '/boot'
2974: libmount:      CXT: [0x10021870]: preparing fstype
2974: libmount:      CXT: [0x10021870]: FS type: (null) [rc=0]
2974: libmount:      CXT: [0x10021870]: prepare update
2974: libmount:      CXT: [0x10021870]: checking for writable tab files
2974: libmount:    UTILS: mtab: /etc/mtab
2974: libmount:    UTILS: /etc/mtab: irregular/non-writable
2974: libmount:    UTILS: utab: /run/mount/utab
2974: libmount:   UPDATE: [0x10023fe0]: allocate
2974: libmount:   UPDATE: [0x10023fe0]: resetting FS [fs=0x0x10021b18, target=(null), flags=0x00000400]
2974: libmount:   UPDATE: [0x10023fe0]: FS template:
2974: libmount:   UPDATE: ------ fs: 0x10021b18
source: /dev/mmcblk0p1
target: /boot
fstype: (null)
optstr: rw,noatime
VFS-optstr: rw,noatime
freq:   1
pass:   2
2974: libmount:   UPDATE: prepare utab entry
2974: libmount:   UPDATE: utab entry unnecessary (no options)
2974: libmount:      CXT: [0x10021870]: mount: do mount
2974: libmount:      CXT: [0x10021870]: trying to mount by FS pattern 'nosomething'
2974: libmount:    UTILS: reading filesystems list from: /etc/filesystems
2974: libmount:    UTILS: reading filesystems list from: /proc/filesystems
2974: libmount:      CXT: [0x10021870]: /sbin/mount.ext3          ... not found
2974: libmount:      CXT: [0x10021870]: /sbin/fs.d/mount.ext3     ... not found
2974: libmount:      CXT: [0x10021870]: /sbin/fs/mount.ext3       ... not found
2974: libmount:      CXT: [0x10021870]: /usr/sbin/mount.ext3      ... not found
2974: libmount:      CXT: [0x10021870]: /bin/mount.ext3           ... not found
2974: libmount:      CXT: [0x10021870]: /usr/bin/mount.ext3       ... not found
2974: libmount:      CXT: [0x10021870]: mount(2) [source=/dev/mmcblk0p1, target=/boot, type=ext3,  mountflags=0xc0ed8400, mountdata=<none>]
2974: libmount:      CXT: [0x10021870]: mount(2) failed [errno=16 Device or resource busy]
mount: /dev/mmcblk0p1 is already mounted or /boot busy
2974: libmount:      CXT: [0x10021870]: mtab requested [nents=19]
       /dev/mmcblk0p1 is already mounted on /opt/kernel
2974: libmount:      CXT: [0x10021870]: <---- reset [status=0] ---->
2974: libmount:      CXT: [0x10021870]: next-mount: trying /
2974: libmount:      CXT: [0x10021870]: next-mount: not-match [fstype: auto, t-pattern: nosomething, options: noatime, O-pattern: (null)]
/                        : ignored
2974: libmount:      CXT: [0x10021870]: <---- reset [status=0] ---->
2974: libmount:      CXT: [0x10021870]: next-mount: trying none
2974: libmount:      CXT: [0x10021870]: next-mount: not-match [fstype: swap, t-pattern: nosomething, options: sw, O-pattern: (null)]
none                     : ignored
2974: libmount:      CXT: [0x10021870]: <---- reset [status=0] ---->
2974: libmount:      CXT: [0x10021870]: next-mount: trying /tmp
2974: libmount:      CXT: [0x10021870]: mtab requested [nents=19]
2974: libmount:       FS: [0x10021df8]: is FS mounted? [target=/tmp]
2974: libmount:      TAB: lookup fs-root for 'none'
2974: libmount:      TAB: FS root result: /
2974: libmount:      TAB: [0x100219a8]: mnt_table_is_fs_mounted: none [rc=1]
/tmp                     : already mounted
2974: libmount:      CXT: [0x10021870]: <---- reset [status=0] ---->
2974: libmount:      CXT: [0x10021870]: next-mount: trying /tftpboot/log
2974: libmount:      CXT: [0x10021870]: mtab requested [nents=19]
2974: libmount:       FS: [0x10021ec8]: is FS mounted? [target=/tftpboot/log]
2974: libmount:      TAB: lookup fs-root for 'none'
2974: libmount:      TAB: FS root result: /
2974: libmount:    CACHE: [0x10021940]: canonicalize path /tftpboot/log
2974: libmount:    CACHE: [0x10021940]: add entry [ 3] (path): /tftpboot/log: /tftpboot/log
2974: libmount:      TAB: [0x100219a8]: mnt_table_is_fs_mounted: none [rc=1]
/tftpboot/log            : already mounted
2974: libmount:      CXT: [0x10021870]: <---- reset [status=0] ---->
2974: libmount:      CXT: [0x10021870]: next-mount: trying /opt/kernel
2974: libmount:      CXT: [0x10021870]: mtab requested [nents=19]
2974: libmount:       FS: [0x10021fa0]: is FS mounted? [target=/opt/kernel]
2974: libmount:      TAB: lookup fs-root for '/boot'
2974: libmount:      TAB: fs-root for bind
2974: libmount:      TAB: [0x100219a8]: lookup MOUNTPOINT: '/boot'
2974: libmount:      TAB: [0x100219a8]: lookup TARGET: '/boot'
2974: libmount:      TAB: [0x100219a8]: lookup canonical TARGET: '/boot'
2974: libmount:      TAB: [0x100219a8]: lookup TARGET: '/'
2974: libmount:    UTILS: /boot fs-root is /boot
2974: libmount:      TAB: [0x100219a8]: lookup TARGET: '/'
2974: libmount:      TAB: FS root result: /install_root_tst/boot
2974: libmount:      TAB: [0x100219a8]: mnt_table_is_fs_mounted: /dev/mmcblk0p3 [rc=1]
/opt/kernel              : already mounted
2974: libmount:      CXT: [0x10021870]: <---- reset [status=0] ---->
2974: libmount:      CXT: [0x10021870]: next-mount: trying /opt/fs
2974: libmount:      CXT: [0x10021870]: mtab requested [nents=19]
2974: libmount:       FS: [0x10022080]: is FS mounted? [target=/opt/fs]
2974: libmount:      TAB: lookup fs-root for 'LABEL=ROOT'
2974: libmount:      TAB: setting FS root: btrfs subvol
2974: libmount:      TAB: FS root result: /opt_fs
2974: libmount:    CACHE: [0x10021940]: add entry [ 4] (tag): /dev/mmcblk0p3: LABEL
2974: libmount:      TAB: [0x100219a8]: mnt_table_is_fs_mounted: /dev/mmcblk0p3 [rc=1]
/opt/fs                  : already mounted
2974: libmount:      CXT: [0x10021870]: <---- reset [status=0] ---->
2974: libmount:      CXT: [0x10021870]: next-mount: trying /opt/appl
2974: libmount:      CXT: [0x10021870]: mtab requested [nents=19]
2974: libmount:       FS: [0x100221a8]: is FS mounted? [target=/opt/appl]
2974: libmount:      TAB: lookup fs-root for 'LABEL=ROOT'
2974: libmount:      TAB: setting FS root: btrfs subvol
2974: libmount:      TAB: FS root result: /opt_appl
2974: libmount:      TAB: [0x100219a8]: mnt_table_is_fs_mounted: /dev/mmcblk0p3 [rc=1]
/opt/appl                : already mounted
2974: libmount:      CXT: [0x10021870]: <---- reset [status=0] ---->
2974: libmount:      CXT: [0x10021870]: next-mount: trying /opt/boot
2974: libmount:      CXT: [0x10021870]: mtab requested [nents=19]
2974: libmount:       FS: [0x100222c0]: is FS mounted? [target=/opt/boot]
2974: libmount:      TAB: lookup fs-root for 'LABEL=ROOT'
2974: libmount:      TAB: setting FS root: btrfs subvol
2974: libmount:      TAB: FS root result: /opt_boot
2974: libmount:      TAB: [0x100219a8]: mnt_table_is_fs_mounted: /dev/mmcblk0p3 [rc=1]
/opt/boot                : already mounted
2974: libmount:      CXT: [0x10021870]: <---- reset [status=0] ---->
2974: libmount:      CXT: [0x10021870]: next-mount: trying /var/log
2974: libmount:      CXT: [0x10021870]: mtab requested [nents=19]
2974: libmount:       FS: [0x100223d8]: is FS mounted? [target=/var/log]
2974: libmount:      TAB: lookup fs-root for 'LABEL=ROOT'
2974: libmount:      TAB: setting FS root: btrfs subvol
2974: libmount:      TAB: FS root result: /log
2974: libmount:      TAB: [0x100219a8]: mnt_table_is_fs_mounted: /dev/mmcblk0p3 [rc=1]
/var/log                 : already mounted
2974: libmount:      CXT: [0x10021870]: <---- reset [status=0] ---->
2974: libmount:      CXT: [0x10021870]: next-mount: trying /btrfs_root
2974: libmount:      CXT: [0x10021870]: mtab requested [nents=19]
2974: libmount:       FS: [0x100224d8]: is FS mounted? [target=/btrfs_root]
2974: libmount:      TAB: lookup fs-root for 'LABEL=ROOT'
2974: libmount:      TAB: setting FS root: btrfs subvol
2974: libmount:      TAB: FS root result: /
2974: libmount:      TAB: [0x100219a8]: mnt_table_is_fs_mounted: /dev/mmcblk0p3 [rc=1]
/btrfs_root              : already mounted
2974: libmount:      CXT: [0x10021870]: <---- reset [status=0] ---->
2974: libmount:      CXT: [0x10021870]: <---- reset [status=0] ---->
2974: libmount:      TAB: [0x100219a8]: reset
2974: libmount:       FS: [0x100219e0]: free [refcount=0]
2974: libmount:       FS: [0x100227b8]: free [refcount=0]
2974: libmount:       FS: [0x10022950]: free [refcount=0]
2974: libmount:       FS: [0x10022a98]: free [refcount=0]
2974: libmount:       FS: [0x10022ba0]: free [refcount=0]
2974: libmount:       FS: [0x10022ce8]: free [refcount=0]
2974: libmount:       FS: [0x10022e40]: free [refcount=0]
2974: libmount:       FS: [0x10022f88]: free [refcount=0]
2974: libmount:       FS: [0x100230d0]: free [refcount=0]
2974: libmount:       FS: [0x10023220]: free [refcount=0]
2974: libmount:       FS: [0x10023310]: free [refcount=0]
2974: libmount:       FS: [0x10023420]: free [refcount=0]
2974: libmount:       FS: [0x10023548]: free [refcount=0]
2974: libmount:       FS: [0x100236e0]: free [refcount=0]
2974: libmount:       FS: [0x10023880]: free [refcount=0]
2974: libmount:       FS: [0x10023a20]: free [refcount=0]
2974: libmount:       FS: [0x10023bb8]: free [refcount=0]
2974: libmount:       FS: [0x10023d48]: free [refcount=0]
2974: libmount:       FS: [0x10023ea0]: free [refcount=0]
2974: libmount:      TAB: [0x100219a8]: free [refcount=0]
2974: libmount:      TAB: [0x10021908]: reset
2974: libmount:       FS: [0x10021b18]: free [refcount=0]
2974: libmount:       FS: [0x10021bf8]: free [refcount=0]
2974: libmount:       FS: [0x10021cf8]: free [refcount=0]
2974: libmount:       FS: [0x10021df8]: free [refcount=0]
2974: libmount:       FS: [0x10021ec8]: free [refcount=0]
2974: libmount:       FS: [0x10021fa0]: free [refcount=0]
2974: libmount:       FS: [0x10022080]: free [refcount=0]
2974: libmount:       FS: [0x100221a8]: free [refcount=0]
2974: libmount:       FS: [0x100222c0]: free [refcount=0]
2974: libmount:       FS: [0x100223d8]: free [refcount=0]
2974: libmount:       FS: [0x100224d8]: free [refcount=0]
2974: libmount:      TAB: [0x10021908]: free [refcount=0]
2974: libmount:    CACHE: [0x10021940]: free [refcount=0]
2974: libmount:   UPDATE: [0x10023fe0]: free
2974: libmount:      CXT: [0x10021870]: <---- free

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ