nfit_test: stricter bounds checking for error injection commands
Vishal Verma
maintainerPATCH 1/1 nfit_test: 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).
Cc Dan Williams <[email protected]>
Signed-off-by Vishal Verma <[email protected]>
--- tools/testing/nvdimm/test/nfit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/nvdimm/test/nfit.c +2 -2
@@ -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; }
Signature · 6 lines
2.9.5 _______________________________________________ Linux-nvdimm mailing list [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm
Quoted 6 lines · Vishal Verma
Ensure that the in/out sizes passed in the
nd_cmd_packageare sane for the fixed output size commands (i.e. inject error and clear injected error).Cc Dan Williams <[email protected]>Signed-off-by Vishal Verma <[email protected]>
Looks good, I'll also add a:
Reported-by Dariusz Dokupil <[email protected]>
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm