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

Commit 567dfea0 authored by Mitchel Humpherys's avatar Mitchel Humpherys Committed by Vignesh Radhakrishnan
Browse files

msm: secure_buffer: warn if we get a non-1MB-aligned chunk



We only support securing memory in 1MB chunks. If we get an sg table
with any entries that are of any other size, WARN and bail.

Change-Id: Icd96984f03dafd246da51e879cd91c77ae986724
Signed-off-by: default avatarMitchel Humpherys <mitchelh@codeaurora.org>
parent d81481d4
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -148,6 +148,12 @@ static int secure_buffer_change_table(struct sg_table *table,
		WARN((tmp >> 32) & 0xffffffff,
			"%s: there are ones in the upper 32 bits of the sg at %p! They will be truncated! Address: 0x%llx\n",
			__func__, sg, tmp);
		if (unlikely(!size || (size % V2_CHUNK_SIZE))) {
			WARN(1,
				"%s: chunk %d has invalid size: 0x%x. Must be a multiple of 0x%x\n",
				__func__, i, size, V2_CHUNK_SIZE);
			return -EINVAL;
		}

		base = (u32)tmp;