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] [day] [month] [year] [list]
Date:   Tue, 05 Dec 2017 15:11:59 -0500 (EST)
From:   David Miller <davem@...emloft.net>
To:     laoar.shao@...il.com
Cc:     songliubraving@...com, marcelo.leitner@...il.com,
        kuznet@....inr.ac.ru, yoshfuji@...ux-ipv6.org, rostedt@...dmis.org,
        bgregg@...flix.com, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 net-next] net/tcp: trace all TCP/IP state transition
 with tcp_set_state tracepoint

From: Yafang Shao <laoar.shao@...il.com>
Date: Tue,  5 Dec 2017 14:12:42 +0000

>  }
>  
> +/* For tcp_set_state tracepoint */
> +void sk_state_store(struct sock *sk, int newstate);
> +
>  void sock_enable_timestamp(struct sock *sk, int flag);
>  int sock_get_timestamp(struct sock *, struct timeval __user *);
>  int sock_get_timestampns(struct sock *, struct timespec __user *);
 ...
> --- a/net/ipv4/tcp.c
> +++ b/net/ipv4/tcp.c
> @@ -2036,6 +2036,18 @@ int tcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int nonblock,
>  }
>  EXPORT_SYMBOL(tcp_recvmsg);
>  
> +void sk_state_store(struct sock *sk, int newstate)
> +{
> +	trace_tcp_set_state(sk, sk->sk_state, newstate);
> +	__sk_state_store(sk, newstate);
> +}
> +

Please do not define a sock generic function in the TCP protocol code.

If it belongs in TCP and is only used by TCP, give is a tcp specific
name prefix rather than a generic sk_ one.

This is even more ugly because I see that inet_connection_sock.c and
inet_hashtables.c uses this thing too.  Which means that DCCP sockets
will trigger this tracepoint.

inet_connection_sock.c and inet_hashtables.c are not guaranteed to
operate on only TCP sockets, and you must make amends to handle that
properly.

Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ