diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2016-02-15 12:55:06 +1100 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2016-02-16 13:44:26 +1100 |
commit | f8626985c7c2485c423ce9f448028f81535b0ecc (patch) | |
tree | f6f7a2b997299bf4dcaa0571a754080795f77960 /fs/fhandle.c | |
parent | 366baf28ee3fc22dea504a0bddf8edd1e9bcee70 (diff) |
KVM: PPC: Account TCE-containing pages in locked_vm
At the moment pages used for TCE tables (in addition to pages addressed
by TCEs) are not counted in locked_vm counter so a malicious userspace
tool can call ioctl(KVM_CREATE_SPAPR_TCE) as many times as
RLIMIT_NOFILE and lock a lot of memory.
This adds counting for pages used for TCE tables.
This counts the number of pages required for a table plus pages for
the kvmppc_spapr_tce_table struct (TCE table descriptor) itself.
This changes release_spapr_tce_table() to store @npages on stack to
avoid calling kvmppc_stt_npages() in the loop (tiny optimization,
probably).
This does not change the amount of used memory.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'fs/fhandle.c')
0 files changed, 0 insertions, 0 deletions