[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c0c9ee18-98f6-9888-4b80-c6e3e5a4a4f4@gmail.com>
Date: Sun, 5 Jan 2020 21:20:48 -0700
From: David Ahern <dsahern@...il.com>
To: Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>
Cc: Casey Schaufler <casey@...aufler-ca.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: commit b9ef5513c99b breaks ping to ipv6 linklocal addresses on
debian buster
On 1/5/20 8:51 PM, Tetsuo Handa wrote:
> diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
> index ecea41ce919b..5b2177724d5e 100644
> --- a/security/smack/smack_lsm.c
> +++ b/security/smack/smack_lsm.c
> @@ -2810,7 +2810,7 @@ static int smack_socket_bind(struct socket *sock, struct sockaddr *address,
> if (sock->sk != NULL && sock->sk->sk_family == PF_INET6) {
> if (addrlen < SIN6_LEN_RFC2133 ||
> address->sa_family != AF_INET6)
> - return -EINVAL;
> + return 0;
> smk_ipv6_port_label(sock, address);
> }
> return 0;
>
Hi:
The failure is the connect function, not the bind.
This change seems more appropriate to me (and fixes the failure):
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
index ecea41ce919b..ce5e3be7c111 100644
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
@@ -2854,7 +2854,7 @@ 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 -EINVAL;
#ifdef SMACK_IPV6_SECMARK_LABELING
rsp = smack_ipv6host_label(sip);
ie., if the socket family is AF_INET6 the address length should be an
IPv6 address. The family in the sockaddr is not as important.
Powered by blists - more mailing lists