Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Cloning from Fedora, because also seen with man-pages-3.22-12.el6.noarch
+++ This bug was initially created as a clone of Bug #683038 +++
Description of problem:
In the getifaddrs(3) manual page, there is an 'EXAMPLE' section which contains code demonstrating how to use the getifaddrs() API. This code is not robust and will crash depending on the host OS network configuration
# gcc -g -o if if.c
# gdb ./if
(gdb) run
Starting program: /home/berrange/if
lo address family: 17 (AF_PACKET)
wlan0 address family: 17 (AF_PACKET)
virbr0 address family: 17 (AF_PACKET)
virbr0-nic address family: 17 (AF_PACKET)
Program received signal SIGSEGV, Segmentation fault.
0x00000000004006f7 in main (argc=1, argv=0x7fffffffe1e8) at if.c:25
25 family = ifa->ifa_addr->sa_family;
(gdb) print ifa->ifa_addr
$1 = (struct sockaddr *) 0x0
(gdb) print *ifa
$2 = {ifa_next = 0x602088, ifa_name = 0x602074 "tun0", ifa_flags = 69841, ifa_addr = 0x0,
ifa_netmask = 0x0, ifa_ifu = {ifu_broadaddr = 0x0, ifu_dstaddr = 0x0}, ifa_data = 0x6027b8}
This bit of the example code:
/* Walk through linked list, maintaining head pointer so we
can free list later */
for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {
family = ifa->ifa_addr->sa_family;
Should be changed to
/* Walk through linked list, maintaining head pointer so we
can free list later */
for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {
family = ifa->ifa_addr ? ifa->ifa_addr->sa_family : AF_UNSPEC;
ie, allow for ifa->ifa_addr being possibly NULL
Version-Release number of selected component (if applicable):
man-pages-3.25-1.fc14.noarch
glibc-2.13-1.x86_64
How reproducible:
Only if 'ifconfig -a' shows an interface with "Link encap:UNSPEC", eg tun0 from a VPNC connection
Steps to Reproduce:
1. Start VPNC client
2. Run getifaddrs() example program
3.
Actual results:
$ ./if
lo address family: 17 (AF_PACKET)
wlan0 address family: 17 (AF_PACKET)
virbr0 address family: 17 (AF_PACKET)
virbr0-nic address family: 17 (AF_PACKET)
Segmentation fault
Expected results:
$ ./if
lo address family: 17 (AF_PACKET)
wlan0 address family: 17 (AF_PACKET)
virbr0 address family: 17 (AF_PACKET)
virbr0-nic address family: 17 (AF_PACKET)
tun0 address family: 0
eth0 address family: 17 (AF_PACKET)
lo address family: 2 (AF_INET)
address: <127.0.0.1>
wlan0 address family: 2 (AF_INET)
address: <192....>
virbr0 address family: 2 (AF_INET)
address: <192.....>
tun0 address family: 2 (AF_INET)
address: <10.....>
lo address family: 10 (AF_INET6)
address: <::1>
wlan0 address family: 10 (AF_INET6)
address: <2a01:....>
wlan0 address family: 10 (AF_INET6)
address: <fe80:....>
Additional info:
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-0679.html