nvmet-tcp: Ensure old keys are freed before replacing new ones#744
nvmet-tcp: Ensure old keys are freed before replacing new ones#744blktests-ci[bot] wants to merge 1 commit intolinus-master_basefrom
Conversation
|
Upstream branch: d60bc14 |
|
Upstream branch: d60bc14 |
26dd3a4 to
f51b56e
Compare
6b4d829 to
ceec5ed
Compare
|
Upstream branch: b4e0758 |
f51b56e to
bfabb65
Compare
ceec5ed to
3b54e52
Compare
|
Upstream branch: 6596a02 |
bfabb65 to
b1a7eac
Compare
3b54e52 to
6a0b974
Compare
|
Upstream branch: 507bd4b |
b1a7eac to
7f70317
Compare
6a0b974 to
59ca59b
Compare
|
Upstream branch: dd6c438 |
7f70317 to
067ff26
Compare
94f0438 to
857ada9
Compare
|
Upstream branch: dd6c438 |
067ff26 to
05acdaf
Compare
857ada9 to
482ce5b
Compare
|
Upstream branch: dca922e |
05acdaf to
ce07672
Compare
482ce5b to
5a9f7c7
Compare
Previously after the host sends a REPLACETLSPSK we freed the TLS keys as part of calling nvmet_auth_sq_free() on success. A recent change ensured we don't free the keys, allowing REPLACETLSPSK to work. But that fix results in a kernel memory leak when running ``` nvme_trtype=loop ./check nvme/041 nvme/042 nvme/043 nvme/044 nvme/045 nvme/051 nvme/052 echo scan > /sys/kernel/debug/kmemleak cat /sys/kernel/debug/kmemleak ``` We can't free the keys on a successful DHCHAP operation, otherwise the next REPLACETLSPSK will fail, so instead let's free them before we replace them as part of nvmet_auth_challenge(). This ensures that REPLACETLSPSK works, while also avoiding any memory leaks. Fixes: 2e6eb6b ("nvmet-tcp: Don't free SQ on authentication success") Signed-off-by: Alistair Francis <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
|
Upstream branch: e75a43c |
ce07672 to
b0eafac
Compare
Pull request for series with
subject: nvmet-tcp: Ensure old keys are freed before replacing new ones
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1081786