diff options
Diffstat (limited to 'security')
-rw-r--r-- | security/integrity/ima/ima_fs.c | 4 | ||||
-rw-r--r-- | security/smack/smackfs.c | 8 | ||||
-rw-r--r-- | security/tomoyo/common.c | 6 | ||||
-rw-r--r-- | security/tomoyo/realpath.c | 16 | ||||
-rw-r--r-- | security/tomoyo/tomoyo.c | 6 |
5 files changed, 23 insertions, 17 deletions
diff --git a/security/integrity/ima/ima_fs.c b/security/integrity/ima/ima_fs.c index ffbe259700b1..510186f0b72e 100644 --- a/security/integrity/ima/ima_fs.c +++ b/security/integrity/ima/ima_fs.c | |||
@@ -84,8 +84,8 @@ static void *ima_measurements_next(struct seq_file *m, void *v, loff_t *pos) | |||
84 | * against concurrent list-extension | 84 | * against concurrent list-extension |
85 | */ | 85 | */ |
86 | rcu_read_lock(); | 86 | rcu_read_lock(); |
87 | qe = list_entry(rcu_dereference(qe->later.next), | 87 | qe = list_entry_rcu(qe->later.next, |
88 | struct ima_queue_entry, later); | 88 | struct ima_queue_entry, later); |
89 | rcu_read_unlock(); | 89 | rcu_read_unlock(); |
90 | (*pos)++; | 90 | (*pos)++; |
91 | 91 | ||
diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c index e03a7e19c73b..11d2cb19d7a6 100644 --- a/security/smack/smackfs.c +++ b/security/smack/smackfs.c | |||
@@ -734,8 +734,8 @@ static void smk_netlbladdr_insert(struct smk_netlbladdr *new) | |||
734 | return; | 734 | return; |
735 | } | 735 | } |
736 | 736 | ||
737 | m = list_entry(rcu_dereference(smk_netlbladdr_list.next), | 737 | m = list_entry_rcu(smk_netlbladdr_list.next, |
738 | struct smk_netlbladdr, list); | 738 | struct smk_netlbladdr, list); |
739 | 739 | ||
740 | /* the comparison '>' is a bit hacky, but works */ | 740 | /* the comparison '>' is a bit hacky, but works */ |
741 | if (new->smk_mask.s_addr > m->smk_mask.s_addr) { | 741 | if (new->smk_mask.s_addr > m->smk_mask.s_addr) { |
@@ -748,8 +748,8 @@ static void smk_netlbladdr_insert(struct smk_netlbladdr *new) | |||
748 | list_add_rcu(&new->list, &m->list); | 748 | list_add_rcu(&new->list, &m->list); |
749 | return; | 749 | return; |
750 | } | 750 | } |
751 | m_next = list_entry(rcu_dereference(m->list.next), | 751 | m_next = list_entry_rcu(m->list.next, |
752 | struct smk_netlbladdr, list); | 752 | struct smk_netlbladdr, list); |
753 | if (new->smk_mask.s_addr > m_next->smk_mask.s_addr) { | 753 | if (new->smk_mask.s_addr > m_next->smk_mask.s_addr) { |
754 | list_add_rcu(&new->list, &m->list); | 754 | list_add_rcu(&new->list, &m->list); |
755 | return; | 755 | return; |
diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c index d4d41b3efc7c..ddfb9cccf468 100644 --- a/security/tomoyo/common.c +++ b/security/tomoyo/common.c | |||
@@ -1720,14 +1720,14 @@ static bool tomoyo_policy_loader_exists(void) | |||
1720 | * policies are not loaded yet. | 1720 | * policies are not loaded yet. |
1721 | * Thus, let do_execve() call this function everytime. | 1721 | * Thus, let do_execve() call this function everytime. |
1722 | */ | 1722 | */ |
1723 | struct nameidata nd; | 1723 | struct path path; |
1724 | 1724 | ||
1725 | if (path_lookup(tomoyo_loader, LOOKUP_FOLLOW, &nd)) { | 1725 | if (kern_path(tomoyo_loader, LOOKUP_FOLLOW, &path)) { |
1726 | printk(KERN_INFO "Not activating Mandatory Access Control now " | 1726 | printk(KERN_INFO "Not activating Mandatory Access Control now " |
1727 | "since %s doesn't exist.\n", tomoyo_loader); | 1727 | "since %s doesn't exist.\n", tomoyo_loader); |
1728 | return false; | 1728 | return false; |
1729 | } | 1729 | } |
1730 | path_put(&nd.path); | 1730 | path_put(&path); |
1731 | return true; | 1731 | return true; |
1732 | } | 1732 | } |
1733 | 1733 | ||
diff --git a/security/tomoyo/realpath.c b/security/tomoyo/realpath.c index bf8e2b451687..40927a84cb6e 100644 --- a/security/tomoyo/realpath.c +++ b/security/tomoyo/realpath.c | |||
@@ -165,11 +165,11 @@ char *tomoyo_realpath_from_path(struct path *path) | |||
165 | */ | 165 | */ |
166 | char *tomoyo_realpath(const char *pathname) | 166 | char *tomoyo_realpath(const char *pathname) |
167 | { | 167 | { |
168 | struct nameidata nd; | 168 | struct path path; |
169 | 169 | ||
170 | if (pathname && path_lookup(pathname, LOOKUP_FOLLOW, &nd) == 0) { | 170 | if (pathname && kern_path(pathname, LOOKUP_FOLLOW, &path) == 0) { |
171 | char *buf = tomoyo_realpath_from_path(&nd.path); | 171 | char *buf = tomoyo_realpath_from_path(&path); |
172 | path_put(&nd.path); | 172 | path_put(&path); |
173 | return buf; | 173 | return buf; |
174 | } | 174 | } |
175 | return NULL; | 175 | return NULL; |
@@ -184,11 +184,11 @@ char *tomoyo_realpath(const char *pathname) | |||
184 | */ | 184 | */ |
185 | char *tomoyo_realpath_nofollow(const char *pathname) | 185 | char *tomoyo_realpath_nofollow(const char *pathname) |
186 | { | 186 | { |
187 | struct nameidata nd; | 187 | struct path path; |
188 | 188 | ||
189 | if (pathname && path_lookup(pathname, 0, &nd) == 0) { | 189 | if (pathname && kern_path(pathname, 0, &path) == 0) { |
190 | char *buf = tomoyo_realpath_from_path(&nd.path); | 190 | char *buf = tomoyo_realpath_from_path(&path); |
191 | path_put(&nd.path); | 191 | path_put(&path); |
192 | return buf; | 192 | return buf; |
193 | } | 193 | } |
194 | return NULL; | 194 | return NULL; |
diff --git a/security/tomoyo/tomoyo.c b/security/tomoyo/tomoyo.c index 5b481912752a..e42be5c4f055 100644 --- a/security/tomoyo/tomoyo.c +++ b/security/tomoyo/tomoyo.c | |||
@@ -27,6 +27,12 @@ static int tomoyo_cred_prepare(struct cred *new, const struct cred *old, | |||
27 | 27 | ||
28 | static int tomoyo_bprm_set_creds(struct linux_binprm *bprm) | 28 | static int tomoyo_bprm_set_creds(struct linux_binprm *bprm) |
29 | { | 29 | { |
30 | int rc; | ||
31 | |||
32 | rc = cap_bprm_set_creds(bprm); | ||
33 | if (rc) | ||
34 | return rc; | ||
35 | |||
30 | /* | 36 | /* |
31 | * Do only if this function is called for the first time of an execve | 37 | * Do only if this function is called for the first time of an execve |
32 | * operation. | 38 | * operation. |