[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20191116154113.7417-191-sashal@kernel.org>
Date: Sat, 16 Nov 2019 10:40:26 -0500
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Andrei Vagin <avagin@...il.com>,
Cyrill Gorcunov <gorcunov@...il.com>,
Xin Long <lucien.xin@...il.com>,
"David S . Miller" <davem@...emloft.net>,
Sasha Levin <sashal@...nel.org>, netdev@...r.kernel.org
Subject: [PATCH AUTOSEL 4.19 191/237] sock_diag: fix autoloading of the raw_diag module
From: Andrei Vagin <avagin@...il.com>
[ Upstream commit c34c1287778b080ed692c0a46a8e345206cc29e6 ]
IPPROTO_RAW isn't registred as an inet protocol, so
inet_protos[protocol] is always NULL for it.
Cc: Cyrill Gorcunov <gorcunov@...il.com>
Cc: Xin Long <lucien.xin@...il.com>
Fixes: bf2ae2e4bf93 ("sock_diag: request _diag module only when the family or proto has been registered")
Signed-off-by: Andrei Vagin <avagin@...il.com>
Reviewed-by: Cyrill Gorcunov <gorcunov@...il.com>
Signed-off-by: David S. Miller <davem@...emloft.net>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
net/core/sock.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/core/sock.c b/net/core/sock.c
index 6c11078217769..ba4f843cdd1d1 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -3347,6 +3347,7 @@ int sock_load_diag_module(int family, int protocol)
#ifdef CONFIG_INET
if (family == AF_INET &&
+ protocol != IPPROTO_RAW &&
!rcu_access_pointer(inet_protos[protocol]))
return -ENOENT;
#endif
--
2.20.1
Powered by blists - more mailing lists