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: email@example.com # 4.11 Signed-off-by: Yi Wang <firstname.lastname@example.org> Reviewed-by: Jiang Biao <email@example.com> Reviewed-by: Richard Guy Briggs <firstname.lastname@example.org> Signed-off-by: Paul Moore <email@example.com> Signed-off-by: Greg Kroah-Hartman <firstname.lastname@example.org>
Showing with 9 additions and 4 deletions