[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3bafff5a-f404-e559-bfd6-bb456a923525@schaufler-ca.com>
Date: Tue, 7 Jan 2020 10:40:38 -0800
From: Casey Schaufler <casey@...aufler-ca.com>
To: Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>,
David Ahern <dsahern@...il.com>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Casey Schaufler <casey@...aufler-ca.com>
Subject: Re: commit b9ef5513c99b breaks ping to ipv6 linklocal addresses on
debian buster
Does this patch address the Debian issue? It works for the test program
and on my Fedora system.
security/smack/smack_lsm.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
index 50c536cad85b..b0bb36419aeb 100644
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
@@ -2857,7 +2857,9 @@ static int smack_socket_connect(struct socket *sock, struct sockaddr *sap,
rc = smack_netlabel_send(sock->sk, (struct sockaddr_in *)sap);
break;
case PF_INET6:
- if (addrlen < SIN6_LEN_RFC2133 || sap->sa_family != AF_INET6)
+ if (addrlen < SIN6_LEN_RFC2133)
+ return 0;
+ if (sap->sa_family != AF_INET6)
return -EINVAL;
#ifdef SMACK_IPV6_SECMARK_LABELING
rsp = smack_ipv6host_label(sip);
@@ -3694,8 +3696,9 @@ static int smack_socket_sendmsg(struct socket *sock, struct msghdr *msg,
break;
#if IS_ENABLED(CONFIG_IPV6)
case AF_INET6:
- if (msg->msg_namelen < SIN6_LEN_RFC2133 ||
- sap->sin6_family != AF_INET6)
+ if (msg->msg_namelen < SIN6_LEN_RFC2133)
+ return 0;
+ if (sap->sin6_family != AF_INET6)
return -EINVAL;
#ifdef SMACK_IPV6_SECMARK_LABELING
rsp = smack_ipv6host_label(sap);
Powered by blists - more mailing lists