lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 16 Oct 2017 15:05:45 -0700
From:   Cong Wang <xiyou.wangcong@...il.com>
To:     David Ahern <dsahern@...il.com>
Cc:     Linux Kernel Network Developers <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next] tcp: Check daddr_cache before use in tracepoint

On Mon, Oct 16, 2017 at 2:55 PM, David Ahern <dsahern@...il.com> wrote:
> On 10/16/17 3:46 PM, Cong Wang wrote:
>> Well, for NULL case, the entry->saddr_v6 will not be filled with
>> your patch.
>
> I think you meant daddr_v6 and yes it will not get filled in, but 0 is
> better than a panic ;-)
>

Sure, but we can do even better with sk->sk_v6_daddr.


>>
>> How about using sk->sk_v6_daddr?
>>
>
> That works, but then both addresses should come from sk and not np:

Yes.

>
> diff --git a/include/trace/events/tcp.h b/include/trace/events/tcp.h
> index 1ffab6d96e94..7989c2dcedf1 100644
> --- a/include/trace/events/tcp.h
> +++ b/include/trace/events/tcp.h
> @@ -46,9 +46,9 @@ TRACE_EVENT(tcp_retransmit_skb,
>
>                 if (np) {
>                         pin6 = (struct in6_addr *)__entry->saddr_v6;
> -                       *pin6 = np->saddr;
> +                       *pin6 = sk->sk_v6_rcv_saddr;
>                         pin6 = (struct in6_addr *)__entry->daddr_v6;
> -                       *pin6 = *(np->daddr_cache);
> +                       *pin6 = sk->sk_v6_daddr;
>                 } else {
>                         pin6 = (struct in6_addr *)__entry->saddr_v6;
>                         ipv6_addr_set_v4mapped(inet->inet_saddr, pin6);
>
>
> So np is just a trigger for IPv6 versus v4 mapped.
>
> I do have a question about why ipv4 addresses are non-NULL:

If you really mean non-NULL, they are addresses, not pointers to
addresses.

Or if you mean non-zero, they are set to LOOPBACK4_IPV6
which is what I expect.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ