Commit c79fa61c authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'inet-sk_error-tracers'



Alexander Aring says:

====================
net: sock: add tracers for inet socket errors

this patch series introduce tracers for sk_error_report socket callback
calls. The use-case is that a user space application can monitor them
and making an own heuristic about bad peer connections even over a
socket lifetime. To make a specific example it could be use in the Linux
cluster world to fence a "bad" behaving node. For now it's okay to only
trace inet sockets. Other socket families can introduce their own tracers
easily.

Example output with trace-cmd:

<idle>-0     [003]   201.799437: inet_sk_error_report: family=AF_INET protocol=IPPROTO_TCP sport=21064 dport=38941 saddr=192.168.122.57 daddr=192.168.122.251 saddrv6=::ffff:192.168.122.57 daddrv6=::ffff:192.168.122.251 error=104

- Alex

changes since v2:

- change "sk.sk_error_report(&ipc->sk);" to "sk_error_report(&ipc->sk);"
  in net/qrtr/qrtr.c
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 7f4e5c5b e6a3e443
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2134,7 +2134,7 @@ static void chtls_abort_req_rss(struct sock *sk, struct sk_buff *skb)
		sk->sk_err = ETIMEDOUT;

		if (!sock_flag(sk, SOCK_DEAD))
			sk->sk_error_report(sk);
			sk_error_report(sk);

		if (sk->sk_state == TCP_SYN_RECV && !abort_syn_rcv(sk, skb))
			return;
+1 −1
Original line number Diff line number Diff line
@@ -734,7 +734,7 @@ static void vhost_vsock_reset_orphans(struct sock *sk)
	vsk->peer_shutdown = SHUTDOWN_MASK;
	sk->sk_state = SS_UNCONNECTED;
	sk->sk_err = ECONNRESET;
	sk->sk_error_report(sk);
	sk_error_report(sk);
}

static int vhost_vsock_dev_release(struct inode *inode, struct file *file)
+1 −1
Original line number Diff line number Diff line
@@ -347,7 +347,7 @@ static inline void sk_psock_report_error(struct sk_psock *psock, int err)
	struct sock *sk = psock->sk;

	sk->sk_err = err;
	sk->sk_error_report(sk);
	sk_error_report(sk);
}

struct sk_psock *sk_psock_init(struct sock *sk, int node);
+2 −0
Original line number Diff line number Diff line
@@ -2281,6 +2281,8 @@ static inline int sock_error(struct sock *sk)
	return -err;
}

void sk_error_report(struct sock *sk);

static inline unsigned long sock_wspace(struct sock *sk)
{
	int amt = 0;
+1 −1
Original line number Diff line number Diff line
@@ -469,7 +469,7 @@ static inline bool tls_is_sk_tx_device_offloaded(struct sock *sk)
static inline void tls_err_abort(struct sock *sk, int err)
{
	sk->sk_err = err;
	sk->sk_error_report(sk);
	sk_error_report(sk);
}

static inline bool tls_bigint_increment(unsigned char *seq, int len)
Loading