Commit 6caaf10
tls: fix peeking with sync+async decryption
If we peek from 2 records with a currently empty rx_list, and the
first record is decrypted synchronously but the second record is
decrypted async, the following happens:
1. decrypt record 1 (sync)
2. copy from record 1 to the userspace's msg
3. queue the decrypted record to rx_list for future read(!PEEK)
4. decrypt record 2 (async)
5. queue record 2 to rx_list
6. call process_rx_list to copy data from the 2nd record
We currently pass copied=0 as skip offset to process_rx_list, so we
end up copying once again from the first record. We should skip over
the data we've already copied.
Seen with selftest tls.12_aes_gcm.recv_peek_large_buf_mult_recs
Fixes: 692d7b5 ("tls: Fix recvmsg() to be able to peek across multiple records")
Signed-off-by: Sabrina Dubroca <[email protected]>
Link: https://lore.kernel.org/r/1b132d2b2b99296bfde54e8a67672d90d6d16e71.1709132643.git.sd@queasysnail.net
Signed-off-by: Jakub Kicinski <[email protected]>1 parent f7fa16d commit 6caaf10
1 file changed
+6
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1950 | 1950 | | |
1951 | 1951 | | |
1952 | 1952 | | |
| 1953 | + | |
1953 | 1954 | | |
1954 | 1955 | | |
1955 | 1956 | | |
| |||
2097 | 2098 | | |
2098 | 2099 | | |
2099 | 2100 | | |
2100 | | - | |
| 2101 | + | |
| 2102 | + | |
2101 | 2103 | | |
| 2104 | + | |
2102 | 2105 | | |
2103 | 2106 | | |
2104 | 2107 | | |
| |||
2137 | 2140 | | |
2138 | 2141 | | |
2139 | 2142 | | |
2140 | | - | |
2141 | | - | |
| 2143 | + | |
| 2144 | + | |
2142 | 2145 | | |
2143 | 2146 | | |
2144 | 2147 | | |
| |||
0 commit comments