BACKPORT: Smack: ignore null signal in smack_task_kill
authorRafal Krypa <r.krypa@samsung.com>
Mon, 4 Apr 2016 09:14:53 +0000 (11:14 +0200)
committerRafal Krypa <r.krypa@samsung.com>
Fri, 18 Nov 2016 10:57:15 +0000 (11:57 +0100)
commite4169b02f9ab5d61305b9dba6ac16639a0901951
tree743938322a5b78731efcb4325d99e6c4ee558b58
parente016cf4b05bd213c1165d7dcd3f4f760f20b194f
BACKPORT: Smack: ignore null signal in smack_task_kill

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: Rafal Krypa <r.krypa@samsung.com>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
(cherry-picked from upstream 18d872f77cecec2677a394170f26aaeb08562cee)
security/smack/smack_lsm.c