linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: marcelo.leitner@gmail.com (Marcelo Ricardo Leitner)
To: linux-security-module@vger.kernel.org
Subject: [RFC PATCH 5/5] selinux: Add SCTP support
Date: Tue, 31 Oct 2017 15:16:15 -0200	[thread overview]
Message-ID: <20171031171614.GE3675@localhost.localdomain> (raw)
In-Reply-To: <20171017135953.4419-1-richard_c_haines@btinternet.com>

On Tue, Oct 17, 2017 at 02:59:53PM +0100, Richard Haines wrote:
> The SELinux SCTP implementation is explained in:
> Documentation/security/SELinux-sctp.txt
> 
> Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
> ---
...
> diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
> index 33fd061..c3e9600 100644
> --- a/security/selinux/hooks.c
> +++ b/security/selinux/hooks.c
...
> @@ -4521,7 +4565,14 @@ static int selinux_socket_connect(struct socket *sock, struct sockaddr *address,
>  		unsigned short snum;
>  		u32 sid, perm;
>  
> -		if (sk->sk_family == PF_INET) {
> +		/* sctp_connectx(3) calls via
> +		 *selinux_sctp_bind_connect() that validates multiple
> +		 * connect addresses. Because of this need to check
> +		 * address->sa_family as it is possible to have
> +		 * sk->sk_family = PF_INET6 with addr->sa_family = AF_INET.
> +		 */
> +		if (sk->sk_family == PF_INET ||
> +					address->sa_family == AF_INET) {

Not sure which code style applies on this file but the if () above
looks odd. At least, checkpatch.pl complained about it.

  Marcelo
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-10-31 17:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-17 13:59 [RFC PATCH 5/5] selinux: Add SCTP support Richard Haines
2017-10-20 19:00 ` Stephen Smalley
2017-10-24 15:50   ` Richard Haines
2017-10-31 17:16 ` Marcelo Ricardo Leitner [this message]
2017-11-01 21:34   ` Richard Haines
2017-11-07  0:09 ` Paul Moore
2017-11-13 22:05   ` Richard Haines
2017-11-13 22:40     ` Paul Moore
2017-11-14 13:41       ` Stephen Smalley
2017-11-14 21:52       ` Richard Haines
2017-11-20 21:55         ` Paul Moore
2017-11-21 17:37           ` Richard Haines

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171031171614.GE3675@localhost.localdomain \
    --to=marcelo.leitner@gmail.com \
    --cc=linux-security-module@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).