Commit a1b5bcff authored by Committed by Greg Kroah-Hartman
audit: fix potential null dereference 'context->module.name'
commit b305f7ed upstream. The variable 'context->module.name' may be null pointer when kmalloc return null, so it's better to check it before using to avoid null dereference. Another one more thing this patch does is using kstrdup instead of (kmalloc + strcpy), and signal a lost record via audit_log_lost. Cc: firstname.lastname@example.org # 4.11 Signed-off-by: Yi Wang <email@example.com> Reviewed-by: Jiang Biao <firstname.lastname@example.org> Reviewed-by: Richard Guy Briggs <email@example.com> Signed-off-by: Paul Moore <firstname.lastname@example.org> Signed-off-by: Greg Kroah-Hartman <email@example.com>
Showing with 9 additions and 4 deletions