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 10:51:24 -0800
From:   Joe Perches <joe@...ches.com>
To:     Eric Dumazet <edumazet@...gle.com>,
        Cong Wang <xiyou.wangcong@...il.com>
Cc:     Yafang Shao <laoar.shao@...il.com>,
        David Miller <davem@...emloft.net>,
        Daniel Borkmann <daniel@...earbox.net>,
        netdev <netdev@...r.kernel.org>, shaoyafang@...iglobal.com
Subject: Re: [net-next 5/5] net: sock: remove the definition of SOCK_DEBUG()

On Fri, 2019-02-15 at 10:22 -0800, Eric Dumazet wrote:
> On Fri, Feb 15, 2019 at 10:13 AM Cong Wang <xiyou.wangcong@...il.com> wrote:
> > On Fri, Feb 15, 2019 at 8:26 AM Eric Dumazet <edumazet@...gle.com> wrote:
> > > On Fri, Feb 15, 2019 at 6:50 AM Yafang Shao <laoar.shao@...il.com> wrote:
> > > > As SOCK_DEBUG() isn't used any more, we can get ride of it now.
> > > > 
> > > 
> > > No, we are still using this infrastructure from time to time.
> > > 
> > > I told you I agreed to remove the current (obsolete) TCP call sites,
> > >  I never suggested to remove SOCK_DEBUG() completely.
> > 
> > Since when do we upstream care about any out-of-tree users?
> > 
> > You can always carry a patch to keep it downstream if you want,
> > no one can stop you doing it.
> 
> Somehow the patch series seems to present things in this way :
> 
> Eric Dumazet suggested to remove completely the SOCK_DEBUG() interface.

Well, you kinda did.
It's certainly reasonable to interpret what you wrote as such.

On Tue, 2019-02-12 at 18:15 -0800, Eric Dumazet wrote:
> Just remove all SOCK_DEBUG() calls, there are leftovers of very ancient times.

My suggestion would be to undefine SOCK_DEBUGGING.

Something like:
---
 include/net/sock.h | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/include/net/sock.h b/include/net/sock.h
index 328cb7cb7b0b..7e39bdfa342a 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -81,14 +81,17 @@
  */
 
 /* Define this to get the SOCK_DBG debugging facility. */
-#define SOCK_DEBUGGING
+/* #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)
+#define SOCK_DEBUG(sk, fmt, ...)				\
+do {								\
+	if ((sk) && sock_flag((sk), SOCK_DBG))			\
+		printk(KERN_DEBUG fmt, ##__VA_ARGS__);		\
+} while (0)
 #else
 /* Validate arguments and do nothing */
-static inline __printf(2, 3)
-void SOCK_DEBUG(const struct sock *sk, const char *msg, ...)
+__printf(2, 3)
+static inline void SOCK_DEBUG(const struct sock *sk, const char *fmt, ...)
 {
 }
 #endif


Powered by blists - more mailing lists