Skip to content

Commit

Permalink
Merge branch android-msm-sunfish-4.14-android13-qpr1 (android-13.0.0_…
Browse files Browse the repository at this point in the history
…r0.56)

FEB 2023.1

Signed-off-by: engstk <[email protected]>
  • Loading branch information
engstk committed Feb 10, 2023
1 parent 0d9a232 commit 244df28
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
13 changes: 13 additions & 0 deletions drivers/char/adsprpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2191,6 +2191,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 @@ -2327,6 +2333,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
6 changes: 3 additions & 3 deletions drivers/media/platform/msm/camera/cam_req_mgr/cam_mem_mgr.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-2019, 2022 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
Expand Down Expand Up @@ -682,7 +682,7 @@ int cam_mem_mgr_alloc_and_map(struct cam_mem_mgr_alloc_cmd *cmd)
if (rc) {
CAM_ERR(CAM_MEM,
"Ion Alloc failed, len=%llu, align=%llu, flags=0x%x, num_hdl=%d",
cmd->len, cmd->align, cmd->flags, cmd->num_hdl);
len, cmd->align, cmd->flags, cmd->num_hdl);
return rc;
}

Expand Down Expand Up @@ -745,7 +745,7 @@ int cam_mem_mgr_alloc_and_map(struct cam_mem_mgr_alloc_cmd *cmd)
tbl.bufq[idx].kmdvaddr = kvaddr;
tbl.bufq[idx].vaddr = hw_vaddr;
tbl.bufq[idx].dma_buf = dmabuf;
tbl.bufq[idx].len = cmd->len;
tbl.bufq[idx].len = len;
tbl.bufq[idx].num_hdl = cmd->num_hdl;
memcpy(tbl.bufq[idx].hdls, cmd->mmu_hdls,
sizeof(int32_t) * cmd->num_hdl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,14 @@ static int32_t cam_eeprom_init_pkt_parser(struct cam_eeprom_ctrl_t *e_ctrl,
rc = -EINVAL;
goto rel_cmd_buf;
}

if ((num_map + 1) >=
(MSM_EEPROM_MAX_MEM_MAP_CNT *
MSM_EEPROM_MEMORY_MAP_MAX_SIZE)) {
CAM_ERR(CAM_EEPROM, "OOB error");
rc = -EINVAL;
goto rel_cmd_buf;
}
/* Configure the following map slave address */
map[num_map + 1].saddr = i2c_info->slave_addr;
rc = cam_eeprom_update_slaveInfo(e_ctrl,
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/fbdev/pxa3xx-gcu.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ pxa3xx_gcu_write(struct file *file, const char *buff,
struct pxa3xx_gcu_batch *buffer;
struct pxa3xx_gcu_priv *priv = to_pxa3xx_gcu_priv(file);

int words = count / 4;
size_t words = count / 4;

/* Does not need to be atomic. There's a lock in user space,
* but anyhow, this is just for statistics. */
Expand Down

0 comments on commit 244df28

Please sign in to comment.