soc: qcom: mem-buf: Limit the number of input ACL entries

The number of ACL entries is currently not sanitized, which
can allow for unreasonably large ACL to be allocated for
later processing. Allowing for this to happen doesn't make much
sense, as there aren't any valid usecases that require a large
ACL, so restrict the number of ACL entries to 16. Also, while we're
here, fix up some of the error handling in a few places.

Change-Id: I5d1371ed180608486bcde1e208a36782986313af
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
This commit is contained in:
Isaac J. Manjarres 2020-05-12 11:37:21 -07:00
commit 0d121e6dc3
2 changed files with 26 additions and 11 deletions

View file

@ -31,6 +31,8 @@ enum mem_buf_mem_type {
(MEM_BUF_PERM_FLAG_READ | MEM_BUF_PERM_FLAG_WRITE |\
MEM_BUF_PERM_FLAG_EXEC)
#define MEM_BUF_MAX_NR_ACL_ENTS 16
/**
* struct acl_entry: Represents the access control permissions for a VMID.
* @vmid: The mem-buf VMID specifier associated with the VMID that will access