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

Commit 1cebc8ce authored by Paras Sharma's avatar Paras Sharma
Browse files

bus: mhi: fix potential out-of-bound access



In the mhi_sat_isvalid_header function if the length is less than
the size of header then there can be out-of-bound access.

So fix the len check in the function.

Change-Id: I80f1556557b1bf2f30c07f6377bd6e3db48712b3
Signed-off-by: default avatarKrishna chaitanya chundru <quic_krichai@quicinc.com>
Signed-off-by: default avatarParas Sharma <quic_parass@quicinc.com>
parent 759c5fad
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -358,7 +358,7 @@ static struct mhi_sat_device *find_sat_dev_by_id(
static bool mhi_sat_isvalid_header(struct sat_header *hdr, int len)
{
	/* validate payload size */
	if (len >= sizeof(*hdr) && (len != hdr->payload_size + sizeof(*hdr)))
	if (len < sizeof(*hdr) || len != hdr->payload_size + sizeof(*hdr))
		return false;

	/* validate SAT IPC version */