]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 3437] ntpd tries to open socket with AF_UNSPEC domain
authorJuergen Perlinger <perlinger@ntp.org>
Fri, 13 Oct 2017 07:18:19 +0000 (09:18 +0200)
committerJuergen Perlinger <perlinger@ntp.org>
Fri, 13 Oct 2017 07:18:19 +0000 (09:18 +0200)
bk: 59e068bbrtYfNZ4HJDedf2CkNHpeCw

ChangeLog
ntpd/ntp_io.c

index a1a1cfae45a59975bb12958d206f6c0a48e631b5..6c176305019080fa84034c64f8782c572f45e4b2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+---
+* [Bug 3437] ntpd tries to open socket with AF_UNSPEC domain
+ - applied patch (with mods) by Miroslav Lichvar <perlinger@ntp.org>
+
 ---
 (4.2.8p10-win-beta1) 2017/03/21 Released by Harlan Stenn <stenn@ntp.org>
 (4.2.8p10)
index fe62ec566cda4d9401b1472c912db668147b5005..20ef13a0cd84d9eba72a7c6be33ffaa22577300c 100644 (file)
@@ -3960,6 +3960,17 @@ findlocalinterface(
        DPRINTF(4, ("Finding interface for addr %s in list of addresses\n",
                    stoa(addr)));
 
+       /* [Bug 3437] The dummy POOL peer comes in with an AF of
+        * zero. This is bound to fail, but on the way to nowhere it
+        * triggers a security incident on SELinux.
+        *
+        * Checking the condition and failing early is probably a good
+        * advice, and even saves us some syscalls in that case.
+        * Thanks to Miroslav Lichvar for finding this.
+        */
+       if (AF_UNSPEC == AF(addr))
+               return NULL;
+
        s = socket(AF(addr), SOCK_DGRAM, 0);
        if (INVALID_SOCKET == s)
                return NULL;