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.
Cause:
libpcap is unable to open a capture device with small snaplen.
Consequence:
libpcap returns error when trying to open capture device with snaplen less than 13 and it causes tcpdump to exit prematurely.
Fix:
Calculation of frames for memory mapping packet capture mechanism was adjusted in a way that in doesn't truncate packets to smaller values than actual snaplen.
Result:
libpcap doesn't return error when trying to open capture device with small values of snaplen and applications using libpcap are processing packets normally instead of exiting with error.
Descriptionfabrizio.giordano
2011-08-18 16:41:12 UTC
Created attachment 518906[details]
Test Application
Description of problem:
I have Scientific Linux 6.0 on my machine and apparently the version of libpcap that's distributed with it (libpcap-1.0.0-6.20091201git117cb5.el6.x86_64) has a bug when opening a device with a snaplen smaller than 13.
Besides, even if the snaplen is greater or equal to 13, the captured packet size won't match the selected snaplen.
The following message will be displayed when reading from a device that's been opened with a snaplen < 13:
"Error reading the packets: corrupted frame on kernel ring mac offset 70 +
caplen 0 > frame len 64"
Apparently these two bugs have already been fixed in the latest version of libpcap.
I attached a test application to show what I described.
Version-Release number of selected component (if applicable):
libpcap-1.0.0-6.20091201git117cb5.el6.x86_64
How reproducible:
Always
Steps to Reproduce:
1. FIRST_TEST: Open an interface with pcap_open_live setting a snaplen < 13, then read packets.
2. SECOND_TEST: Open an interface with pcap_open_live setting a snaplen >=13, read packets and check that the snaplen is the same as set in pcap_open_live
Actual results:
1. The message "Error reading the packets: corrupted frame on kernel ring mac offset 70 + caplen 0 > frame len 64" will appear
2. The length of the captured packets won't be the same as set in pcap_open_live
Expected results:
1. Read packets normally
2. The length of the packets should match the snaplen set in pcap_open_live
Comment 2RHEL Program Management
2011-08-18 17:08: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.
Hello Fabrizio,
thank you for reporting this issue. I've confirmed that it is actual bug in libpcap but after some further investigation I've found out that there is no straightforward way to backport a patch which solves this issue. There has been just too much development and changes done since version 1.0.0. As you correctly pointed out this issue is now resolved in the latest development version of libpcap. I hope that this issue will be solved in some upcoming major release of Red Hat Enterprise Linux by upgrading to new version of libpcap.
Michal Sekletar
Comment 4fabrizio.giordano
2011-08-24 16:59:30 UTC
This might be fixed in 1.2.0; if not, it's fixed in the top of the 1.2 branch and the trunk, so it'll be fixed in the next release. (The Linux mmapping code gives me a pain where a pill can't reach it; as per my comment in another bug, maybe TPACKET_V3 will be less painful to work with.)
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 9RHEL Program Management
2012-09-07 05:09:06 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 unable to address this
request at this time.
Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
http://rhn.redhat.com/errata/RHBA-2013-1727.html
Created attachment 518906 [details] Test Application Description of problem: I have Scientific Linux 6.0 on my machine and apparently the version of libpcap that's distributed with it (libpcap-1.0.0-6.20091201git117cb5.el6.x86_64) has a bug when opening a device with a snaplen smaller than 13. Besides, even if the snaplen is greater or equal to 13, the captured packet size won't match the selected snaplen. The following message will be displayed when reading from a device that's been opened with a snaplen < 13: "Error reading the packets: corrupted frame on kernel ring mac offset 70 + caplen 0 > frame len 64" Apparently these two bugs have already been fixed in the latest version of libpcap. I attached a test application to show what I described. Version-Release number of selected component (if applicable): libpcap-1.0.0-6.20091201git117cb5.el6.x86_64 How reproducible: Always Steps to Reproduce: 1. FIRST_TEST: Open an interface with pcap_open_live setting a snaplen < 13, then read packets. 2. SECOND_TEST: Open an interface with pcap_open_live setting a snaplen >=13, read packets and check that the snaplen is the same as set in pcap_open_live Actual results: 1. The message "Error reading the packets: corrupted frame on kernel ring mac offset 70 + caplen 0 > frame len 64" will appear 2. The length of the captured packets won't be the same as set in pcap_open_live Expected results: 1. Read packets normally 2. The length of the packets should match the snaplen set in pcap_open_live