User: | Jiri Slaby |
Error type: | Invalid Pointer Dereference |
Error type description: | A pointer which is invalid is being dereferenced |
File location: | security/smack/smackfs.c |
Line in file: | 205 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Stanse
(1.2)
Smatch (1.59) |
Entered: | 2011-11-07 22:22:22 UTC |
175static int smk_open_load(struct inode *inode, struct file *file) 176{ 177 return seq_open(file, &load_seq_ops); 178} 179 180/** 181 * smk_set_access - add a rule to the rule list 182 * @srp: the new rule to add 183 * 184 * Looks through the current subject/object/access list for 185 * the subject/object pair and replaces the access that was 186 * there. If the pair isn't found add it with the specified 187 * access. 188 */ 189static void smk_set_access(struct smack_rule *srp) 190{ 191 struct smk_list_entry *sp; 192 struct smk_list_entry *newp; 193 194 mutex_lock(&smack_list_lock); 195 196 for (sp = smack_list; sp != NULL; sp = sp->smk_next) 197 if (sp->smk_rule.smk_subject == srp->smk_subject && 198 sp->smk_rule.smk_object == srp->smk_object) { 199 sp->smk_rule.smk_access = srp->smk_access; 200 break; 201 } 202 203 if (sp == NULL) { 204 newp = kzalloc(sizeof(struct smk_list_entry), GFP_KERNEL); 205 newp->smk_rule = *srp; 206 newp->smk_next = smack_list; 207 smack_list = newp; 208 } 209 210 mutex_unlock(&smack_list_lock); 211 212 return; 213} 214 215/**