Bug 677725

Summary: port allocation/deallocation is wrong [in libnl-1.1-12]
Product: Red Hat Enterprise Linux 6 Reporter: Daniel Berrangé <berrange>
Component: libnlAssignee: Laine Stump <laine>
Status: CLOSED ERRATA QA Contact: desktop-bugs <desktop-bugs>
Severity: urgent Docs Contact:
Priority: high    
Version: 6.1CC: dallan, dcbw, gerhard.stenzel, jens.osterkamp, jjarvis, laine, mhusnain, mjenner, nhorman, stefanb, tpelka, vbenes, veillard
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: libnl-1.1-14.el6 Doc Type: Bug Fix
Doc Text:
The port allocation/de-allocation was not safe in multi-threaded applications and the logic was incorrect, which resulted in some applications and other libraries being unable to initialize libnl. Port allocation/de-allocation and logic is now fixed, and libnl can now be initialized.
Story Points: ---
Clone Of: 677526 Environment:
Last Closed: 2011-05-19 14:29:53 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:
Bug Depends On:    
Bug Blocks: 677729    

Description Daniel Berrangé 2011-02-15 17:02:26 UTC
+++ This bug was initially created as a clone of Bug #677526 +++

Description of problem:

port allocation (socket.c ; line 134):
used_ports_map[i] |= (1UL << n);

- that's going to set a bit

port deallocation (socket.c; line 156) :
used_ports_map[nr / 32] &= ~((nr % 32) + 1);


- that's going to produce garbage [no wonder things don't work]


used_ports_map[nr / 32] &= ~(1 << (nr % 32));

or

used_ports_map[nr / 32] &= ~(1 << (nr & 0x1f));

- would probably be much better 




Version-Release number of selected component (if applicable):

libnl-1.1-12.fc14.x86_64
libnl-debuginfo-1.1-12.fc14.x86_64
libnl-devel-1.1-12.fc14.x86_64

Comment 2 Daniel Berrangé 2011-02-15 17:05:03 UTC
This bug is causing failures in libvirt's VEPA support in some scenarios (see upstream thread http://www.redhat.com/archives/libvir-list/2011-February/msg00466.html)

Comment 3 RHEL Program Management 2011-02-15 17:17:53 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.

Comment 5 Stefan Berger 2011-02-25 00:43:43 UTC
Dear 'Red Hat Product Management', the correct functioning of other components, i.e., those in libvirt, depend on the correct functioning of libnl. So, we would like to propose this request for RHEL 6.1.

Comment 14 Laine Stump 2011-03-28 06:50:51 UTC
A fix for this bug has been applied and is included in libnl-1.1-14.el6:

   https://brewweb.devel.redhat.com/buildinfo?buildID=160656

Comment 17 Laine Stump 2011-04-06 14:50:20 UTC
This error:

  error: internal error failed to get number of interfaces on host (netcf:
  unspecified error - errors in loading some config files)
  error:Failed to list active interfaces

is unrelated to the libnl problems. It is caused by Bug 690286. You will need to install augeas-0.7.2-6.el6 to eliminate that problem.

Comment 19 Misha H. Ali 2011-05-03 01:30:11 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
The port allocation/de-allocation was not safe in multi-threaded applications and the logic was incorrect, which resulted in some applications and other libraries being unable to initialize libnl. Port allocation/de-allocation and logic is now fixed, and libnl can now be initialized.

Comment 20 errata-xmlrpc 2011-05-19 14:29:53 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0795.html