forked from luck/tmp_suning_uos_patched
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: Dariusz Dokupil <dariusz.dokupil@intel.com> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
parent
5e096ef3b2
commit
41cb3301c0
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user