[<prev] [next>] [day] [month] [year] [list]
Message-ID: <964655d2-f74b-68b8-86d5-bc390eabd7a6@gmail.com>
Date: Wed, 8 Jan 2020 20:39:21 -0700
From: David Ahern <dsahern@...il.com>
To: 吉藤英明 <hideaki.yoshifuji@...aclelinux.com>,
Casey Schaufler <casey@...aufler-ca.com>
Cc: Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: commit b9ef5513c99b breaks ping to ipv6 linklocal addresses on
debian buster
On 1/8/20 6:53 PM, 吉藤英明 wrote:
> Hi,
>
> 2020年1月9日(木) 8:06 Casey Schaufler <casey@...aufler-ca.com
> <mailto:casey@...aufler-ca.com>>:
>
> This version should work, I think. Please verify. Thank you.
>
> ----
> security/smack/smack_lsm.c | 19 ++++++++++++-------
> 1 file changed, 12 insertions(+), 7 deletions(-)
>
> diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
> index 50c536cad85b..75b3953212e2 100644
> --- a/security/smack/smack_lsm.c
> +++ b/security/smack/smack_lsm.c
> @@ -2857,10 +2857,13 @@ 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)
> - return -EINVAL;
> + if (addrlen < SIN6_LEN_RFC2133)
> + return 0;
>
>
> Why don't we assume AF_UNSPEC as if it were AF_INET6 for AF_INET6
> sockets here?
>
it is not called out explicitly, but the rest of the proposed change:
#ifdef SMACK_IPV6_SECMARK_LABELING
- rsp = smack_ipv6host_label(sip);
+ if (sap->sa_family != AF_INET6)
+ rsp = NULL;
+ else
+ rsp = smack_ipv6host_label(sip);
if (rsp != NULL)
rc = smk_ipv6_check(ssp->smk_out, rsp, sip,
SMK_CONNECTING);
seems to handle AF_UNSPEC. Did you have something else in mind?
Powered by blists - more mailing lists