[Bug 1977870] Re: SRU fix for LP#1807628

Kellen Renshaw 1977870 at bugs.launchpad.net
Tue Jul 19 21:37:50 UTC 2022


Was able to successfully reproduce the issue on 3.0.3-0ubuntu1~18.04.2.
Updated the Test Plan with the reproduction commands to verify that the
issue is fixed.

(gdb) bt full
#0  0x00007f162ca854ea in cg_readdir (path=<optimized out>, buf=0x7f1628004740, filler=0x7f162d4b1d00, offset=<optimized out>, 
    fi=<optimized out>) at bindings.c:1800
        d = 0x7f1618001760
        list = 0x0
        i = 0
        ret = <optimized out>
        nextcg = 0x0
        fc = <optimized out>
        clist = 0x0
        __func__ = "cg_readdir"
        initpid = <optimized out>
#1  0x000055a4a90425c3 in ?? ()
No symbol table info available.
#2  0x00007f162d4b7292 in ?? ()
No symbol table info available.
#3  0x00007f1626ffcc00 in ?? ()
No symbol table info available.
#4  0x9cce25ca93392700 in ?? ()
No symbol table info available.
#5  0x00007f161c00a010 in ?? ()
No symbol table info available.
#6  0x9cce25ca93392700 in ?? ()
No symbol table info available.
#7  0x0000000000000000 in ?? ()
No symbol table info available.


[Reproduction]

 * Install lxcfs on an Ubuntu Bionic machine. "sudo apt install lxcfs"
 * Open 3 terminals to the machine, each with a root prompt.
 * Prepare a mount directory in terminal 1:
   mkdir /mnt/lxcfs
 * In terminal 1, execute:
   while true ; do mkdir /sys/fs/cgroup/systemd/test ; rmdir /sys/fs/cgroup/systemd/test ; done
 * In terminal 2, execute:
   lxcfs -p /tmp/lxcfs.pid /mnt/lxcfs
 * In terminal 3, execute:
   while true; do ls /mnt/lxcfs/cgroup/name\=systemd/test > /dev/null ;done
 * Segfault should occur within 1 minute.
 
[Testing of fix]
 Using package from PPA:
 https://launchpad.net/~krenshaw/+archive/ubuntu/lp1977870-lxcfs
 
 Created using debdiff from this bug and uploading the .changes file after debuild -S.
 
 The issue did not recur in several minutes of testing, the unpatched version fails within seconds.

** Description changed:

  [Impact]
  
   * lxcfs on Bionic will segfault if there are no non-directory files in a cgroup. This necessitates restarting running containers.
   * See LP#1807628 (https://bugs.launchpad.net/ubuntu/+source/lxcfs/+bug/1807628) for details on the impact.
-  * Timing of crash seems to indicate that a reload or race happens with logrotate rotating LXD's logfiles.
  
  [Test Plan]
  
-  * Install lxcfs on an Ubuntu Bionic machine. "sudo apt install lxcfs"
-  * Open 3 terminals to the machine, each with a root prompt.
-  * Prepare a mount directory in terminal 1:
-    mkdir /mnt/lxcfs
-  * In terminal 1, execute:
-    while true ; do mkdir /sys/fs/cgroup/systemd/test ; rmdir /sys/fs/cgroup/systemd/test ; done
-  * In terminal 2, execute:
-    lxcfs -p /tmp/lxcfs.pid /mnt/lxcfs
-  * In terminal 3, execute:
-    while true; do ls /mnt/lxcfs/cgroup/name\=systemd/test > /dev/null ;done
-  * Segfault should not occur with patched version.
-  * Need to run "umount /mnt/lxcfs" after segfault to re-run the test.
+  * Install lxd on an Ubuntu Bionic machine. "sudo apt install lxd"
+  * Use the guide at https://linuxcontainers.org/lxd/getting-started-cli/#initial-configuration to create some LXD/lxc containers.
+  * Reproduction is difficult, even on affected systems. A better test plan will be put in place should a reliable or synthetic reproducer be found.
+  * Exercise the logrotate configuration with running containers.
+  * Segfault should not occur.
  
  [Where problems could occur]
  
   * Correcting the null pointer dereference could allow previously
  undetected bugs masked by the segfault to be encountered.
  
  [Other Info]
  
   * Proposed fix is upstream since version 3.0.4 with no negative impacts.
   * Proposed fix is a minimal cherry-pick of the fix, without other functional changes.

** Description changed:

  [Impact]
  
   * lxcfs on Bionic will segfault if there are no non-directory files in a cgroup. This necessitates restarting running containers.
   * See LP#1807628 (https://bugs.launchpad.net/ubuntu/+source/lxcfs/+bug/1807628) for details on the impact.
  
  [Test Plan]
  
-  * Install lxd on an Ubuntu Bionic machine. "sudo apt install lxd"
-  * Use the guide at https://linuxcontainers.org/lxd/getting-started-cli/#initial-configuration to create some LXD/lxc containers.
-  * Reproduction is difficult, even on affected systems. A better test plan will be put in place should a reliable or synthetic reproducer be found.
-  * Exercise the logrotate configuration with running containers.
-  * Segfault should not occur.
+  * Install lxcfs on an Ubuntu Bionic machine. "sudo apt install lxcfs"
+   * Open 3 terminals to the machine, each with a root prompt.
+  * Prepare a mount directory in terminal 1:
+    mkdir /mnt/lxcfs
+  * In terminal 1, execute:
+    while true ; do mkdir /sys/fs/cgroup/systemd/test ; rmdir /sys/fs/cgroup/systemd/test ; done
+  * In terminal 2, execute:
+    lxcfs -p /tmp/lxcfs.pid /mnt/lxcfs
+  * In terminal 3, execute:
+    while true; do ls /mnt/lxcfs/cgroup/name\=systemd/test > /dev/null ;done
+  * Segfault should not occur with patched version.
  
  [Where problems could occur]
  
   * Correcting the null pointer dereference could allow previously
  undetected bugs masked by the segfault to be encountered.
  
  [Other Info]
  
   * Proposed fix is upstream since version 3.0.4 with no negative impacts.
   * Proposed fix is a minimal cherry-pick of the fix, without other functional changes.

-- 
You received this bug notification because you are a member of Ubuntu
Sponsors Team, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/1977870

Title:
  SRU fix for LP#1807628

Status in lxcfs package in Ubuntu:
  New

Bug description:
  [Impact]

   * lxcfs on Bionic will segfault if there are no non-directory files in a cgroup. This necessitates restarting running containers.
   * See LP#1807628 (https://bugs.launchpad.net/ubuntu/+source/lxcfs/+bug/1807628) for details on the impact.

  [Test Plan]

   * Install lxcfs on an Ubuntu Bionic machine. "sudo apt install lxcfs"
    * Open 3 terminals to the machine, each with a root prompt.
   * Prepare a mount directory in terminal 1:
     mkdir /mnt/lxcfs
   * In terminal 1, execute:
     while true ; do mkdir /sys/fs/cgroup/systemd/test ; rmdir /sys/fs/cgroup/systemd/test ; done
   * In terminal 2, execute:
     lxcfs -p /tmp/lxcfs.pid /mnt/lxcfs
   * In terminal 3, execute:
     while true; do ls /mnt/lxcfs/cgroup/name\=systemd/test > /dev/null ;done
   * Segfault should not occur with patched version.

  [Where problems could occur]

   * Correcting the null pointer dereference could allow previously
  undetected bugs masked by the segfault to be encountered.

  [Other Info]

   * Proposed fix is upstream since version 3.0.4 with no negative impacts.
   * Proposed fix is a minimal cherry-pick of the fix, without other functional changes.

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




More information about the Ubuntu-sponsors mailing list