Skip to content

Commit

Permalink
Merge tag 'LA.UM.9.1.r1-12100.01-SMxxx0.QSSI13.0' of https://git.code…
Browse files Browse the repository at this point in the history
…linaro.org/clo/la/kernel/msm-4.14 into twelve

"LA.UM.9.1.r1-12100.01-SMxxx0.QSSI13.0"

* tag 'LA.UM.9.1.r1-12100.01-SMxxx0.QSSI13.0' of https://git.codelinaro.org/clo/la/kernel/msm-4.14:
  msm: ADSPRPC: Restrict untrusted applications from attaching to GuestOS
  • Loading branch information
Joker-V2 committed Jul 29, 2022
2 parents 5e666d9 + 3d9315e commit 998be99
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions drivers/char/adsprpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2150,6 +2150,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;
Expand Down Expand Up @@ -2274,6 +2280,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;

Expand Down

0 comments on commit 998be99

Please sign in to comment.