Closed stevegrubb closed 3 years ago
This is a simple audit_log_string() -> audit_log_untrustedstring() replacement. I'm not 100% sure about this. Probably we can leave audit_log_string() in the API and use it for hard-coded obviously fine strings like: audit_log_string(ab, "trace")
.
The drawback is that some caller still could use audit_log_string() for some untrusted string in the future.
kernel test robot generated two warnings: security/apparmor/ipc.c:39:1: warning: non-void function does not return a value in all control paths [-Wreturn-type] security/apparmor/ipc.c:153:1: warning: non-void function does not return a value in all control paths [-Wreturn-type]
Post v3 https://www.redhat.com/archives/linux-audit/2020-July/msg00012.html https://lkml.org/lkml/2020/7/3/875
This can be closed since it is upstream in v5.9-rc1 f1d9b23cabc6 audit: purge audit_log_string from the intra-kernel audit API
The function, audit_log_string, is a helper to audit_log_untrustedstring. It cannot be used alone without understanding the rules for untrusted strings. So, any use of it is simply going to be either wrong or will re-invent audit_log_untrustedstring. The current list of files which calls it are:
security/apparmor/ipc.c security/apparmor/audit.c security/apparmor/file.c security/integrity/integrity_audit.c