• Richard Guy Briggs's avatar
    audit: use supplied gfp_mask from audit_buffer in kauditd_send_multicast_skb · 5755059f
    Richard Guy Briggs authored
    commit 54dc77d9 upstream.
    
    Eric Paris explains: Since kauditd_send_multicast_skb() gets called in
    audit_log_end(), which can come from any context (aka even a sleeping context)
    GFP_KERNEL can't be used.  Since the audit_buffer knows what context it should
    use, pass that down and use that.
    
    See: https://lkml.org/lkml/2014/12/16/542
    
    BUG: sleeping function called from invalid context at mm/slab.c:2849
    in_atomic(): 1, irqs_disabled(): 0, pid: 885, name: sulogin
    2 locks held by sulogin/885:
      #0:  (&sig->cred_guard_mutex){+.+.+.}, at: [<ffffffff91152e30>] prepare_bprm_creds+0x28/0x8b
      #1:  (tty_files_lock){+.+.+.}, at: [<ffffffff9123e787>] selinux_bprm_committing_creds+0x55/0x22b
    CPU: 1 PID: 885 Comm: sulogin Not tainted 3.18.0-next-20141216 #30
    Hardware name: Dell Inc. Latitude E6530/07Y85M, BIOS A15 06/20/2014
      ffff880223744f10 ffff88022410f9b8 ffffffff916ba529 0000000000000375
      ffff880223744f10 f...
    5755059f
audit.c 52.9 KB