[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1478064420-11601-1-git-send-email-subashab@codeaurora.org>
Date: Tue, 1 Nov 2016 23:27:00 -0600
From: Subash Abhinov Kasiviswanathan <subashab@...eaurora.org>
To: netdev@...r.kernel.org
Cc: Subash Abhinov Kasiviswanathan <subashab@...eaurora.org>,
Eric Dumazet <edumazet@...gle.com>
Subject: [PATCH net] net: Check for fullsock in sock_i_uid()
sock_i_uid() acquires the sk_callback_lock which does not exist
for sockets in TCP_NEW_SYN_RECV state. This results in errors
showing up as spinlock bad magic.
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@...eaurora.org>
Cc: Eric Dumazet <edumazet@...gle.com>
---
net/core/sock.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/net/core/sock.c b/net/core/sock.c
index c73e28f..af15ef0 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1727,7 +1727,10 @@ void sock_efree(struct sk_buff *skb)
kuid_t sock_i_uid(struct sock *sk)
{
- kuid_t uid;
+ kuid_t uid = GLOBAL_ROOT_UID;
+
+ if (!sk_fullsock(sk))
+ return uid;
read_lock_bh(&sk->sk_callback_lock);
uid = sk->sk_socket ? SOCK_INODE(sk->sk_socket)->i_uid : GLOBAL_ROOT_UID;
--
1.9.1
Powered by blists - more mailing lists