Commit 41cb3301 authored by Vishal Verma's avatar Vishal Verma Committed by Dan Williams

tools/testing/nvdimm: stricter bounds checking for error injection commands

Ensure that the in/out sizes passed in the nd_cmd_package are sane for
the fixed output size commands (i.e. inject error and clear injected
error).
Reported-by: default avatarDariusz Dokupil <dariusz.dokupil@intel.com>
Signed-off-by: default avatarVishal Verma <vishal.l.verma@intel.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 5e096ef3
......@@ -488,7 +488,7 @@ static int nfit_test_cmd_ars_error_inject(struct nfit_test *t,
{
int rc;
if (buf_len < sizeof(*err_inj)) {
if (buf_len != sizeof(*err_inj)) {
rc = -EINVAL;
goto err;
}
......@@ -519,7 +519,7 @@ static int nfit_test_cmd_ars_inject_clear(struct nfit_test *t,
{
int rc;
if (buf_len < sizeof(*err_clr)) {
if (buf_len != sizeof(*err_clr)) {
rc = -EINVAL;
goto err;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment