Unverified Commit f4c8a24a authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!14787 acpi: nfit: vmalloc-out-of-bounds Read in acpi_nfit_ctl

parents 05253633 0226254c
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -454,8 +454,13 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
	if (cmd_rc)
		*cmd_rc = -EINVAL;

	if (cmd == ND_CMD_CALL)
	if (cmd == ND_CMD_CALL) {
		if (!buf || buf_len < sizeof(*call_pkg))
			return -EINVAL;

		call_pkg = buf;
	}

	func = cmd_to_func(nfit_mem, cmd, call_pkg, &family);
	if (func < 0)
		return func;