[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHC9VhQsVa+0LgqFyguqq0bhXOz7mrbJfXy-+rJjY53xnCkixg@mail.gmail.com>
Date: Tue, 20 Jun 2017 15:49:05 -0400
From: Paul Moore <paul@...l-moore.com>
To: Luis Ressel <aranea@...ah.de>, Stephen Smalley <sds@...ho.nsa.gov>
Cc: Eric Paris <eparis@...isplace.org>,
James Morris <james.l.morris@...cle.com>,
"Serge E. Hallyn" <serge@...lyn.com>, selinux@...ho.nsa.gov,
linux-security-module@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] selinux: Assign proper class to PF_UNIX/SOCK_RAW sockets
On Mon, Jun 19, 2017 at 5:33 PM, Luis Ressel <aranea@...ah.de> wrote:
> For PF_UNIX, SOCK_RAW is synonymous with SOCK_DGRAM (cf.
> net/unix/af_unix.c). This is a tad obscure, but libpcap uses it.
>
> Signed-off-by: Luis Ressel <aranea@...ah.de>
> Acked-by: Stephen Smalley <sds@...ho.nsa.gov>
> ---
> security/selinux/hooks.c | 1 +
> 1 file changed, 1 insertion(+)
My only concern is what effect this will have on existing policy.
Prior to this patch PF_UNIX/SOCK_RAW will result in the generic
"socket" class where after this patch it will result in the
"unix_dgram_socket". I believe this is the right change, but it seems
like this should be wrapped by a policy capability, yes?
> diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
> index 819fd6858b49..1a331fba4a3c 100644
> --- a/security/selinux/hooks.c
> +++ b/security/selinux/hooks.c
> @@ -1275,6 +1275,7 @@ static inline u16 socket_type_to_security_class(int family, int type, int protoc
> case SOCK_SEQPACKET:
> return SECCLASS_UNIX_STREAM_SOCKET;
> case SOCK_DGRAM:
> + case SOCK_RAW:
> return SECCLASS_UNIX_DGRAM_SOCKET;
> }
> break;
> --
> 2.13.1
--
paul moore
www.paul-moore.com
Powered by blists - more mailing lists