AppArmor audit calls can have a NULL audit context,
so the LSM context audit needs to check for this.
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
/* cancel dummy context to enable supporting records */
if (ctx)
ctx->dummy = 0;
- if (type == AUDIT_MAC_TASK_CONTEXTS && ab->ctx->serial == 0) {
+ if (type == AUDIT_MAC_TASK_CONTEXTS && ab->ctx &&
+ ab->ctx->serial == 0) {
audit_stamp_context(ab->ctx);
audit_get_stamp(ab->ctx, &t, &serial);
}