diff options
Diffstat (limited to 'security')
-rw-r--r-- | security/selinux/hooks.c | 3 | ||||
-rw-r--r-- | security/selinux/ss/policydb.c | 10 |
2 files changed, 5 insertions, 8 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index f7cf0ea6faea..8fb248843009 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -1578,7 +1578,8 @@ static int may_create(struct inode *dir, | |||
1578 | return rc; | 1578 | return rc; |
1579 | 1579 | ||
1580 | if (!newsid || !(sbsec->flags & SE_SBLABELSUPP)) { | 1580 | if (!newsid || !(sbsec->flags & SE_SBLABELSUPP)) { |
1581 | rc = security_transition_sid(sid, dsec->sid, tclass, NULL, &newsid); | 1581 | rc = security_transition_sid(sid, dsec->sid, tclass, |
1582 | &dentry->d_name, &newsid); | ||
1582 | if (rc) | 1583 | if (rc) |
1583 | return rc; | 1584 | return rc; |
1584 | } | 1585 | } |
diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c index e7b850ad57ee..7102457661d6 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c | |||
@@ -502,7 +502,7 @@ static int policydb_index(struct policydb *p) | |||
502 | goto out; | 502 | goto out; |
503 | 503 | ||
504 | rc = flex_array_prealloc(p->type_val_to_struct_array, 0, | 504 | rc = flex_array_prealloc(p->type_val_to_struct_array, 0, |
505 | p->p_types.nprim - 1, GFP_KERNEL | __GFP_ZERO); | 505 | p->p_types.nprim, GFP_KERNEL | __GFP_ZERO); |
506 | if (rc) | 506 | if (rc) |
507 | goto out; | 507 | goto out; |
508 | 508 | ||
@@ -519,7 +519,7 @@ static int policydb_index(struct policydb *p) | |||
519 | goto out; | 519 | goto out; |
520 | 520 | ||
521 | rc = flex_array_prealloc(p->sym_val_to_name[i], | 521 | rc = flex_array_prealloc(p->sym_val_to_name[i], |
522 | 0, p->symtab[i].nprim - 1, | 522 | 0, p->symtab[i].nprim, |
523 | GFP_KERNEL | __GFP_ZERO); | 523 | GFP_KERNEL | __GFP_ZERO); |
524 | if (rc) | 524 | if (rc) |
525 | goto out; | 525 | goto out; |
@@ -1819,8 +1819,6 @@ static int filename_trans_read(struct policydb *p, void *fp) | |||
1819 | goto out; | 1819 | goto out; |
1820 | nel = le32_to_cpu(buf[0]); | 1820 | nel = le32_to_cpu(buf[0]); |
1821 | 1821 | ||
1822 | printk(KERN_ERR "%s: nel=%d\n", __func__, nel); | ||
1823 | |||
1824 | last = p->filename_trans; | 1822 | last = p->filename_trans; |
1825 | while (last && last->next) | 1823 | while (last && last->next) |
1826 | last = last->next; | 1824 | last = last->next; |
@@ -1857,8 +1855,6 @@ static int filename_trans_read(struct policydb *p, void *fp) | |||
1857 | goto out; | 1855 | goto out; |
1858 | name[len] = 0; | 1856 | name[len] = 0; |
1859 | 1857 | ||
1860 | printk(KERN_ERR "%s: ft=%p ft->name=%p ft->name=%s\n", __func__, ft, ft->name, ft->name); | ||
1861 | |||
1862 | rc = next_entry(buf, fp, sizeof(u32) * 4); | 1858 | rc = next_entry(buf, fp, sizeof(u32) * 4); |
1863 | if (rc) | 1859 | if (rc) |
1864 | goto out; | 1860 | goto out; |
@@ -2375,7 +2371,7 @@ int policydb_read(struct policydb *p, void *fp) | |||
2375 | goto bad; | 2371 | goto bad; |
2376 | 2372 | ||
2377 | /* preallocate so we don't have to worry about the put ever failing */ | 2373 | /* preallocate so we don't have to worry about the put ever failing */ |
2378 | rc = flex_array_prealloc(p->type_attr_map_array, 0, p->p_types.nprim - 1, | 2374 | rc = flex_array_prealloc(p->type_attr_map_array, 0, p->p_types.nprim, |
2379 | GFP_KERNEL | __GFP_ZERO); | 2375 | GFP_KERNEL | __GFP_ZERO); |
2380 | if (rc) | 2376 | if (rc) |
2381 | goto bad; | 2377 | goto bad; |