linux/net/rxrpc
David Howells 33c40e242c rxrpc: Correctly handle ack at end of client call transmit phase
Normally, the transmit phase of a client call is implicitly ack'd by the
reception of the first data packet of the response being received.
However, if a security negotiation happens, the transmit phase, if it is
entirely contained in a single packet, may get an ack packet in response
and then may get aborted due to security negotiation failure.

Because the client has shifted state to RXRPC_CALL_CLIENT_AWAIT_REPLY due
to having transmitted all the data, the code that handles processing of the
received ack packet doesn't note the hard ack the data packet.

The following abort packet in the case of security negotiation failure then
incurs an assertion failure when it tries to drain the Tx queue because the
hard ack state is out of sync (hard ack means the packets have been
processed and can be discarded by the sender; a soft ack means that the
packets are received but could still be discarded and rerequested by the
receiver).

To fix this, we should record the hard ack we received for the ack packet.

The assertion failure looks like:

	RxRPC: Assertion failed
	1 <= 0 is false
	0x1 <= 0x0 is false
	------------[ cut here ]------------
	kernel BUG at ../net/rxrpc/ar-ack.c:431!
	...
	RIP: 0010:[<ffffffffa006857b>]  [<ffffffffa006857b>] rxrpc_rotate_tx_window+0xbc/0x131 [af_rxrpc]
	...

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-11-24 17:14:50 -05:00
..
af_rxrpc.c KEYS: Merge the type-specific data with the payload data 2015-10-21 15:18:36 +01:00
ar-accept.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ar-ack.c rxrpc: Correctly handle ack at end of client call transmit phase 2015-11-24 17:14:50 -05:00
ar-call.c af_rxrpc: Keep rxrpc_call pointers in a hashtable 2014-03-04 10:36:53 +00:00
ar-connection.c mm, page_alloc: distinguish between being unable to sleep, unwilling to sleep and avoiding waking kswapd 2015-11-06 17:50:42 -08:00
ar-connevent.c rxrpc: Kill set but unused variable 'sp' in rxrpc_process_connection() 2011-05-19 18:35:58 -04:00
ar-error.c ip: fix error queue empty skb handling 2015-03-08 23:01:54 -04:00
ar-input.c RxRPC: Handle VERSION Rx protocol packets 2015-04-01 16:31:26 +01:00
ar-internal.h rxrpc: Replace get_seconds with ktime_get_seconds 2015-09-20 21:53:56 -07:00
ar-key.c KEYS: Merge the type-specific data with the payload data 2015-10-21 15:18:36 +01:00
ar-local.c net: Add a struct net parameter to sock_create_kern 2015-05-11 10:50:17 -04:00
ar-output.c KEYS: Merge the type-specific data with the payload data 2015-10-21 15:18:36 +01:00
ar-peer.c net/rxrpc/ar-peer.c: remove invalid reference to list iterator variable 2012-07-09 15:24:33 -07:00
ar-proc.c net: replace NIPQUAD() in net/*/ 2008-10-31 00:54:56 -07:00
ar-recvmsg.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-03-20 18:51:09 -04:00
ar-security.c KEYS: Merge the type-specific data with the payload data 2015-10-21 15:18:36 +01:00
ar-skbuff.c af_rxrpc: Improve ACK production 2014-02-26 17:25:07 +00:00
ar-transport.c rxrpc: Replace get_seconds with ktime_get_seconds 2015-09-20 21:53:56 -07:00
Kconfig net/rxrpc: remove depends on CONFIG_EXPERIMENTAL 2013-01-11 11:40:02 -08:00
Makefile af_rxrpc: Add sysctls for configuring RxRPC parameters 2014-02-26 17:25:06 +00:00
rxkad.c KEYS: Merge the type-specific data with the payload data 2015-10-21 15:18:36 +01:00
sysctl.c af_rxrpc: Expose more RxRPC parameters via sysctls 2014-02-26 17:25:07 +00:00