diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2018-10-13 21:40:23 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-10-13 21:40:21 -0700 |
| commit | 43819b656c1e23a21049d20ff1be4c7d97923c22 (patch) | |
| tree | 83393dac2957ea41bfce416f59af1f12d2c7afcd | |
| parent | bbaf766c22fc4745fbf4494037a62a21ad7c5ecc (diff) | |
| parent | 1eaf1fb7f475fe027785f6739a5af0b1aae0a9b6 (diff) | |
Merge "soc: hab: add size checking when hab import buffer"
| -rw-r--r-- | drivers/soc/qcom/hab/hab_mimex.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/soc/qcom/hab/hab_mimex.c b/drivers/soc/qcom/hab/hab_mimex.c index 00c6c475fa92..efa4bb383ec6 100644 --- a/drivers/soc/qcom/hab/hab_mimex.c +++ b/drivers/soc/qcom/hab/hab_mimex.c @@ -376,6 +376,13 @@ int hab_mem_import(struct uhab_context *ctx, } spin_unlock_bh(&ctx->imp_lock); + if ((exp->payload_count << PAGE_SHIFT) != param->sizebytes) { + pr_err("input size %d don't match buffer size %d\n", + param->sizebytes, exp->payload_count << PAGE_SHIFT); + ret = -EINVAL; + goto err_imp; + } + if (!found) { pr_err("Fail to get export descriptor from export id %d\n", param->exportid); |
