suricata complains about NFQUEUE in newer kernels

Bug #1250439 reported by Javier Bahillo
50
This bug affects 9 people
Affects Status Importance Assigned to Milestone
suricata (Ubuntu)
Fix Released
Medium
Unassigned
Precise
Fix Released
Medium
Unassigned
Saucy
Fix Released
Medium
Unassigned
Trusty
Fix Released
Medium
Unassigned
Utopic
Won't Fix
Medium
Unassigned
Vivid
Won't Fix
Undecided
Unassigned
Wily
Fix Released
Medium
Unassigned

Bug Description

[Impact]

 * Suricata is not able to start without changes on config files.
    When starting the daemon, it tries to detect NLQUEUE support
    checking existence of wrong procfs file.

 * On precise it is not able to start out-of-the-box after the
    change above. Suricata-debian.yaml points to wrong
    reference.config file.

 * This change fixes LP #1250439.

[Test Case]

 * Steps

    Install "suricata" package with apt-get.
    Set RUN to yes on /etc/default/suricata.
    Make sure nfnetlink_queue and nfnetlink modules are not loaded.
    Try to start suricata service and it will complain about no NFQUEUE.
    Modprobe nfnetlink_queue and try to start suricata again.
    You cannot because file being checked is /proc/net/netfilter/nf_queue.

 * On precise:

    Wrong auto-generated reference on /etc/suricata/suricata-debian.yaml.
    Package silently refuses to start even after fixing service init script.

[Regression Potential]

 * Since this problem exists on upstream and on all Ubuntu versions, it
    is most likely that customers using this package have already fixed
    init script.

 * Since customers tend to write their own suricata rules, it is most
    likely that cutomers have already fixed default rules file.

 * Regression would make suricata daemon not to start (just like now).

[Other Info]

Suricata in newer kernels (3.5 and upper) will complain like this:

 * NFQUEUE support not found !
 * Please ensure the nfnetlink_queue module is loaded or built in kernel

although nfnetlink_queue is loaded:

lsmod | grep nfnetlink_queue
nfnetlink_queue 17557 3
nfnetlink 13983 5 nf_conntrack_netlink,nfnetlink_queue

This happens because /etc/init.d/suricata does this check:

check_nfqueue() {
if [ ! -e /proc/net/netfilter/nf_queue ]; then
    log_failure_msg "NFQUEUE support not found !"
    log_failure_msg "Please ensure the nfnetlink_queue module is loaded or built in kernel"
    exit 5
fi
}

Nevertheless this only works in pre3.5 kernels as newer kernels have supressed ip_queue , in benefit of libnetfilter_queue.

Thus the script should check that nor /proc/net/netfilter/nf_queue nor /proc/net/netfilter/nfnetlink_queue existed.

Revision history for this message
Javier Bahillo (jbahillo) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "suricata.init.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in suricata (Ubuntu):
status: New → Confirmed
Changed in suricata (Ubuntu):
status: Confirmed → In Progress
assignee: nobody → Rafael David Tinoco (inaddy)
Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

Fix seems ok since this type of detection is being used on similar projects.

1) Proposed patch for Debian sid:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=725301

2) Proposed patch merge for Ubuntu development on:

https://code.launchpad.net/~inaddy/ubuntu/trusty/suricata/lp-1250439/+merge/216963

3) Created one diff for precise, with a minor correction on default init configuration file (reference.config).
* fix-precise-suricata_1.1.1-1.diff

4) Created one diff for saucy equal to upstream patch proposal.
* fix-saucy-suricata_1.4.3-1.diff

5) Created one diff for trusty equal to upstream patch proposal.
* fix-trusty-suricata_1.4.7-1

Packages have been tested and daemon can init out-of-the-box on all versions.
(remembering to set RUN=yes on /etc/default/suricata)

Attaching diffs on next comments...

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

* fix-precise-suricata_1.1.1-1.diff

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

* fix-saucy-suricata_1.4.3-1.diff

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

* fix-trusty-suricata_1.4.7-1

Chris J Arges (arges)
Changed in suricata (Ubuntu Trusty):
assignee: nobody → Rafael David Tinoco (inaddy)
Changed in suricata (Ubuntu Saucy):
assignee: nobody → Rafael David Tinoco (inaddy)
Changed in suricata (Ubuntu Precise):
assignee: nobody → Rafael David Tinoco (inaddy)
Changed in suricata (Ubuntu Trusty):
status: New → In Progress
Changed in suricata (Ubuntu Saucy):
status: New → In Progress
Changed in suricata (Ubuntu Precise):
status: New → In Progress
importance: Undecided → Medium
Changed in suricata (Ubuntu Trusty):
importance: Undecided → Medium
Changed in suricata (Ubuntu Saucy):
importance: Undecided → Medium
Changed in suricata (Ubuntu Utopic):
importance: Undecided → Medium
description: updated
description: updated
description: updated
Revision history for this message
Chris J Arges (arges) wrote :

Uploaded for P/S/T. I'd like to see this fixed in Sid, then we can sync for U.

Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Javier, or anyone else affected,

Accepted suricata into trusty-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/suricata/1.4.7-1ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in suricata (Ubuntu Trusty):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Javier, or anyone else affected,

Accepted suricata into saucy-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/suricata/1.4.3-1ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in suricata (Ubuntu Saucy):
status: In Progress → Fix Committed
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Javier, or anyone else affected,

Accepted suricata into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/suricata/1.1.1-1ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in suricata (Ubuntu Precise):
status: In Progress → Fix Committed
Revision history for this message
Javier Bahillo (jbahillo) wrote :

I have tested this package on precise and saucy , and it solves the issue (suricata will start as long as you have the needed kernel module loaded)

tags: added: verification-done-precise verification-done-saucy
Revision history for this message
Brian Murray (brian-murray) wrote :

I'd like to see this also verified in Trusty, rather than have the possibility of users upgrading and encountering a regression.

Revision history for this message
Javier Bahillo (jbahillo) wrote :

Tested ok on 14.04 (trusty)

tags: added: verification-done
removed: verification-done-precise verification-done-saucy verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package suricata - 1.4.7-1ubuntu1

---------------
suricata (1.4.7-1ubuntu1) trusty; urgency=low

  * Fixed init script nfnetlink_queue detection for newer kernels. (LP: #1250439)
 -- Rafael David Tinoco <email address hidden> Thu, 24 Apr 2014 09:45:07 -0500

Changed in suricata (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Scott Kitterman (kitterman) wrote : Update Released

The verification of the Stable Release Update for suricata has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package suricata - 1.4.3-1ubuntu1

---------------
suricata (1.4.3-1ubuntu1) saucy; urgency=low

  * Fixed init script nfnetlink_queue detection for newer kernels. (LP: #1250439)
 -- Rafael David Tinoco <email address hidden> Thu, 24 Apr 2014 10:56:19 -0500

Changed in suricata (Ubuntu Saucy):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package suricata - 1.1.1-1ubuntu1

---------------
suricata (1.1.1-1ubuntu1) precise; urgency=medium

  * Fixed init script nfnetlink_queue detection for newer kernels. (LP: #1250439)
  * Fixed reference-config-file so daemon can start out-of-the-box.
 -- Rafael David Tinoco <email address hidden> Thu, 24 Apr 2014 11:00:20 -0500

Changed in suricata (Ubuntu Precise):
status: Fix Committed → Fix Released
Changed in suricata (Ubuntu):
assignee: Rafael David Tinoco (inaddy) → nobody
Changed in suricata (Ubuntu Precise):
assignee: Rafael David Tinoco (inaddy) → nobody
Changed in suricata (Ubuntu Saucy):
assignee: Rafael David Tinoco (inaddy) → nobody
Changed in suricata (Ubuntu Trusty):
assignee: Rafael David Tinoco (inaddy) → nobody
Changed in suricata (Ubuntu Utopic):
assignee: Rafael David Tinoco (inaddy) → nobody
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

This issue still affects 14.10 and 15.04. 15.10 was fixed in Debian.

Changed in suricata (Ubuntu Vivid):
status: New → Triaged
Changed in suricata (Ubuntu Wily):
status: In Progress → Fix Released
Changed in suricata (Ubuntu Utopic):
status: In Progress → Triaged
Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

Unfortunately Utopic is already EOL and Vivid will be EOL tomorrow, not enough time for a SRU.

Louis Bouchard (louis)
Changed in suricata (Ubuntu Utopic):
status: Triaged → Won't Fix
Changed in suricata (Ubuntu Vivid):
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.