Project

General

Profile

Actions

Bug #2653

closed

llc detection failure in configure.ac

Added by Gatewatcher Dev Team over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
low
Difficulty:
low
Label:

Description

Hi,

We believe we discovered a bug in configure.ac, relative to the
detection of the LLC compiler, by the m4 macro AC_PROG_PATH.

In configure.ac, we can read:

AC_PROG_PATH(HAVE_LLC, llc, "yes", "no")

The prototype of AC_PROG_PATH is:

AC_PATH_PROG (variable, prog-to-check-for, [value-if-not-found], [path = ‘$PATH’])

This means that llc is sought in the path no, which is obviously
incorrect.

Thus, the following test should be a "not equal no" instead of a "equal yes"
if test "$HAVE_LLC" = "yes"; then

To reproduce the issue, one need to have CC equal to exactly clang and have
llc not found in path. This would trigger an error during compilation,
because llc would be used while not being findable.

We would also like to emphasize that the LLC detection instruction
sequence is making the assumption that if CC is clang, then LLC could
be llc or llc-<version> but if CC is clang-<version> then LLC
should also be named llc-<version> and not llc. We believe this assumption
to be excessive; for one, in our linux distro, this was not the case;
clang was named clang-version but LLC was named llc. While this is
probably not a desirable behavior of the LLVM package, we would advise
having a more resilient configure.ac script for Suricata.

Cheers,
ArmatureTech Dev Team

Actions #1

Updated by Eric Leblond over 5 years ago

  • Assignee set to Eric Leblond
Actions #2

Updated by Eric Leblond over 5 years ago

hello, could you check this branch: https://github.com/regit/suricata/tree/af-packet-exit-5 ?

The last patch of the branch is a cleaning attempt the llc detection logic.

Actions #3

Updated by Gatewatcher Dev Team over 5 years ago

Hi,

We believe
https://github.com/regit/suricata/commit/d6ec50fbe5441de7eaec8e7f21efe90c4fe2f5b1#diff-67e997bcfdac55191033d57a16d1408aR422
and
https://github.com/regit/suricata/commit/d6ec50fbe5441de7eaec8e7f21efe90c4fe2f5b1#diff-67e997bcfdac55191033d57a16d1408aR430
are also using AC_PROG_PATH incorrectly, with respect to its prototype:
AC_PATH_PROG (variable, prog-to-check-for, [value-if-not-found], [path = ‘$PATH’])

What we believe would be a correct usage would be something like:

AC_PATH_PROG(HAVE_LLC, llc, "no")
if test "$HAVE_LLC" != "no"; then

or

AC_PATH_PROG(HAVE_LLC, "llc-$llc_version", "no")
if test "$HAVE_LLC" != "no"; then

Also, the if clause between 405 and 418 does not contain the same
kind of logic to verify the existence of "llc-$llc_version" that
was implemented between lines 431 and 438, because there is no
AC_PROG_PATH call between lines 411 and 418.

Cheers,
ArmatureTech Dev Team

Actions #4

Updated by Victor Julien over 5 years ago

  • Target version changed from 4.1 to 4.1.1
Actions #5

Updated by Eric Leblond over 5 years ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF