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

Commit 97017d59 authored by Tharun Kumar Merugu's avatar Tharun Kumar Merugu Committed by Gerrit - the friendly Code Review server
Browse files

msm: ADSPRPC: use access_ok to validate pointers



Check the validity of the pointer in user space that you intend to
access. access_ok function simply checks that the address is likely
in user space, not in the kernel.

Change-Id: I936f73a2c2029f9e7ca12cc8fc06d0698e6710c0
Signed-off-by: default avatarTharun Kumar Merugu <mtharu@codeaurora.org>
parent 604e5586
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1443,6 +1443,10 @@ static int fastrpc_init_process(struct fastrpc_file *fl,
		inbuf.pgid = current->tgid;
		inbuf.namelen = strlen(current->comm) + 1;
		inbuf.filelen = init->filelen;
		VERIFY(err, access_ok(0, (void __user *)init->file,
			init->filelen));
		if (err)
			goto bail;
		if (init->filelen) {
			VERIFY(err, !fastrpc_mmap_create(fl, init->filefd,
				init->file, init->filelen, mflags, &file));
@@ -1450,6 +1454,10 @@ static int fastrpc_init_process(struct fastrpc_file *fl,
				goto bail;
		}
		inbuf.pageslen = 1;
		VERIFY(err, access_ok(1, (void __user *)init->mem,
			init->memlen));
		if (err)
			goto bail;
		VERIFY(err, !fastrpc_mmap_create(fl, init->memfd, init->mem,
					init->memlen, mflags, &mem));
		if (err)