Skip to content

Commit

Permalink
[NetLabel]: change the SELinux permissions
Browse files Browse the repository at this point in the history
Change NetLabel to use the 'recvfrom' socket permission and the
SECINITSID_NETMSG SELinux SID as the NetLabel base SID for incoming packets.
This patch effectively makes the old, and currently unused, SELinux NETMSG
permissions NetLabel permissions.

Signed-of-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Paul Moore authored and David S. Miller committed Sep 25, 2006
1 parent 609c92f commit df2115c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions security/selinux/ss/services.c
Original file line number Diff line number Diff line change
Expand Up @@ -2611,7 +2611,7 @@ int selinux_netlbl_sock_rcv_skb(struct sk_security_struct *sksec,
u32 netlbl_sid;
u32 recv_perm;

rc = selinux_netlbl_skbuff_getsid(skb, sksec->sid, &netlbl_sid);
rc = selinux_netlbl_skbuff_getsid(skb, SECINITSID_NETMSG, &netlbl_sid);
if (rc != 0)
return rc;

Expand All @@ -2620,13 +2620,13 @@ int selinux_netlbl_sock_rcv_skb(struct sk_security_struct *sksec,

switch (sksec->sclass) {
case SECCLASS_UDP_SOCKET:
recv_perm = UDP_SOCKET__RECV_MSG;
recv_perm = UDP_SOCKET__RECVFROM;
break;
case SECCLASS_TCP_SOCKET:
recv_perm = TCP_SOCKET__RECV_MSG;
recv_perm = TCP_SOCKET__RECVFROM;
break;
default:
recv_perm = RAWIP_SOCKET__RECV_MSG;
recv_perm = RAWIP_SOCKET__RECVFROM;
}

rc = avc_has_perm(sksec->sid,
Expand Down

0 comments on commit df2115c

Please sign in to comment.