Skip to content

Commit 633dcb3

Browse files
rgbriggsmcgrof
authored andcommitted
audit,module: restore audit logging in load failure case
The move of the module sanity check to earlier skipped the audit logging call in the case of failure and to a place where the previously used context is unavailable. Add an audit logging call for the module loading failure case and get the module name when possible. Link: https://issues.redhat.com/browse/RHEL-52839 Fixes: 02da2cb ("module: move check_modinfo() early to early_mod_check()") Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
1 parent 050f9cb commit 633dcb3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

kernel/module/main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3332,8 +3332,10 @@ static int load_module(struct load_info *info, const char __user *uargs,
33323332
* failures once the proper module was allocated and
33333333
* before that.
33343334
*/
3335-
if (!module_allocated)
3335+
if (!module_allocated) {
3336+
audit_log_kern_module(info->name ? info->name : "(unavailable)");
33363337
mod_stat_bump_becoming(info, flags);
3338+
}
33373339
free_copy(info, flags);
33383340
return err;
33393341
}

0 commit comments

Comments
 (0)