apparmor/libraries/libapparmor
Georgia Garcia add2ffe710 libapparmor: make af_protos.h consistent in different archs
af_protos.h is a generated table of the protocols created by looking
for definitions of IPPROTO_* in netinet/in.h. Depending on the
architecture, the order of the table may change when using -dM in the
compiler during the extraction of the defines.

This causes an issue because there is more than one IPPROTO defined
by the value 0: IPPROTO_IP and IPPROTO_HOPOPTS which is a header
extension used by IPv6. So if IPPROTO_HOPOPTS was first in the table,
then protocol=0 in the audit logs would be translated to hopopts.

This caused a failure in arm 32bit:

Output doesn't match expected data:
--- ./test_multi/testcase_unix_01.out	2024-08-15 01:47:53.000000000 +0000
+++ ./test_multi/out/testcase_unix_01.out	2024-08-15 23:42:10.187416392 +0000
@@ -12,7 +12,7 @@
 Peer Addr: @test_abstract_socket
 Network family: unix
 Socket type: stream
-Protocol: ip
+Protocol: hopopts
 Class: net
 Epoch: 1711454639
 Audit subid: 322

By the time protocol is resolved in grammar.y, we don't have have
access to the net family to check if it's inet6. Instead of making
protocol dependent on the net family, make the order of the
af_protos.h table consistent between architectures using -dD.

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
(cherry picked from commit 95c419dc45)
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2024-08-26 09:41:33 -03:00
..
doc Merge doc(fix): Fix wrong syntax for profile stacking 2024-01-30 09:45:36 +00:00
include Merge aa-load 2023-06-29 21:24:25 +00:00
m4 replace deprecated distutils with setuptools 2021-11-11 20:23:35 -03:00
src libapparmor: make af_protos.h consistent in different archs 2024-08-26 09:41:33 -03:00
swig Fix SWIG prototype declaration of aa_getpeercon_raw 2024-08-06 17:26:23 -03:00
testsuite Partial revert of "libapparmor: add log parser support for saddr, daddr, src and dest" 2024-06-04 18:36:14 -03:00
AUTHORS libraries/libapparmor/: more license cleanups, adjust my email address 2011-02-23 14:02:45 -08:00
autogen.sh libapparmor: Force libtoolize to replace existing files 2016-09-14 12:48:58 -05:00
ChangeLog move libapparmor into the libraries directory 2008-05-19 22:48:31 +00:00
configure.ac libraries/libapparmor: fix syntax in configure 2024-03-15 02:36:12 +00:00
COPYING.LGPL move libapparmor into the libraries directory 2008-05-19 22:48:31 +00:00
INSTALL move libapparmor into the libraries directory 2008-05-19 22:48:31 +00:00
Makefile.am libapparmor: more Makefile cleanups 2015-01-26 15:39:10 -08:00
NEWS move libapparmor into the libraries directory 2008-05-19 22:48:31 +00:00
README docs: update documentation to point bug reporting to gitlab 2020-05-05 00:10:53 -07:00

What little documentation exists is in include/aalogparse.h.

Please file bugs using https://gitlab.com/apparmor/apparmor/-/issues