If a packet arrives while the host is in the ESTABLISHED* state, it can only mean that it is receiving part of a multipacket request from a client. The CC value is first checked to verify that it is the correct value for this connection. The presence of the FIN flag in the packet, indicates that it is the last segment that will be received from this host, hence, the state can be updated, and the socket can be woken up because all the data it needs is ready. If there is no FIN, the data is simply queued until a FIN is seen.
In situations where a segment is delayed and one arrives out of sequence, TCP will recognise it by the sequence numbers of the packets. It will then wait until all the packets are received before passing it onto the user.
See appendix A.2.7.1 for the code.