diff options
| author | Rahul Sharma <sharah@codeaurora.org> | 2017-12-29 14:01:12 +0530 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-01-17 06:23:55 -0800 |
| commit | 4d4fccf24eb9330f3add471255cc55d4279da025 (patch) | |
| tree | bd15dfd883524cabdf835e1cd9d268c37f37dab3 /include/linux/fpga/fpga-mgr.h | |
| parent | b3b1b7012ce3bdd728f867114e08053b8b7b4fe7 (diff) | |
msm: ais: sensor: actuator: avoid accessing out of bound memory
Issue:
When total_steps is updated, after that, copy_from_user
fails with an error, then, i2c_reg_tbl is not allocated.
In this case, when calling msm_actuator_parse_i2c_params,
it lead to out-of-bound memory write.
Fix:
1) Assign total_steps to zero when error from copying.
2) Add NULL pointer check for i2c tbl.
3) Fixing the issue where the function can return
with an error code leaving "a_ctrl->i2c_reg_tbl"
and "a_ctrl->total_steps" out of sync.
Change-Id: Ib46deceb7bd8efff1cb606b894396e7016271dd3
Signed-off-by: Rahul Sharma <sharah@codeaurora.org>
Diffstat (limited to 'include/linux/fpga/fpga-mgr.h')
0 files changed, 0 insertions, 0 deletions
