소스 검색

msm: eva: Correction in the buffer validity check

Offset of kmd_arg is expected to be in words (As we are feeding the
offset in word size from UMD lib). Whereas the validity check function
treats it as bytes which is wrong. This might lead to crash if lager offset
is feed from UMD via ioctl call.

Change-Id: I7de76cea5abe9a34d4194d041af7a3af7550d86d
Signed-off-by: Aniruddh Sharma <[email protected]>
Aniruddh Sharma 3 년 전
부모
커밋
c96b96ee2d
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      msm/eva/msm_cvp.h

+ 1 - 1
msm/eva/msm_cvp.h

@@ -22,7 +22,7 @@ static inline bool is_buf_param_valid(u32 buf_num, u32 offset)
 	if (buf_num > max_buf_num)
 		return false;
 
-	if ((offset + buf_num * sizeof(struct cvp_buf_type)) >
+	if ((offset * sizeof(u32) + buf_num * sizeof(struct cvp_buf_type)) >
 			sizeof(struct eva_kmd_hfi_packet))
 		return false;