• Rafal Krypa's avatar
    Smack: ignore null signal in smack_task_kill · 18d872f7
    Rafal Krypa authored
    Kill with signal number 0 is commonly used for checking PID existence.
    Smack treated such cases like any other kills, although no signal is
    actually delivered when sig == 0.
    
    Checking permissions when sig == 0 didn't prevent an unprivileged caller
    from learning whether PID exists or not. When it existed, kernel returned
    EPERM, when it didn't - ESRCH. The only effect of policy check in such
    case is noise in audit logs.
    
    This change lets Smack silently ignore kill() invocations with sig == 0.
    Signed-off-by: default avatarRafal Krypa <r.krypa@samsung.com>
    Acked-by: default avatarCasey Schaufler <casey@schaufler-ca.com>
    18d872f7
smack_lsm.c 115 KB