diff options
Diffstat (limited to 'security/selinux/ss/services.c')
-rw-r--r-- | security/selinux/ss/services.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c index 2ea108c2c048..1ded0ec7e8c2 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c | |||
@@ -1472,12 +1472,18 @@ static int security_compute_sid(u32 ssid, | |||
1472 | } | 1472 | } |
1473 | 1473 | ||
1474 | /* Set the type to default values. */ | 1474 | /* Set the type to default values. */ |
1475 | if ((tclass == policydb.process_class) || (sock == true)) { | 1475 | if (cladatum && cladatum->default_type == DEFAULT_SOURCE) { |
1476 | /* Use the type of process. */ | ||
1477 | newcontext.type = scontext->type; | 1476 | newcontext.type = scontext->type; |
1478 | } else { | 1477 | } else if (cladatum && cladatum->default_type == DEFAULT_TARGET) { |
1479 | /* Use the type of the related object. */ | ||
1480 | newcontext.type = tcontext->type; | 1478 | newcontext.type = tcontext->type; |
1479 | } else { | ||
1480 | if ((tclass == policydb.process_class) || (sock == true)) { | ||
1481 | /* Use the type of process. */ | ||
1482 | newcontext.type = scontext->type; | ||
1483 | } else { | ||
1484 | /* Use the type of the related object. */ | ||
1485 | newcontext.type = tcontext->type; | ||
1486 | } | ||
1481 | } | 1487 | } |
1482 | 1488 | ||
1483 | /* Look for a type transition/member/change rule. */ | 1489 | /* Look for a type transition/member/change rule. */ |