Hello Jeremy, or anyone else affected,

Accepted ufw into cosmic-proposed. The package will build now and be
available at
https://launchpad.net/ubuntu/+source/ufw/0.36-0ubuntu0.18.10.1 in a few
hours, and then in the -proposed repository.

Please help us by testing this new package.  See
https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how
to enable and use -proposed.  Your feedback will aid us getting this
update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug,
mentioning the version of the package you tested and change the tag from
verification-needed-cosmic to verification-done-cosmic. If it does not
fix the bug for you, please add a comment stating that, and change the
tag to verification-failed-cosmic. In either case, without details of
your testing we will not be able to proceed.

Further information regarding the verification process can be found at
https://wiki.ubuntu.com/QATeam/PerformingSRUVerification .  Thank you in
advance for helping!

N.B. The updated package will be released to -updates after the bug(s)
fixed by this package have been verified and the package has been in
-proposed for a minimum of 7 days.

** Changed in: ufw (Ubuntu Cosmic)
       Status: In Progress => Fix Committed

** Tags added: verification-needed verification-needed-cosmic

** Changed in: ufw (Ubuntu Bionic)
       Status: In Progress => Fix Committed

** Tags added: verification-needed-bionic

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to ufw in Ubuntu.
https://bugs.launchpad.net/bugs/1204579

Title:
  ufw doesn't support concurrent updates

Status in ufw:
  Fix Released
Status in ufw package in Ubuntu:
  Fix Released
Status in ufw source package in Bionic:
  Fix Committed
Status in ufw source package in Cosmic:
  Fix Committed
Status in ufw source package in Disco:
  Fix Released
Status in ufw package in Debian:
  Fix Released

Bug description:
  [Impact]

  ufw prior to 0.36 did not support locking or use xtables locking which
  can lead to problems when using ufw as a dynamic firewall.

  [Test Case]

  $ sudo apt-get install python-minimal # for the test script
  $ sudo ./test_ufw_threads.py # this runs for many seconds

  A patched ufw will complete with no errors. With an unpatched ufw, there will 
be many errors like:
  $ sudo ./test_ufw_threads.py
  ...
  ERROR: initcaps
  [Errno 2] iptables: Chain already exists.

  ERROR: initcaps
  [Errno 2] iptables: Chain already exists.

  [Regression Potential]

  ufw 0.36 implements a global exclusive lock before doing any kernel or
  file writes. Risk of regression includes the lock file not being
  released due to coding error. The locking is done via fcntl.lockf and
  ufw releases it in a finally clause that is careful to always release
  it.

  [Other Info]

  This locking code has been in production in the ufw snap for years and
  is known to work is static environments as well as in dynamic
  environments (IPS/fail2ban/etc).

  
  = Original description =

  On a server under Ubuntu 12.04 I automatically update firewall rules and I 
unfortunately noticed that if 2 rules are processed at the same time it leads 
to an inconsistent result between iptables and ufw status.
  In fact it can be reproduced using the python script in attachment.

  Before executing this script I didn't have any rules matching the ip 
192.168.254.1 on my computer.
  After a launch iptables takes into acount 464 rules.

  sudo iptables -L -n | grep 192.168.254.1 | wc -l
  464

  It should be 500 rules but the script stressed a lot my system and all rules 
can't be processed by iptables
  sudo ./test_ufw_threads.py
  iptables: Resource temporarily unavailable.

  iptables: Resource temporarily unavailable.

  iptables: Resource temporarily unavailable.
  [...]

  Anyway, ufw stores only the last updates (in /lib/ufw/user.rules):

  sudo ufw status
  √Čtat : actif

  Vers Action Depuis
  ---- ------ ------
  192.168.254.1 1234/tcp     ALLOW       192.168.46.9
  192.168.254.1 1234/tcp     ALLOW       192.168.22.10
  192.168.254.1 1234/tcp     ALLOW       192.168.32.10
  192.168.254.1 1234/tcp     ALLOW       192.168.5.10
  192.168.254.1 1234/tcp     ALLOW       192.168.43.9
  192.168.254.1 1234/tcp     ALLOW       192.168.40.10
  192.168.254.1 1234/tcp     ALLOW       192.168.46.10
  192.168.254.1 1234/tcp     ALLOW       192.168.48.10
  192.168.254.1 1234/tcp     ALLOW       192.168.42.10
  192.168.254.1 1234/tcp     ALLOW       192.168.43.10

  So I can't delete other rules using ufw, I had to directly use iptables.
  In this case I can only delete 10 rules using ufw.
  Could you please handle some kind of lock?

To manage notifications about this bug go to:
https://bugs.launchpad.net/ufw/+bug/1204579/+subscriptions

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

Reply via email to