ebtables: Lock file handling has races
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ebtables (Debian) |
Fix Released
|
Unknown
|
|||
ebtables (Ubuntu) |
Fix Released
|
Medium
|
Eric Desrochers | ||
Trusty |
Fix Released
|
Medium
|
Eric Desrochers | ||
Xenial |
Fix Released
|
Medium
|
Eric Desrochers | ||
Yakkety |
Fix Released
|
Medium
|
Eric Desrochers | ||
Zesty |
Fix Released
|
Medium
|
Eric Desrochers | ||
Artful |
Fix Released
|
Medium
|
Eric Desrochers |
Bug Description
[Impact]
* ebtables uses creation of a file with an exclusive flag
as a lock to synchronize table modification when used
with --concurrent parameter.
* If ebtables crashes it will leave a stale lock file.
This will prevent another copy of ebtables from running,
and indirectly any other service that depends on ebtables
will also be affected.
* This change adds support for real locks that get
cleaned up if a process exits or crashes.
[Test Case]
* Test Case1:
1. $ sudo touch /var/lib/
2. $ sudo ebtables --concurrent -L
3. ebtables can't acquire a lock
* Test Case 2:
1. $ while true; do /usr/sbin/ebtables --concurrent -L; done
2. hard reboot VM
3. likely that the lock file is present under /var/lib/ebtables
4. libvird hanging, try to connect to qemu:///system
[Regression Potential]
* Normal Use:
There is no regression potential during normal use and
operation of ebtables.
* Package Upgrade:
There is a very very small regression potential during the package
upgrade to the latest version. Once the package is upgraded that
potential is gone. It is a very small potential because several
things have to happen in a very small time frame and in an exact
order since ebtables is not a resident program like a daemon:
1. ebtables is launched during package upgrade AND
2. new ebtables binary has not yet been written to disk AND
3. it is launched with --concurent switch AND
4. another ebtables with new binary is launched AND
5. it is launched with --concurent switch AND
6. the first ebtables copy hasn't exited yet AND
7. both copies of ebtables are launched with a WRITE command AND
8. both copies of ebtables are manipulating the same resource.
Then one of the binaries could potentially fail, but once the old
binary exits the potential is gone so subsequent re-runs of
ebtables will succeed.
* Dragan's patch has been submitted to Debian via :
https:/
* Note that the ebtables upstream project is nearly dead. Nowadays, all the development is now happening in nft project which is intended to be replacement.
[Original Text]
libvirtd is hanging after startup due to ebtables lock file -from an earlier run- remains intact when the system reboots.
Same issue is happening than it is reported here: https:/
After booting the system, It's not possible connect to the qemu-service.
- libvirt daemon tried to obtain a lock:
[pid 20966] read(24, "Trying to obtain lock /var/lib/e"..., 1024) = 45
[pid 20966] poll([{fd=22, events=POLLIN}, {fd=24, events=POLLIN}], 2, 4294967295) = 1 ([{fd=24, revents=POLLIN}])
[pid 20966] read(24, "Trying to obtain lock /var/lib/e"..., 1024) = 45
[pid 20966] poll([{fd=22, events=POLLIN}, {fd=24, events=POLLIN}], 2, 4294967295) = 1 ([{fd=24, revents=POLLIN}])
[pid 20966] read(24, "Trying to obtain lock /var/lib/e"..., 1024) = 45
[pid 20966] poll([{fd=22, events=POLLIN}, {fd=24, events=POLLIN}], 2, 4294967295^CProcess 20916 detached
- there was a file named 'lock' in /var/lib/ebtables directory with timestamp 14:54
- ebtables was configured:
* Ebtables support available, number of installed rules [ OK ]
(other nodes appeared to be in the same state from ebtables point of view, but without the lock file)
- I removed the lock file and libvirt started to work instantly - the lock obtain messages have disappeared from the trace and virsh commands are working
- at 14:54 the host was booting up. According to the logs, there were other reboots after that one, but the lock file remained intact (at least the timestamp was not updated).
Could you please suggest a solution to be sure that ebtables lock file is removed during boot?
affects: | qemu (Ubuntu) → ebtables (Ubuntu) |
information type: | Public → Public Security |
Changed in ebtables (Ubuntu): | |
milestone: | none → trusty-updates |
milestone: | trusty-updates → none |
tags: | added: sts-sponsor |
information type: | Public Security → Public |
Changed in ebtables (Ubuntu): | |
importance: | Undecided → Medium |
Changed in ebtables (Ubuntu Trusty): | |
importance: | Undecided → Medium |
Changed in ebtables (Debian): | |
status: | Unknown → Fix Released |
Changed in ebtables (Ubuntu Trusty): | |
status: | New → Triaged |
status: | Triaged → In Progress |
tags: | removed: sts-sponsor |
description: | updated |
Changed in ebtables (Ubuntu Trusty): | |
assignee: | nobody → Dragan S. (dragan-s) |
status: | Incomplete → In Progress |
tags: | added: sts-sponsor sts-sru |
tags: |
added: sts-sru-needed removed: sts-sru |
tags: | added: sts-sponsor-caribou |
tags: | removed: sts-sponsor sts-sponsor-caribou |
Changed in ebtables (Ubuntu Zesty): | |
assignee: | nobody → Dragan S. (dragan-s) |
Changed in ebtables (Debian): | |
status: | Fix Released → Unknown |
Changed in ebtables (Debian): | |
status: | Unknown → New |
Changed in ebtables (Ubuntu Artful): | |
assignee: | Dragan S. (dragan-s) → nobody |
Changed in ebtables (Ubuntu Artful): | |
assignee: | nobody → Eric Desrochers (slashd) |
status: | Triaged → In Progress |
description: | updated |
Changed in ebtables (Ubuntu Trusty): | |
assignee: | Dragan S. (dragan-s) → Eric Desrochers (slashd) |
Changed in ebtables (Ubuntu Zesty): | |
status: | Triaged → In Progress |
Changed in ebtables (Ubuntu Yakkety): | |
status: | New → In Progress |
Changed in ebtables (Ubuntu Zesty): | |
assignee: | Dragan S. (dragan-s) → Eric Desrochers (slashd) |
Changed in ebtables (Ubuntu Yakkety): | |
assignee: | nobody → Eric Desrochers (slashd) |
importance: | Undecided → Medium |
Changed in ebtables (Ubuntu Xenial): | |
assignee: | nobody → Dragan S. (dragan-s) |
importance: | Undecided → Medium |
tags: |
added: sts-sru-done removed: sts-sru-needed |
Changed in ebtables (Ubuntu Xenial): | |
status: | New → In Progress |
tags: |
added: sts removed: patch |
description: | updated |
Changed in ebtables (Ubuntu Xenial): | |
assignee: | Dragan S. (dragan-s) → Eric Desrochers (slashd) |
tags: |
added: verification-done-trusty verification-done-xenial verification-done-yakkety verification-done-zesty removed: verification-done |
Changed in ebtables (Debian): | |
status: | New → Fix Released |
Created a hotfix ebtables (2.0.10. 4-3ubuntu2~ lp1645324hotfix 3) in the following PPA.
https:/ /launchpad. net/~amad/ +archive/ ubuntu/ ericsson/ +packages
The hotfix is verified by zsolt-babindai (<email address hidden>).
Attaching the patch here to request the start the SRU process.