← Back to team overview

group.of.nepali.translators team mailing list archive

[Bug 1795764] Re: systemd: core: Fix edge case when processing /proc/self/mountinfo

 

We cannot cherrypick the fix as is. It has been introduced upstream[1]
inside a function and structure that not yet exist in 229[1].

Instead of backporting the whole thing (which seems unnecessary) we can
possibly mimic the upstream fix.

Basically, the upstream fix adds a "|| MOUNT(u)->just_mounted;" where
just_mounted is a boolean. A boolean only has two possible values
("true" and "false").

Definition of "just_mounted" : 
# src/core/mount.h 
bool just_mounted:1; 

Full upstream code line : 
flags->just_mounted = !MOUNT(u)->from_proc_self_mountinfo || MOUNT(u)->just_mounted; 


The current 229 (xenial code) is as follow : 
MOUNT(u)->just_mounted = !MOUNT(u)->from_proc_self_mountinfo; 

Considering the boolean explain above, If we add "|| true;" it should
suffice.

Full systemd xenial code line (theory): 
MOUNT(u)->just_mounted = !MOUNT(u)->from_proc_self_mountinfo || true ; 

A colleague of mine and myself have separately tested my theory in my PPA that I have built, and so far it seems to work fine : 
$ mount --bind bind-test bind-test 
$ mount -t tmpfs tmpfs bind-test/abc 
$ umount bind-test/abc 
$ systemctl list-unites --all | grep bind-test 
home-ubuntu-bind/x2dtest.mount loaded active mounted /home/ubuntu/bind-test 

Could you please give the test package a try to make sure you arrive at the same result as us ? 
$ sudo add-apt-repository ppa:slashd/case199975 
$ sudo apt-get update 
$ sudo apt-get install systemd 

Please allow a few hours for the package to build again.

Eric

[1] git describe --contains 65d36b495 
v237~140

** Tags added: sts

** Also affects: systemd (Ubuntu Xenial)
   Importance: Undecided
       Status: New

** Changed in: systemd (Ubuntu Xenial)
       Status: New => Confirmed

** Description changed:

  From the PR:
  Currently, if there are two /proc/self/mountinfo entries with the same
  mount point path, the mount setup flags computed for the second of
  these two entries will overwrite the mount setup flags computed for
  the first of these two entries. This is the root cause of issue #7798.
  This patch changes mount_setup_existing_unit to prevent the
  just_mounted mount setup flag from being overwritten if it is set to
  true. This will allow all mount units created from /proc/self/mountinfo
  entries to be initialized properly.
  
  One line fix in https://github.com/systemd/systemd/pull/7811/files
  
  Referenced issue: https://github.com/systemd/systemd/issues/7798
  
  Related kubernetes issue:
  https://github.com/kubernetes/kubernetes/issues/57345
  
  systemd v237 has this fix, but we'd like to have it fixed in 16.04.
+ 
+ [Other Informations]
+ 
+ It only affect systemd for Xenial, later release already has the fix:
+ 
+ $ git describe --contains 65d36b495
+ v237~140
+ 
+ ==>  systemd | 229-4ubuntu21.4  | xenial-updates          
+      systemd | 237-3ubuntu10.3  | bionic-updates  
+      systemd | 239-7ubuntu9     | cosmic

** Changed in: systemd (Ubuntu)
       Status: Confirmed => Fix Released

** Changed in: systemd (Ubuntu Xenial)
   Importance: Undecided => Medium

-- 
You received this bug notification because you are a member of नेपाली
भाषा समायोजकहरुको समूह, which is subscribed to Xenial.
Matching subscriptions: Ubuntu 16.04 Bugs
https://bugs.launchpad.net/bugs/1795764

Title:
  systemd: core: Fix edge case when processing /proc/self/mountinfo

Status in systemd package in Ubuntu:
  Fix Released
Status in systemd source package in Xenial:
  Confirmed

Bug description:
  From the PR:
  Currently, if there are two /proc/self/mountinfo entries with the same
  mount point path, the mount setup flags computed for the second of
  these two entries will overwrite the mount setup flags computed for
  the first of these two entries. This is the root cause of issue #7798.
  This patch changes mount_setup_existing_unit to prevent the
  just_mounted mount setup flag from being overwritten if it is set to
  true. This will allow all mount units created from /proc/self/mountinfo
  entries to be initialized properly.

  One line fix in https://github.com/systemd/systemd/pull/7811/files

  Referenced issue: https://github.com/systemd/systemd/issues/7798

  Related kubernetes issue:
  https://github.com/kubernetes/kubernetes/issues/57345

  systemd v237 has this fix, but we'd like to have it fixed in 16.04.

  [Other Informations]

  It only affect systemd for Xenial, later release already has the fix:

  $ git describe --contains 65d36b495
  v237~140

  ==>  systemd | 229-4ubuntu21.4  | xenial-updates          
       systemd | 237-3ubuntu10.3  | bionic-updates  
       systemd | 239-7ubuntu9     | cosmic

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