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]
Message-ID: <CA+FuTSf1AtHJtwwDZmPvH7+wvMYTX9BU4=PUVEJOp0ZJix=TQw@mail.gmail.com>
Date:	Tue, 23 Jun 2015 15:08:32 -0400
From:	Willem de Bruijn <willemb@...gle.com>
To:	Julian Anastasov <ja@....bg>
Cc:	David Miller <davem@...emloft.net>,
	Network Development <netdev@...r.kernel.org>
Subject: Re: [PATCH net] ip: report the original address of ICMP messages

On Tue, Jun 23, 2015 at 2:55 PM, Julian Anastasov <ja@....bg> wrote:
>
>         Hello,
>
> On Tue, 23 Jun 2015, Willem de Bruijn wrote:
>
>> The ping utility from iputils relies on cmsg IP_RECVERR to get
>> the source address on icmp errors, not on msg_name, so that
>> worked for me both before and after applying the patch. I used
>> `ping -t 2 $hostname` to trigger a TTL exceeded. Perhaps you used
>> a different tool or test? In any case, the change looks fine to me.
>> Thanks for preparing the patch.
>
>
> # rpm -qf `which ping`
> iputils-20140519-1.fc20.i686
>
>         It is using IP_RECVERR and may be relying only on
> original address returned in msg_name from MSG_ERRQUEUE.

It's not very important, in that even if ping does not use this
msg_name, another tool very well might. But from ping.c in that
srpm:

        res = recvmsg(icmp_sock, &msg, MSG_ERRQUEUE|MSG_DONTWAIT);
...
        e = NULL;
        for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) {
                if (cmsg->cmsg_level == SOL_IP) {
                        if (cmsg->cmsg_type == IP_RECVERR)
                                e = (struct sock_extended_err *)CMSG_DATA(cmsg);
                }
        }
...
        } else if (e->ee_origin == SO_EE_ORIGIN_ICMP) {
                struct sockaddr_in *sin = (struct sockaddr_in*)(e+1);
...
                        printf("From %s icmp_seq=%u ",
pr_addr(sin->sin_addr.s_addr), ntohs(icmph.un.echo.sequence));



> May be it ignores the error if original address is missing
> or is different.
>
>         I didn't checked the ping source but I noticed that
> it does not print anything on the read from raw socket, only
> on IP_RECVERR. I noticed it when my network connection
> failed. The incoming ICMP packet from my router was
> DEST_UNREACH(type=3), HOST_UNREACH(code=1) but simple
> REJECT rule in OUTPUT can do the same.

>
> Regards
>
> --
> Julian Anastasov <ja@....bg>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ