Skip to content

Commit 9bb5e74

Browse files
griffinkhgregkh
authored andcommitted
Revert "misc: fastrpc: Restrict untrusted app to attach to privileged PD"
This reverts commit bab2f5e. Joel reported that this commit breaks userspace and stops sensors in SDM845 from working. Also breaks other qcom SoC devices running postmarketOS. Cc: stable <stable@kernel.org> Cc: Ekansh Gupta <quic_ekangupt@quicinc.com> Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reported-by: Joel Selvaraj <joelselvaraj.oss@gmail.com> Link: https://lore.kernel.org/r/9a9f5646-a554-4b65-8122-d212bb665c81@umsystem.edu Signed-off-by: Griffin Kroah-Hartman <griffin@kroah.com> Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Fixes: bab2f5e ("misc: fastrpc: Restrict untrusted app to attach to privileged PD") Link: https://lore.kernel.org/r/20240815094920.8242-1-griffin@kroah.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ccbde4b commit 9bb5e74

File tree

2 files changed

+3
-22
lines changed

2 files changed

+3
-22
lines changed

drivers/misc/fastrpc.c

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2085,16 +2085,6 @@ static int fastrpc_req_mem_map(struct fastrpc_user *fl, char __user *argp)
20852085
return err;
20862086
}
20872087

2088-
static int is_attach_rejected(struct fastrpc_user *fl)
2089-
{
2090-
/* Check if the device node is non-secure */
2091-
if (!fl->is_secure_dev) {
2092-
dev_dbg(&fl->cctx->rpdev->dev, "untrusted app trying to attach to privileged DSP PD\n");
2093-
return -EACCES;
2094-
}
2095-
return 0;
2096-
}
2097-
20982088
static long fastrpc_device_ioctl(struct file *file, unsigned int cmd,
20992089
unsigned long arg)
21002090
{
@@ -2107,19 +2097,13 @@ static long fastrpc_device_ioctl(struct file *file, unsigned int cmd,
21072097
err = fastrpc_invoke(fl, argp);
21082098
break;
21092099
case FASTRPC_IOCTL_INIT_ATTACH:
2110-
err = is_attach_rejected(fl);
2111-
if (!err)
2112-
err = fastrpc_init_attach(fl, ROOT_PD);
2100+
err = fastrpc_init_attach(fl, ROOT_PD);
21132101
break;
21142102
case FASTRPC_IOCTL_INIT_ATTACH_SNS:
2115-
err = is_attach_rejected(fl);
2116-
if (!err)
2117-
err = fastrpc_init_attach(fl, SENSORS_PD);
2103+
err = fastrpc_init_attach(fl, SENSORS_PD);
21182104
break;
21192105
case FASTRPC_IOCTL_INIT_CREATE_STATIC:
2120-
err = is_attach_rejected(fl);
2121-
if (!err)
2122-
err = fastrpc_init_create_static_process(fl, argp);
2106+
err = fastrpc_init_create_static_process(fl, argp);
21232107
break;
21242108
case FASTRPC_IOCTL_INIT_CREATE:
21252109
err = fastrpc_init_create_process(fl, argp);

include/uapi/misc/fastrpc.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,11 @@
88
#define FASTRPC_IOCTL_ALLOC_DMA_BUFF _IOWR('R', 1, struct fastrpc_alloc_dma_buf)
99
#define FASTRPC_IOCTL_FREE_DMA_BUFF _IOWR('R', 2, __u32)
1010
#define FASTRPC_IOCTL_INVOKE _IOWR('R', 3, struct fastrpc_invoke)
11-
/* This ioctl is only supported with secure device nodes */
1211
#define FASTRPC_IOCTL_INIT_ATTACH _IO('R', 4)
1312
#define FASTRPC_IOCTL_INIT_CREATE _IOWR('R', 5, struct fastrpc_init_create)
1413
#define FASTRPC_IOCTL_MMAP _IOWR('R', 6, struct fastrpc_req_mmap)
1514
#define FASTRPC_IOCTL_MUNMAP _IOWR('R', 7, struct fastrpc_req_munmap)
16-
/* This ioctl is only supported with secure device nodes */
1715
#define FASTRPC_IOCTL_INIT_ATTACH_SNS _IO('R', 8)
18-
/* This ioctl is only supported with secure device nodes */
1916
#define FASTRPC_IOCTL_INIT_CREATE_STATIC _IOWR('R', 9, struct fastrpc_init_create_static)
2017
#define FASTRPC_IOCTL_MEM_MAP _IOWR('R', 10, struct fastrpc_mem_map)
2118
#define FASTRPC_IOCTL_MEM_UNMAP _IOWR('R', 11, struct fastrpc_mem_unmap)

0 commit comments

Comments
 (0)