Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90902
b: refs/heads/master
c: 713a04a
h: refs/heads/master
v: v3
  • Loading branch information
Ahmed S. Darwish authored and James Morris committed Apr 18, 2008
1 parent 10176fd commit 22c6d13
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8a076191f373abaeb4aa5f6755d22e49db98940f
refs/heads/master: 713a04aeaba35bb95d442cdeb52055498519be25
19 changes: 17 additions & 2 deletions trunk/security/selinux/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -2792,6 +2792,12 @@ static int selinux_inode_killpriv(struct dentry *dentry)
return secondary_ops->inode_killpriv(dentry);
}

static void selinux_inode_getsecid(const struct inode *inode, u32 *secid)
{
struct inode_security_struct *isec = inode->i_security;
*secid = isec->sid;
}

/* file security operations */

static int selinux_revalidate_file_permission(struct file *file, int mask)
Expand Down Expand Up @@ -3183,7 +3189,8 @@ static int selinux_task_getsid(struct task_struct *p)

static void selinux_task_getsecid(struct task_struct *p, u32 *secid)
{
selinux_get_task_sid(p, secid);
struct task_security_struct *tsec = p->security;
*secid = tsec->sid;
}

static int selinux_task_setgroups(struct group_info *group_info)
Expand Down Expand Up @@ -4149,7 +4156,7 @@ static int selinux_socket_getpeersec_dgram(struct socket *sock, struct sk_buff *
goto out;

if (sock && family == PF_UNIX)
selinux_get_inode_sid(SOCK_INODE(sock), &peer_secid);
selinux_inode_getsecid(SOCK_INODE(sock), &peer_secid);
else if (skb)
selinux_skb_peerlbl_sid(skb, family, &peer_secid);

Expand Down Expand Up @@ -5026,6 +5033,12 @@ static int selinux_ipc_permission(struct kern_ipc_perm *ipcp, short flag)
return ipc_has_perm(ipcp, av);
}

static void selinux_ipc_getsecid(struct kern_ipc_perm *ipcp, u32 *secid)
{
struct ipc_security_struct *isec = ipcp->security;
*secid = isec->sid;
}

/* module stacking operations */
static int selinux_register_security (const char *name, struct security_operations *ops)
{
Expand Down Expand Up @@ -5342,6 +5355,7 @@ static struct security_operations selinux_ops = {
.inode_listsecurity = selinux_inode_listsecurity,
.inode_need_killpriv = selinux_inode_need_killpriv,
.inode_killpriv = selinux_inode_killpriv,
.inode_getsecid = selinux_inode_getsecid,

.file_permission = selinux_file_permission,
.file_alloc_security = selinux_file_alloc_security,
Expand Down Expand Up @@ -5382,6 +5396,7 @@ static struct security_operations selinux_ops = {
.task_to_inode = selinux_task_to_inode,

.ipc_permission = selinux_ipc_permission,
.ipc_getsecid = selinux_ipc_getsecid,

.msg_msg_alloc_security = selinux_msg_msg_alloc_security,
.msg_msg_free_security = selinux_msg_msg_free_security,
Expand Down

0 comments on commit 22c6d13

Please sign in to comment.