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]
Date:   Tue, 23 Apr 2019 17:00:23 +0800
From:   Haiqing Bai <>
To:     <>
CC:     <>, <>,
Subject: [PATCH] net: socket: Exit earlier from __sock_create if CONFIG_IPV6 is disabled

From: Radovan Prodanovic <>

Tests shows that it takes more than 10ms for __sock_create with
AF_INET6 returning failure if CONFIG_IPV6 is not set
The fix checks this case and make it exit with not supporting
error before calling request_module

if 'CONFIG_MODULE=y' and 'CONFIG_IPV6 is not set'
socket(AF_INET6, SOCK_STREAM, 0) can trigger this issue

Signed-off-by: Radovan Prodanovic <>
Signed-off-by: Abdel Elmahrad <>
Signed-off-by: Haiqing Bai <>
 net/socket.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/net/socket.c b/net/socket.c
index 8255f5bda0aa..7927c2bcad65 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -1339,6 +1339,11 @@ int __sock_create(struct net *net, int family, int type, int protocol,
 	if (type < 0 || type >= SOCK_MAX)
 		return -EINVAL;
+	if (family == AF_INET6)
+		return -EAFNOSUPPORT;
 	/* Compatibility.
 	   This uglymoron is moved from INET layer to here to avoid

Powered by blists - more mailing lists