No conflicts.
Showing the changes to security (2 of 405 files). Show all
Unified · Split
| @@ -1048,8 +1048,19 @@ int security_dentry_init_security(struct dentry *dentry, int mode, · 1047 unmodified lines | ||
| 1048 | 1048 | const char **xattr_name, void **ctx, |
| 1049 | 1049 | u32 *ctxlen) |
| 1050 | 1050 | { |
| 1051 | − return call_int_hook(dentry_init_security, -EOPNOTSUPP, dentry, mode, | |
| 1052 | − name, xattr_name, ctx, ctxlen); | |
| 1051 | + struct security_hook_list *hp; | |
| 1052 | + int rc; | |
| 1053 | + | |
| 1054 | + /* | |
| 1055 | + * Only one module will provide a security context. | |
| 1056 | + */ | |
| 1057 | + hlist_for_each_entry(hp, &security_hook_heads.dentry_init_security, list) { | |
| 1058 | + rc = hp->hook.dentry_init_security(dentry, mode, name, | |
| 1059 | + xattr_name, ctx, ctxlen); | |
| 1060 | + if (rc != LSM_RET_DEFAULT(dentry_init_security)) | |
| 1061 | + return rc; | |
| 1062 | + } | |
| 1063 | + return LSM_RET_DEFAULT(dentry_init_security); | |
| 1053 | 1064 | } |
| 1054 | 1065 | EXPORT_SYMBOL(security_dentry_init_security); |
| 1055 | 1066 | |
| @@ -152,6 +152,8 @@ static void cond_list_destroy(struct policydb *p) · 151 unmodified lines | ||
| 152 | 152 | for (i = 0; i < p->cond_list_len; i++) |
| 153 | 153 | cond_node_destroy(&p->cond_list[i]); |
| 154 | 154 | kfree(p->cond_list); |
| 155 | + p->cond_list = NULL; | |
| 156 | + p->cond_list_len = 0; | |
| 155 | 157 | } |
| 156 | 158 | |
| 157 | 159 | void cond_policydb_destroy(struct policydb *p) |
| @@ -441,7 +443,6 @@ int cond_read_list(struct policydb *p, void *fp) · 283 unmodified lines | ||
| 441 | 443 | return 0; |
| 442 | 444 | err: |
| 443 | 445 | cond_list_destroy(p); |
| 444 | − p->cond_list = NULL; | |
| 445 | 446 | return rc; |
| 446 | 447 | } |
| 447 | 448 | |