UBUNTU: SAUCE: apparmor4.0.0 [28/90]: LSM stacking v39: LSM: Improve logic in security_getprocattr
BugLink: http://bugs.launchpad.net/bugs/2028253 The conditional in security_getprocattr() can be simplified and made clearer. This change does that. Signed-off-by: Casey Schaufler <casey@schaufler-ca.com> (cherry picked from commit 5f2df36aeb13d0d659d4355fd399e028c64de737 https://git.launchpad.net/~apparmor-dev/ubuntu-kernel-next) Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
This commit is contained in:
committed by
Paolo Pisati
parent
447c1808a9
commit
3378b3ca12
+4
-5
@@ -4126,11 +4126,10 @@ int security_getprocattr(struct task_struct *p, int lsmid, const char *name,
|
||||
{
|
||||
struct security_hook_list *hp;
|
||||
|
||||
hlist_for_each_entry(hp, &security_hook_heads.getprocattr, list) {
|
||||
if (lsmid != 0 && lsmid != hp->lsmid->id)
|
||||
continue;
|
||||
return hp->hook.getprocattr(p, name, value);
|
||||
}
|
||||
hlist_for_each_entry(hp, &security_hook_heads.getprocattr, list)
|
||||
if (lsmid == LSM_ID_UNDEF || lsmid == hp->lsmid->id)
|
||||
return hp->hook.getprocattr(p, name, value);
|
||||
|
||||
return LSM_RET_DEFAULT(getprocattr);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user