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-next>] [day] [month] [year] [list]
Message-ID: <e6e875ca-096f-924d-c1c6-f40339ae3a0c@oktetlabs.ru>
Date:   Thu, 9 Aug 2018 11:13:07 +0300
From:   Damir Mansurov <dnman@...etlabs.ru>
To:     netdev@...r.kernel.org
Cc:     "Alexandra N. Kossovsky" <Alexandra.Kossovsky@...etlabs.ru>
Subject: The recvmsg() with IP_PKTINFO for local addresses returns various
 ipi_ifindex

Greetings,

I use the IP_PKTINFO to detect ipi_ifindex from which the packet was 
arrived, it used to work for local addresses also.

For local addresses ipi_ifindex always returned 1, but starting from 
Linux 4.14 ip_ifindex began to return various values.

Example host configuration:
1:  lo:   127.0.0.1
2:  eth0: 192.168.3.45
3:  eth1: 192.168.4.45

I use sendto() with addresses {127.0.0.1, 192.168.3.45 and 
192.168.4.45}, call recvmsg() and than use standard procedure to get 
ipi_ifindex, it shows results:

                  |      ipi_ifindex     |      ipi_ifindex
  sendto(address) |   Linux ver < 4.14   |   Linux ver >= 4.14
---------------------------------------------------------------
   127.0.0.1      |          1           |           1
---------------------------------------------------------------
   192.168.3.45   |          1           |           2
---------------------------------------------------------------
   192.168.4.45   |          1           |           3


It seems that this behavior depends from commit:
net: ipv4: set orig_oif based on fib result for local traffic

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-4.14.y&id=839da4d98960bcc68e6b7b945b33ad3916ec1e92

I believe that ipi_ifindex for local addresses should be 1.
Is there a Bug for Linux >= 4.14 or is this a valid behavior?



************************
Thanks,
Damir Mansurov
dnman@...etlabs.ru

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ