summaryrefslogtreecommitdiffstats
path: root/tools/testing/nvdimm
diff options
context:
space:
mode:
authorVishal Verma <vishal.l.verma@intel.com>2017-11-07 15:48:21 -0700
committerDan Williams <dan.j.williams@intel.com>2017-11-08 08:49:48 -0800
commit41cb3301c04d7f0b046ed296a34ef261c456dde8 (patch)
treeb4f6a9caced93f32fbbea2f2d34f84332e9ad14f /tools/testing/nvdimm
parent5e096ef3b29e6113a7aa6a7dc4871987efa99bcb (diff)
downloadlinux-41cb3301c04d7f0b046ed296a34ef261c456dde8.tar.gz
linux-41cb3301c04d7f0b046ed296a34ef261c456dde8.tar.bz2
linux-41cb3301c04d7f0b046ed296a34ef261c456dde8.zip
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>
Diffstat (limited to 'tools/testing/nvdimm')
-rw-r--r--tools/testing/nvdimm/test/nfit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c
index 79c5cb23693f..edab68c2e221 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;
}