diff options
author | Jeff Garzik <jeff@garzik.org> | 2007-02-17 15:09:59 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-02-17 15:09:59 -0500 |
commit | 48c871c1f6a7c7044dd76774fb469e65c7e2e4e8 (patch) | |
tree | da3aa535c98cc0957851354ceb0fbff7482d7a9d /security/selinux/hooks.c | |
parent | 1a1689344add3333d28d1b5495d8043a3877d01c (diff) | |
parent | 4409d28140d9a6e6e3f4f1fdaf7234c4b965d954 (diff) |
Merge branch 'gfar' of master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc into upstream
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r-- | security/selinux/hooks.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 65fb5e8ea941..35eb8de892fc 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -181,11 +181,10 @@ static int inode_alloc_security(struct inode *inode) | |||
181 | struct task_security_struct *tsec = current->security; | 181 | struct task_security_struct *tsec = current->security; |
182 | struct inode_security_struct *isec; | 182 | struct inode_security_struct *isec; |
183 | 183 | ||
184 | isec = kmem_cache_alloc(sel_inode_cache, GFP_KERNEL); | 184 | isec = kmem_cache_zalloc(sel_inode_cache, GFP_KERNEL); |
185 | if (!isec) | 185 | if (!isec) |
186 | return -ENOMEM; | 186 | return -ENOMEM; |
187 | 187 | ||
188 | memset(isec, 0, sizeof(*isec)); | ||
189 | mutex_init(&isec->lock); | 188 | mutex_init(&isec->lock); |
190 | INIT_LIST_HEAD(&isec->list); | 189 | INIT_LIST_HEAD(&isec->list); |
191 | isec->inode = inode; | 190 | isec->inode = inode; |
@@ -2655,7 +2654,7 @@ static int selinux_file_send_sigiotask(struct task_struct *tsk, | |||
2655 | struct file_security_struct *fsec; | 2654 | struct file_security_struct *fsec; |
2656 | 2655 | ||
2657 | /* struct fown_struct is never outside the context of a struct file */ | 2656 | /* struct fown_struct is never outside the context of a struct file */ |
2658 | file = (struct file *)((long)fown - offsetof(struct file,f_owner)); | 2657 | file = container_of(fown, struct file, f_owner); |
2659 | 2658 | ||
2660 | tsec = tsk->security; | 2659 | tsec = tsk->security; |
2661 | fsec = file->f_security; | 2660 | fsec = file->f_security; |