diff options
author | Petr Tesarik <[email protected]> | 2023-11-02 10:36:49 +0100 |
---|---|---|
committer | Christoph Hellwig <[email protected]> | 2023-11-03 09:33:45 +0100 |
commit | a5e3b127455d073f146a2a4ea3e7117635d34c5c (patch) | |
tree | ed771584381cacd079132e2fca843c2f0df90020 /net/unix/sysctl_net_unix.c | |
parent | 8f6f76a6a29f36d2f3e4510d0bde5046672f6924 (diff) |
swiotlb: do not free decrypted pages if dynamic
Fix these two error paths:
1. When set_memory_decrypted() fails, pages may be left fully or partially
decrypted.
2. Decrypted pages may be freed if swiotlb_alloc_tlb() determines that the
physical address is too high.
To fix the first issue, call set_memory_encrypted() on the allocated region
after a failed decryption attempt. If that also fails, leak the pages.
To fix the second issue, check that the TLB physical address is below the
requested limit before decrypting.
Let the caller differentiate between unsuitable physical address (=> retry
from a lower zone) and allocation failures (=> no point in retrying).
Cc: [email protected]
Fixes: 79636caad361 ("swiotlb: if swiotlb is full, fall back to a transient memory pool")
Signed-off-by: Petr Tesarik <[email protected]>
Reviewed-by: Rick Edgecombe <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Diffstat (limited to 'net/unix/sysctl_net_unix.c')
0 files changed, 0 insertions, 0 deletions