Skip to content

libsepol/cil: Limit certain error and warning reports

James Carter selinux 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest4 patches 2 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4libsepol/cil: Add cil_get_log_level() functionlibsepol/cil/src/cil_log.c libsepol/cil/src/cil_log.h+7 -00 replies
2/4libsepol/cil: Provide more control over reporting bounds failureslibsepol/cil/src/cil_binary.c+5 -40 replies
3/4libsepol/cil: Limit the neverallow violations reportedlibsepol/cil/src/cil_binary.c+11 -00 replies
4/4libsepol/cil: Limit the amount of reporting for context rule conflictslibsepol/cil/src/cil_post.c+33 -240 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCH 0/4 v2] libsepol/cil: Limit certain error and warning reports

When reporting some errors or warnings, a search is made to find the original or matching rule. Both neverallow and type bounds violations will use cil_find_matching_avrule_in_ast() to find the rules in violation. For context rules, the AST is walked to find the conflicting rule. If there are a lot of errors or warnings, then this can take a lot of time. oss-fuzz has generated policies that can abuse this reporting, so the desire is to limit the reporting by default.

By using the new function, cil_get_log_level(), the error reporting for neverallow and type bounds violations and the warnings for context rule conflicts can be less by default while still allowing for everything to be reported at higher log verbosity levels.

James Carter (4):
libsepol/cil: Add cil_get_log_level() function libsepol/cil: Provide more control over reporting bounds failures libsepol/cil: Limit the neverallow violations reported libsepol/cil: Limit the amount of reporting for context rule conflicts

 libsepol/cil/src/cil_binary.c | 20 +++++++++---
 libsepol/cil/src/cil_log.c    |  5 +++
 libsepol/cil/src/cil_log.h    |  2 ++
 libsepol/cil/src/cil_post.c   | 57 ++++++++++++++++++++---------------
 4 files changed, 56 insertions(+), 28 deletions(-)
Signature · 1 line
2.31.1