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-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 15 Feb 2019 22:49:47 +0800
From:   Yafang Shao <laoar.shao@...il.com>
To:     davem@...emloft.net
Cc:     daniel@...earbox.net, edumazet@...gle.com, netdev@...r.kernel.org,
        shaoyafang@...iglobal.com, Yafang Shao <laoar.shao@...il.com>
Subject: [net-next 5/5] net: sock: remove the definition of SOCK_DEBUG()

As SOCK_DEBUG() isn't used any more, we can get ride of it now.

Regarding the SO_DEBUG in sock_{s,g}etsockopt, I think it is better to
keep as-is, because if we return an errno to tell the application that
this optname isn't supported, it may break the application.
The application still can use this option but don't take any effect from
now on.

Signed-off-by: Yafang Shao <laoar.shao@...il.com>
---
 include/net/sock.h | 19 -------------------
 net/core/sock.c    |  3 +++
 2 files changed, 3 insertions(+), 19 deletions(-)

diff --git a/include/net/sock.h b/include/net/sock.h
index 6679f3c..4c6b599 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -74,25 +74,6 @@
 #include <net/smc.h>
 #include <net/l3mdev.h>
 
-/*
- * This structure really needs to be cleaned up.
- * Most of it is for TCP, and not used by any of
- * the other protocols.
- */
-
-/* Define this to get the SOCK_DBG debugging facility. */
-#define SOCK_DEBUGGING
-#ifdef SOCK_DEBUGGING
-#define SOCK_DEBUG(sk, msg...) do { if ((sk) && sock_flag((sk), SOCK_DBG)) \
-					printk(KERN_DEBUG msg); } while (0)
-#else
-/* Validate arguments and do nothing */
-static inline __printf(2, 3)
-void SOCK_DEBUG(const struct sock *sk, const char *msg, ...)
-{
-}
-#endif
-
 /* This is the per-socket lock.  The spinlock provides a synchronization
  * between user contexts and software interrupt processing, whereas the
  * mini-semaphore synchronizes multiple users amongst themselves.
diff --git a/net/core/sock.c b/net/core/sock.c
index 71ded4d..a980ff3 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -753,6 +753,9 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
 
 	switch (optname) {
 	case SO_DEBUG:
+		/* This option doesn't take effect now,
+		 * but we need to keep it for backward compatibility.
+		 */
 		if (val && !capable(CAP_NET_ADMIN))
 			ret = -EACCES;
 		else
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ