From 41cb3301c04d7f0b046ed296a34ef261c456dde8 Mon Sep 17 00:00:00 2001 From: Vishal Verma Date: Tue, 7 Nov 2017 15:48:21 -0700 Subject: 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 Signed-off-by: Vishal Verma Signed-off-by: Dan Williams --- tools/testing/nvdimm/test/nfit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c index 79c5cb2..edab68c 100644 --- a/tools/testing/nvdimm/test/nfit.c +++ b/tools/testing/nvdimm/test/nfit.c @@ -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; } -- cgit v1.1