Bug 470709

Summary: Faulty IP address comparison in acls
Product: [Fedora] Fedora Reporter: JW <ohtmvyyn>
Component: squidAssignee: Jiri Skala <jskala>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 10CC: aglotov, fdc, henrik, jonathansteffan, jskala, mnagy
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-11-18 15:23:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description JW 2008-11-09 07:15:51 UTC
Description of problem:
Squids IP address acl lists use an incorrect btree approach to network/ip matching.

If, for example, one wishes to use 64.4.0.253/255.255.0.255 to match the unusual IP address allocation that Microsoft uses for oe.bayX.hotmail.com, then a btree will not work.  This is because the comparison of IPs a/b and c/d is implemented as "a&d <=> c". It is possible to find an IP range for which both "a&d <=> c" and "c&b <=> a" return the same result (eg -1).

For example, if the following IP's are used in a blacklist:
    64.4.33.7
    64.4.0.253/255.255.0.255
then squid does not detect a conflict.  And there is no apparent conflict or overlap.  However, squid constructs a btree with the 2nd address on the left branch of the 1st address's node (appears sensible because 64.4.0.253 < 64.4.33.7).

Unfortunately when matching an IP such as 64.4.38.253 then the match at the first node will return +1 because 64.4.38.253&255.255.255.255 > 64.4.33.7, so the search incorrectly continues at the (empty) right branch.  If it visited the left branch it would have found that 64.4.38.253&255.255.0.255 == 64.4.0.253.



Version-Release number of selected component (if applicable):
squid-2.6.STABLE16-3.fc8

How reproducible:
Always

Steps to Reproduce:
See above
  
Actual results:
See above

Expected results:
Any valid network mask should be usable, especially as there appears to be an increasing tendency for very large corporations to deliberately choose odd IP address combinations in an effort to frustrate people who legitimately wish to secure their computers.


Additional info:

Comment 1 Bug Zapper 2008-11-26 11:17:27 UTC
This message is a reminder that Fedora 8 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 8.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '8'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 8's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 8 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 2 Henrik Nordström 2008-12-07 22:07:32 UTC
There currently is no plans on fixing this upstream.

Comment 3 François Cami 2009-02-09 07:36:36 UTC
Keeping this one open for tracking, switching priority and severity to low.

Comment 4 Bug Zapper 2009-11-18 12:39:55 UTC
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '10'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 5 Henrik Nordström 2009-11-18 15:23:50 UTC
Support for such "odd IP mask" acls have been removed completely upstream, both because of these iusses and complications when adding IPv6 support.