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

Commit 8c95e6b8 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ADSPRPC: Restrict untrusted applications from attaching to GuestOS"

parents a7559137 40cb5f52
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -2543,6 +2543,12 @@ static int fastrpc_init_process(struct fastrpc_file *fl,
		remote_arg_t ra[1];
		int tgid = fl->tgid;

		if (fl->dev_minor == MINOR_NUM_DEV) {
			err = -ECONNREFUSED;
			pr_err("adsprpc: %s: untrusted app trying to attach to privileged DSP PD\n",
				__func__);
			return err;
		}
		ra[0].buf.pv = (void *)&tgid;
		ra[0].buf.len = sizeof(tgid);
		ioctl.inv.handle = FASTRPC_STATIC_HANDLE_PROCESS_GROUP;
@@ -2683,6 +2689,13 @@ static int fastrpc_init_process(struct fastrpc_file *fl,
			unsigned int pageslen;
		} inbuf;

		if (fl->dev_minor == MINOR_NUM_DEV) {
			err = -ECONNREFUSED;
			pr_err("adsprpc: %s: untrusted app trying to attach to audio PD\n",
				__func__);
			return err;
		}

		if (!init->filelen)
			goto bail;