summaryrefslogtreecommitdiff
path: root/proc.c
AgeCommit message (Expand)AuthorFilesLines
2016-04-17build: fix compilation warnings with _GNU_SOURCEarch3y1-1/+3
2015-12-17proc: Add function to execute process with argv listVadim Kochan1-0/+27
2015-07-17flowtop, netsniff-ng: Move process name extraction to own functionTobias Klauser1-0/+15
2013-06-04proc: move out process specific management functionsDaniel Borkmann1-0/+66
-remove&id=816c9fce12f3745abc959c0fca8ace1c2c51421c'>98af1e193f2abe3a28347fbbbc4cc12a45cdefb7 parent2e2ea51dec2ab6a81950d4b436eb66ebf45dd507 (diff)
rxrpc: Fix handling of the last packet in rxrpc_recvmsg_data()
The code for determining the last packet in rxrpc_recvmsg_data() has been using the RXRPC_CALL_RX_LAST flag to determine if the rx_top pointer points to the last packet or not. This isn't a good idea, however, as the input code may be running simultaneously on another CPU and that sets the flag *before* updating the top pointer. Fix this by the following means: (1) Restrict the use of RXRPC_CALL_RX_LAST to the input routines only. There's otherwise a synchronisation problem between detecting the flag and checking tx_top. This could probably be dealt with by appropriate application of memory barriers, but there's a simpler way. (2) Set RXRPC_CALL_RX_LAST after setting rx_top. (3) Make rxrpc_rotate_rx_window() consult the flags header field of the DATA packet it's about to discard to see if that was the last packet. Use this as the basis for ending the Rx phase. This shouldn't be a problem because the recvmsg side of things is guaranteed to see the packets in order. (4) Make rxrpc_recvmsg_data() return 1 to indicate the end of the data if: (a) the packet it has just processed is marked as RXRPC_LAST_PACKET (b) the call's Rx phase has been ended. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat