ASoC: msm: qdsp6v2: fix possible integer overflow

Check integer overflow before multiplying struct size. If that happens
should return immediately. In addition if param length is greater than
MAX size from spec, better return error.

Change-Id: Ib96cb419ade042d21a1213f6d8c2ff339f5d1c56
CRs-fixed: 605273
Signed-off-by: Fred Oh <fred@codeaurora.org>
msm: qdsp6v2: Increase max ports in APR

Increase the maximum ports in APR. Some Apps may support
multiple clients which exceeds the number of clients
supported in APR. This change increases number of ports
used in APR upto 8 sessions.

Change-Id: I06624330845681b4414dd470ab7aed669d690ba0
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
msm: vidc: add kzalloc success check for new HAL session

Memory allocation must be verified before proceeding.

CRs-Fixed: 606527
Change-Id: Ic340bf9926f84507294c576997948ddbe61dd62f
Signed-off-by: Jorge Solano Altamirano <jsolano@codeaurora.org>
qseecom: Validate pointer offset in qseecom_send_modfd_cmd

Validate cmd_req_buf pointer offset in qseecom_send_modfy_cmd, and
make sure cmd buffer address to be within shared bufffer.

Change-Id: I431511a92ab2cccbc2daebc0cf76cc3872689a97
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
msm: vidc: add kzalloc success check for new q6 HAL session

Memory allocation must be verified before proceeding.

CRs-Fixed: 606522
Change-Id: I809acc21dcd5e680827feb5d0fa8f45814bf4773
Signed-off-by: Jorge Solano Altamirano <jsolano@codeaurora.org>
msm: vidc: add input check for hfi q6 function.

The input parameters may be null. This change adds input checks at
function q6_hfi_iface_eventq_read

CRs-Fixed: 606516
Change-Id: I801a9d3249e9b97fa218fc29bc3a2a0e7a0d4d3f
Signed-off-by: Prasad Nallani <pnalla@codeaurora.org>
msm: vidc: Add null pointer checks

msm_vidc_inst pointer instance is used in without any null
pointer check, dereferencing t could device crash.
Fix the issue by adding null pointer checks.

Change-Id: Ia17b380063326aa587aac941aac0131871147e8a
CRs-Fixed: 606486,606469
Signed-off-by: Jayasena Sangaraboina <jsanga@codeaurora.org>
crypto: msm: ota: fix possible buffer overflow issue

This patch replaces snprintf with scnprintf to prevent
possible buffer overflow issues

CRs-Fixed: 562347

Change-Id: I56aebd24557dccc547ff86cb8853ace0602b6e50
Acked-by: Radhakrishna Popuri <c_rpopur@qti.qualcomm.com>
Signed-off-by: Venkatesh Yadav Abbarapu <quicvenkat@codeaurora.org>
Merge "crypto: msm: ota: fix possible buffer overflow issue"
Merge "msm: vidc: add kzalloc success check for new q6 HAL session"
Merge "msm: vidc: Add null pointer checks"
Merge "msm: vidc: add input check for hfi q6 function."
Merge "msm: vidc: add kzalloc success check for new HAL session"
soc: qcom: smd: Validate read and write addresses

The address from which data has to be read and the address to which the
SMD data has to be written is calculated based on the head and tail
indices for that SMD FIFO. If the indices are corrupted, then the
calculated pointer may be outside of the FIFO and may even be outside of
the range of SMEM.

Validate the read and write addresses to be with in the limits of
receive and send FIFO limits respectively.

CRs-Fixed: 550527
Change-Id: Ie5578f6aee73ea2b1435fea7c2a0a6dda14bff82
Signed-off-by: Zaheerulla Meer <zmeer@codeaurora.org>
Merge "soc: qcom: smd: Validate read and write addresses"
ARM: dma-mapping: don't allow DMA mappings to be marked executable

DMA mapping permissions were being derived from pgprot_kernel directly
without using PAGE_KERNEL.  This causes them to be marked with executable
permission, which is not what we want.  Fix this.

Change-Id: Ib40f59f3c569f82409943cf8f9a86a9869d922cc
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Git-commit: 0ea1ec713f04bdfac343c9702b21cd3a7c711826
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[lauraa@codeaurora.org: dropped functions not in older builds]
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
ARM: fix executability of CMA mappings

The CMA region was being marked executable:

0xdc04e000-0xdc050000           8K     RW x      MEM/CACHED/WBRA
0xdc060000-0xdc100000         640K     RW x      MEM/CACHED/WBRA
0xdc4f5000-0xdc500000          44K     RW x      MEM/CACHED/WBRA
0xdcce9000-0xe0000000       52316K     RW x      MEM/CACHED/WBRA

This is mainly due to the badly worded MT_MEMORY_DMA_READY symbol, but
there are also a few other places in dma-mapping which should be
corrected to use the right constant.  Fix all these places:

0xdc04e000-0xdc050000           8K     RW NX     MEM/CACHED/WBRA
0xdc060000-0xdc100000         640K     RW NX     MEM/CACHED/WBRA
0xdc280000-0xdc300000         512K     RW NX     MEM/CACHED/WBRA
0xdc6fc000-0xe0000000       58384K     RW NX     MEM/CACHED/WBRA

Change-Id: I044360a8f08b1a4ae3e3e9e623fb77af2b427c51
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Git-commit: 71b55663c5d0a6f8473045db1c8b376803780191
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[lauraa@codeaurora.org: Context fixups due to __dma_remap signature change]
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Merge "ARM: fix executability of CMA mappings"
Merge "ARM: dma-mapping: don't allow DMA mappings to be marked executable"
Revert "msm: mdss: Fix mdss iommu detach-attach issue"

This reverts commit 82a181a8c819c0b0b2cdf1adfe5fadcd0fdb5151.

Change-Id: Id2ff6f02945e763835ce1783461325df13b32daa
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>