apparmor: leverage audit_log_n_untrustedstring() when possible
Subsystems (2)
Paul Moore
maintainerPATCH 1/1 apparmor: leverage audit_log_n_untrustedstring() when possible
Make use of the audit_log_n_untrustedstring() function to simplify the code in aa_label_xaudit().
--- security/apparmor/label.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
security/apparmor/label.c +1 -4
@@ -1743,10 +1743,7 @@ void aa_label_xaudit(struct audit_buffer *ab, struct aa_ns *ns, str = (char *) label->hname; len =strlen (str); } -if (audit_string_contains_control (str, len)) -audit_log_n_hex (ab, str, len); -else -audit_log_n_string (ab, str, len); +audit_log_n_untrustedstring (ab, str, len);kfree (name); }
Signature · 1 line
2.55.0
Paul Moore
maintainerQuoted 8 lines · Paul Moore
Make use of the
audit_log_n_untrustedstring()function to simplify the code inaa_label_xaudit().Signed-off-by Paul Moore <[email protected]>--- security/apparmor/label.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
Untested beyond a basic compile, but I noticed this while looking at something else (unrelated) and wanted to send it to the list before I forgot about it ...
Quoted 18 lines
security/apparmor/label.c +1
-5@@ -1743,10 +1743,7 @@ void aa_label_xaudit(struct audit_buffer *ab, struct aa_ns *ns, str = (char *) label->hname; len =strlen (str); } -if (audit_string_contains_control (str, len)) -audit_log_n_hex (ab, str, len); -else -audit_log_n_string (ab, str, len); +audit_log_n_untrustedstring (ab, str, len);kfree (name); } --2.55.0
Signature · 1 line
paul-moore.com
Paul Moore
maintainerQuoted 5 lines · Paul Moore
Quoted 4 lines · Paul Moore
Make use of the
audit_log_n_untrustedstring()function to simplify the code inaa_label_xaudit().
Quoted 8 lines
Quoted 4 lines
Signed-off-by Paul Moore <[email protected]>--- security/apparmor/label.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)Untested beyond a basic compile, but I noticed this while looking at something else (unrelated) and wanted to send it to the list before I forgot about it ...
My apologies Georgia, I thought I had copied your email into the original posting but it appears I copied John's email twice into my posting script (which helpfully de-duped it).
Sorry about that.
Quoted 18 lines
Quoted 18 lines
security/apparmor/label.c +1
-5@@ -1743,10 +1743,7 @@ void aa_label_xaudit(struct audit_buffer *ab, struct aa_ns *ns, str = (char *) label->hname; len =strlen (str); } -if (audit_string_contains_control (str, len)) -audit_log_n_hex (ab, str, len); -else -audit_log_n_string (ab, str, len); +audit_log_n_untrustedstring (ab, str, len);kfree (name); } --2.55.0
Signature · 1 line
paul-moore.com
Ryan Lee
Reviewed-byQuoted 36 lines · Paul Moore
Quoted 5 lines · Paul Moore
Quoted 4 lines · Paul Moore
Make use of the
audit_log_n_untrustedstring()function to simplify the code inaa_label_xaudit().Quoted 8 lines
Quoted 4 lines
Signed-off-by Paul Moore <[email protected]>--- security/apparmor/label.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)Untested beyond a basic compile, but I noticed this while looking at something else (unrelated) and wanted to send it to the list before I forgot about it ...
My apologies Georgia, I thought I had copied your email into the original posting but it appears I copied John's email twice into my posting script (which helpfully de-duped it).
Sorry about that.
Quoted 14 lines
Quoted 14 lines
security/apparmor/label.c +1
-4@@ -1743,10 +1743,7 @@ void aa_label_xaudit(struct audit_buffer *ab, struct aa_ns *ns, str = (char *) label->hname; len =strlen (str); } -if (audit_string_contains_control (str, len)) -audit_log_n_hex (ab, str, len); -else -audit_log_n_string (ab, str, len); +audit_log_n_untrustedstring (ab, str, len);
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
security/apparmor/label.c +0
-1kfree (name); } --2.55.0
--
paul-moore.com
Quoted 4 lines · Paul Moore
Make use of the
audit_log_n_untrustedstring()function to simplify the code inaa_label_xaudit().Signed-off-by Paul Moore <[email protected]>
unless you object I will pull this into the apparmor tree
Quoted 20 lines
--- security/apparmor/label.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)security/apparmor/label.c +1
-4@@ -1743,10 +1743,7 @@ void aa_label_xaudit(struct audit_buffer *ab, struct aa_ns *ns, str = (char *) label->hname; len =strlen (str); } -if (audit_string_contains_control (str, len)) -audit_log_n_hex (ab, str, len); -else -audit_log_n_string (ab, str, len); +audit_log_n_untrustedstring (ab, str, len);kfree (name); }
Paul Moore
maintainerQuoted 9 lines · John Johansen
Quoted 4 lines · Paul Moore
Make use of the
audit_log_n_untrustedstring()function to simplify the code inaa_label_xaudit().Signed-off-by Paul Moore <[email protected]>Acked-by John Johansen <[email protected]>unless you object I will pull this into the apparmor tree
Please do, that code is up to you and Georgia, not me.
Thanks.
Quoted 2 lines
Quoted 2 lines
--
paul-moore.com