Skip to content

Fix userspace audit compiler warnings

Tyler Hicks linux-audit 1 version Applied

Status from this message: Applied. I think there are a couple places where it will obviously segfault in

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3Don't ignore the return value of asprintf()audisp/audispd.c audisp/plugins/prelude/audisp-prelude.c auparse/ellist.c +4 more+232 -1561 reply
2/3Fix Wunused-return warningsaudisp/audispd.c src/auditd-event.c src/auditd.c +1 more+79 -302 replies
3/3Fix discards 'const' qualifier from pointer target type warningssrc/aureport-options.c src/ausearch-common.h src/ausearch-lookup.c +1 more+10 -121 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] Fix userspace audit compiler warnings

These patches fix the majority of compiler warnings seen when building audit on Ubuntu.

The audit codebase rarely checked the return value of asprintf(), which can cause problems if memory allocation fails. Most of the missing checks are in libauparse, which is probably fine but who knows what will use it in the future. Also, all of these warnings clutter up the build output and make it more difficult to see more serious warnings.

The second patch contains some other ignored return value warnings fixes, as well. These show up on Ubuntu when the -D_FORTIFY_SOURCE=2 and -Wunused-return flags are in use. They don't seem to show up on Fedora in the same situation, but I believe that they should, despite casting the function's return value to (void). Despite that, they looked to be areas in the code that should at least log a message or even prevent auditd from running in some situations.

The last patch cleans up two const warnings.

There are still a number of warnings in the zos-remote audispd plugin that I didn't get to and a few that look ok to me in the embedded libev code.

Tyler