apport information

** Tags added: apport-collected trusty uec-images

** Description changed:

  #!/bin/bash
  # ---------------------------------------------------------------------
  # This script exhibits a bug in overlayfs in kernel 4.4.
  # The bug is not present in kernel 4.2.
  # The bug can be reproduced in an x86_64 virtual-machine;
  # 32-bit has not been tested.
  #
  # With kernel 4.2, the script output ends with:
  #   "script completed without encountering a kernel bug"
  #
  # With kernel 4.4, the script output ends with:
  #   "rm: cannot remove ‘mnt_ovl/sub/sub.txt’:
  #    Value too large for defined data type"
  #
  # The script depends upon lxc-usernsexec (part of the lxc1 package) to
  # create a user-namespace.
  #
  # The script should be run as a normal user (not root), in a directory where
  # the user has write-permission:
  # ./script
  # --------------------------------------------------------------------
  
  cleanup()
  {
     [[ -d "$storedir" ]] || exit 1
     cd "$storedir"       || exit 1
     [[ -d "$tmpdir"   ]] || exit 1
     lxc-usernsexec -m b:0:1000:1 -m b:100000:100000:1 -- rm -rf "$tmpdir"
  }
  
  trap cleanup EXIT
  
  set -e
  storedir="$(pwd)"
  
  # create tmpdir
  tmpdir="$(mktemp -d --tmpdir=.)"
  
  cd "$tmpdir"
  
  # create lowerdir for overlay
  mkdir -p lower/sub
  touch lower/lower.txt lower/sub/sub.txt
  cd ..
  
  chmod -R a+rwX "$tmpdir"
  
  # run a script in a user namepace
  lxc-usernsexec -m b:0:100000:65534 --  bash << EOF
     set -e
     cd "$tmpdir"
  
     # create tmpfs
     mkdir mnt_tmpfs
     mount -t tmpfs tmpfs mnt_tmpfs
  
     # create upperdir and workdir for overlay
     mkdir mnt_tmpfs/{upper,work}
  
     # mount overlay
     mkdir mnt_ovl
     mount -t overlay \
     -o lowerdir=lower,upperdir=mnt_tmpfs/upper,workdir=mnt_tmpfs/work \
     overlay mnt_ovl
  
     echo 'overlay directory listing'
     ls -RF mnt_ovl
     echo ''
  
     set -x
     rm mnt_ovl/lower.txt                # always succeeds
     rm mnt_ovl/sub/sub.txt              # fails with kernel 4.4+
  
     set +x
     echo 'script completed without encountering a kernel bug'
  
  EOF
+ --- 
+ AlsaDevices:
+  total 0
+  crw-rw---- 1 root audio 116,  1 Aug 26 15:09 seq
+  crw-rw---- 1 root audio 116, 33 Aug 26 15:09 timer
+ AplayDevices: Error: [Errno 2] No such file or directory
+ ApportVersion: 2.14.1-0ubuntu3.21
+ Architecture: amd64
+ ArecordDevices: Error: [Errno 2] No such file or directory
+ AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', 
'/dev/snd/timer'] failed with exit code 1:
+ CRDA: Error: [Errno 2] No such file or directory
+ DistroRelease: Ubuntu 14.04
+ IwConfig: Error: [Errno 2] No such file or directory
+ Lsusb: Error: command ['lsusb'] failed with exit code 1: unable to initialize 
libusb: -99
+ MachineType: QEMU Standard PC (i440FX + PIIX, 1996)
+ Package: linux (not installed)
+ PciMultimedia:
+  
+ ProcEnviron:
+  TERM=vt102
+  PATH=(custom, no user)
+  XDG_RUNTIME_DIR=<set>
+  LANG=en_US.UTF-8
+  SHELL=/bin/bash
+ ProcFB:
+  
+ ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.4.0-34-generic 
root=UUID=78cee363-0cf0-46ce-bd06-d5601344c627 ro console=tty1 console=ttyS0
+ ProcVersionSignature: User Name 4.4.0-34.53~14.04.1-generic 4.4.15
+ RelatedPackageVersions:
+  linux-restricted-modules-4.4.0-34-generic N/A
+  linux-backports-modules-4.4.0-34-generic  N/A
+  linux-firmware                            N/A
+ RfKill: Error: [Errno 2] No such file or directory
+ Tags:  trusty uec-images
+ Uname: Linux 4.4.0-34-generic x86_64
+ UpgradeStatus: No upgrade log present (probably fresh install)
+ UserGroups: adm audio cdrom dialout dip floppy netdev plugdev sudo video
+ _MarkForUpload: True
+ dmi.bios.date: 01/01/2011
+ dmi.bios.vendor: Bochs
+ dmi.bios.version: Bochs
+ dmi.chassis.type: 1
+ dmi.chassis.vendor: Bochs
+ dmi.modalias: 
dmi:bvnBochs:bvrBochs:bd01/01/2011:svnQEMU:pnStandardPC(i440FX+PIIX,1996):pvrpc-i440fx-trusty:cvnBochs:ct1:cvr:
+ dmi.product.name: Standard PC (i440FX + PIIX, 1996)
+ dmi.product.version: pc-i440fx-trusty
+ dmi.sys.vendor: QEMU

** Attachment added: "BootDmesg.txt"
   
https://bugs.launchpad.net/bugs/1617388/+attachment/4728459/+files/BootDmesg.txt

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1617388

Title:
  When using overlayfs with kernel 4.4, some files cannot be deleted.

Status in linux package in Ubuntu:
  Confirmed

Bug description:
  #!/bin/bash
  # ---------------------------------------------------------------------
  # This script exhibits a bug in overlayfs in kernel 4.4.
  # The bug is not present in kernel 4.2.
  # The bug can be reproduced in an x86_64 virtual-machine;
  # 32-bit has not been tested.
  #
  # With kernel 4.2, the script output ends with:
  #   "script completed without encountering a kernel bug"
  #
  # With kernel 4.4, the script output ends with:
  #   "rm: cannot remove ‘mnt_ovl/sub/sub.txt’:
  #    Value too large for defined data type"
  #
  # The script depends upon lxc-usernsexec (part of the lxc1 package) to
  # create a user-namespace.
  #
  # The script should be run as a normal user (not root), in a directory where
  # the user has write-permission:
  # ./script
  # --------------------------------------------------------------------

  cleanup()
  {
     [[ -d "$storedir" ]] || exit 1
     cd "$storedir"       || exit 1
     [[ -d "$tmpdir"   ]] || exit 1
     lxc-usernsexec -m b:0:1000:1 -m b:100000:100000:1 -- rm -rf "$tmpdir"
  }

  trap cleanup EXIT

  set -e
  storedir="$(pwd)"

  # create tmpdir
  tmpdir="$(mktemp -d --tmpdir=.)"

  cd "$tmpdir"

  # create lowerdir for overlay
  mkdir -p lower/sub
  touch lower/lower.txt lower/sub/sub.txt
  cd ..

  chmod -R a+rwX "$tmpdir"

  # run a script in a user namepace
  lxc-usernsexec -m b:0:100000:65534 --  bash << EOF
     set -e
     cd "$tmpdir"

     # create tmpfs
     mkdir mnt_tmpfs
     mount -t tmpfs tmpfs mnt_tmpfs

     # create upperdir and workdir for overlay
     mkdir mnt_tmpfs/{upper,work}

     # mount overlay
     mkdir mnt_ovl
     mount -t overlay \
     -o lowerdir=lower,upperdir=mnt_tmpfs/upper,workdir=mnt_tmpfs/work \
     overlay mnt_ovl

     echo 'overlay directory listing'
     ls -RF mnt_ovl
     echo ''

     set -x
     rm mnt_ovl/lower.txt                # always succeeds
     rm mnt_ovl/sub/sub.txt              # fails with kernel 4.4+

     set +x
     echo 'script completed without encountering a kernel bug'

  EOF

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

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to