** Description changed:

  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 120 rules but only 51 are unique.
+ After a launch iptables takes into acount 464 rules.
  
- sudo iptables -L | grep 192.168.254.1 | wc -l
- 120
+ sudo iptables -L -n | grep 192.168.254.1 | wc -l
+ 464
  
- sudo iptables -L | grep 192.168.254.1| sort | uniq | wc -l
- 51
- 
- It should be 500 uniques rules but the script stressed a lot my system and 
all rules can't be processed by iptables
- sudo ./test_ufw_threads.py 
+ 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):
+ Anyway, ufw stores only the last updates (in /lib/ufw/user.rules):
  
  sudo ufw status
- État : actif
+ État : actif
  
- Vers                       Action      Depuis
- ----                       ------      ------
- 192.168.254.1 1234/tcp     ALLOW       192.168.49.7
- 192.168.254.1 1234/tcp     ALLOW       192.168.49.6
- 192.168.254.1 1234/tcp     ALLOW       192.168.49.8
- 192.168.254.1 1234/tcp     ALLOW       192.168.49.9
- 192.168.254.1 1234/tcp     ALLOW       192.168.49.10
+ 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 5 rules using ufw.
+ In this case I can only delete 10 rules using ufw.
  Could you please handle some kind of lock?

** Attachment removed: "test concurrent updates"
   
https://bugs.launchpad.net/ufw/+bug/1204579/+attachment/3747866/+files/test_ufw_threads.py

** Attachment added: "test concurrent updates"
   
https://bugs.launchpad.net/ufw/+bug/1204579/+attachment/3756864/+files/test_ufw_threads.py

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

Title:
  ufw doesn't support concurrent updates

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

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to