Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
	}