Commit graph

4 commits

Author SHA1 Message Date
Ryan Lee
6592daff90 Copyedit the help text for aa-load
Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
2025-01-24 16:02:05 -08:00
Ryan Lee
322a98c8c9 Fix incorrect strnlen length in aa_load.c load_policy_dir
POSIX states that d_name has up to NAME_MAX (255) characters, and glibc
stores d_name as an array of size NAME_MAX+1 (256). Thus, supplying
PATH_MAX (4096) as the max length could trigger a buffer overrun. This
could be an even bigger issue on other libcs, as POSIX states that d_name
can be unsized.

Fortunately, this does not seem to cause actual issues, as the length is
only used to compare d_name to a short fixed string. However, it'd be better
to pass the actual correct max length to strnlen.

Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
2024-08-06 13:04:17 -07:00
Georgia Garcia
b0902a34d1 binutils: fix resource leak on aa-load
Dir "d" is not closed when asprintf fails.

Found by coverity: CID 321416:  Resource leaks  (RESOURCE_LEAK)

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2023-06-30 10:02:48 -03:00
Georgia Garcia
b2a1544d94 binutils: add aa-load
aa-load is a tool that loads cached (compiled) policies into
the kernel. It can receive as argument a file, a cache directory
containing the hash subtree, and a directory containing cached
files directly underneath - no hash.

This tool can be used in the as a guide for other init
systems to load the cached policies directly.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2021-07-26 20:52:34 -03:00