diff options
author | Matthew Smith <mgsmith@netgate.com> | 2023-11-16 02:27:29 +0000 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2023-12-01 19:29:47 +0000 |
commit | b75bde18c44420021ae9800b584b1c644fed2a87 (patch) | |
tree | 668827ec9be12bd6c82515f5f88feaf7127c2fda /extras/vagrant/.gitignore | |
parent | a56e75fd71f8dfdc873ed6c14fecdfec563e3888 (diff) |
ipsec: keep esp encrypt pointer and index synced
Type: fix
In esp_encrypt_inline(), an index and pointer to the last processed SA
are stored. If the next packet uses the same SA, we defer on updating
counters until a different SA is encountered.
The pointer was being retrieved, then the SA was checked to see if the
packet should be dropped due to no crypto/integ algs, then the index was
updated. If the check failed, we would skip further processing and now
the pointer refers to a different SA than the index. When you have a
batch of packets that are encrypted using an SA followed by a packet
which is dropped for no algs and then more packets to be encrypted using
the original SA, the packets that arrive after the one that was dropped
end up being processed using a pointer that refers to the wrong SA data.
This can result in a segv.
Update the current_sa_index at the same time that the sa0 pointer is
updated.
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Change-Id: I65f1511a37475b4f737f5e1b51749c0a30e88806
(cherry picked from commit dac9e566cd16fc375fff14280b37cb5135584fc6)
Diffstat (limited to 'extras/vagrant/.gitignore')
0 files changed, 0 insertions, 0 deletions