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.
Bug 810749 - audit allows tcp_max_per_addr + 1 connections
Summary: audit allows tcp_max_per_addr + 1 connections
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: audit
Version: 6.2
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Steve Grubb
QA Contact: Ondrej Moriš
URL:
Whiteboard:
Depends On:
Blocks: 947775 1070830
TreeView+ depends on / blocked
 
Reported: 2012-04-08 22:37 UTC by Ondrej Moriš
Modified: 2014-10-14 07:14 UTC (History)
2 users (show)

Fixed In Version: audit-2.3.7-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-14 07:14:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1515 0 normal SHIPPED_LIVE audit bug fix and enhancement update 2014-10-14 01:22:21 UTC

Description Ondrej Moriš 2012-04-08 22:37:01 UTC
Description of problem:

Auditd option tcp_max_per_addr is given a numeric value representing how many concurrent connections from one IP address is allowed. Thus setting tcp_max_per_addr = 1 should allow exactly one connection per IP address. Checking the number of concurrent connection is done in auditd-listen.c:

static int check_num_connections(struct sockaddr_in *aaddr)
{
        int num = 0;
        struct ev_tcp *client = client_chain;

        while (client) {
                if (memcmp(&aaddr->sin_addr, &client->addr.sin_addr,
                                        sizeof(struct in_addr)) == 0) {
                        num++;
                        if (num > max_per_addr)
                                return 1;
                }
                client = client->next;
        }
        return 0;
}

Suppose there is only a single connection from IP address A, then num = 1 in while-loop and since 1 > 1 is false, function check_num_connections returns 0 and another connection from IP address A is allowed, any further connection from A will be rejected. 

The problem can be easily fixed by changing '>' to '>=' in check_num_connection.

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

audit-2.2-2.el6

How reproducible:

100%

Steps to Reproduce:

1. set tcp_max_per_addr = 1 and tcp_listen_port = 60 in /etc/audit/auditd.conf
2. restart auditd service
3. nc localhost 60 -v &
4. nc localhost 60 -v &
5. nc localhost 60 -v &
6. ausearch -m DAEMON_ACCEPT -ts recent 

Actual results:

----
time->Sun Apr  8 18:35:08 2012
type=DAEMON_ACCEPT msg=audit(1333924508.849:1878): addr=127.0.0.1 port=34345 res=success
----
time->Sun Apr  8 18:35:10 2012
type=DAEMON_ACCEPT msg=audit(1333924510.002:1879): addr=127.0.0.1 port=34346 res=success
----
time->Sun Apr  8 18:35:12 2012
type=DAEMON_ACCEPT msg=audit(1333924512.441:1880): op=dup addr=127.0.0.1 port=34347 res=no

Expected results:

----
time->Sun Apr  8 18:35:08 2012
type=DAEMON_ACCEPT msg=audit(1333924508.849:1878): addr=127.0.0.1 port=34345 res=success
----
time->Sun Apr  8 18:35:10 2012
type=DAEMON_ACCEPT msg=audit(1333924510.002:1879): op=dup addr=127.0.0.1 port=34346 res=no
----
time->Sun Apr  8 18:35:12 2012
type=DAEMON_ACCEPT msg=audit(1333924512.441:1880): op=dup addr=127.0.0.1 port=34347 res=no

Comment 1 Steve Grubb 2012-04-09 15:13:52 UTC
Fixed in upstream commit 692. Thanks.

Comment 3 RHEL Program Management 2012-07-10 05:49:15 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 4 RHEL Program Management 2012-07-10 23:05:00 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 5 RHEL Program Management 2012-09-07 05:13:21 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.

Comment 6 Steve Grubb 2014-06-04 01:58:41 UTC
audit-2.3.7-1.el6 was built to resolve this issue.

Comment 10 errata-xmlrpc 2014-10-14 07:14:03 UTC
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-2014-1515.html


Note You need to log in before you can comment on or make changes to this bug.