Commit Graph

3498 Commits

Author SHA1 Message Date
Camera Software Integration
8fbdd92875 Merge "msm: camera: sensor: TOCTOU error handling in eeprom" into camera-kernel.lnx.7.0 2024-07-09 01:46:23 -07:00
Haochen Yang
37c2bd7cb9 msm: camera: jpeg: Fix potential OOB access
This change fixes a potential OOB access issue due to
culprit checking.

CRs-Fixed: 3851339
Change-Id: I5a8b8977f815376eeb41a4a227df6e307c7bd99d
Signed-off-by: Haochen Yang <quic_haocyang@quicinc.com>
2024-07-03 04:11:10 -07:00
Akash Puliyadi Jegannathan
533ee451e6 msm: camera: sensor: TOCTOU error handling in eeprom
IO config can be modified due to access to shared memory.
This change scopes the data locally so as to avoid
vulnerability of count being modified by external
means while executing due to being in shared memory.

CRs-Fixed: 3777635
Change-Id: Ia5dd9138dcf8449e2d800aca9ffed73d9c4ba3ea
Signed-off-by: Akash Puliyadi Jegannathan <quic_apuliyad@quicinc.com>
2024-06-26 01:51:30 -07:00
Soumen Ghosh
6ddbe8dd37 msm: camera: core: Out of Bound write in cam_context_user_dump
addr variable to have address bound check, due to that increamenting
of that variable can go corrupt other memory address which could lead to
our of bound access. This change will add extra address change before
access addr variable.

CRs-Fixed: 3802568
Change-Id: I0a2804403dc92fa005f8dda5263242eeb01f4765
Signed-off-by: Soumen Ghosh <quic_soumeng@quicinc.com>
2024-06-11 21:53:40 -07:00
Mukund Deshmukh
8bdffe141e msm: camera: sensor: Computation of Reg mask for CSF
Modified Reg mask compuation based on cpas version.

CRs-Fixed: 3824862
Change-Id: I911e0f58c82b360ca7a737929fb908321cbed364
Signed-off-by: Mukund Deshmukh <quic_mdeshmuk@quicinc.com>
2024-06-05 19:33:41 -07:00
Camera Software Integration
b11ccc186f Merge "msm: camera: utils: use updated SCM calls for csf2.5" into camera-kernel.lnx.7.0 2024-06-05 19:27:30 -07:00
Pranav Sanwal
936bc9131a msm: camera: utils: use updated SCM calls for csf2.5
Update and refactor SCM calling procedure in accordance to
CSF2.5 framework for supported targets.

isolate domain_id changes to bypass if only csf2.5 supported.

CRs-Fixed: 3806801
Signed-off-by: Pranav Sanwal <quic_psanwal@quicinc.com>
Change-Id: Idf8ff9716d1e47fb2cea8ea8a34ae3555b29855e
2024-05-29 17:49:41 +05:30
Yash Upadhyay
508aeed13f Revert "msm: camera: isp: Fixing CSID halt sequence"
This reverts commit 6b19fffad2.

CRs-Fixed: 3820616
Change-Id: I62175cc81ca8f897dac50d26e1b1fc5410c82029
Signed-off-by: Yash Upadhyay <quic_yupadhya@quicinc.com>
2024-05-28 11:16:55 +05:30
Yash Upadhyay
58f39b9ed0 msm: camera: isp: Fixing OOB access while defer bufdone
This change fixes OOB access by dynamically allocating memory
for defer bufdone index array and ensuring that allocation
happens after acquire is successful.

CRs-Fixed: 3815399
Change-Id: Icdf5417a74e940ed8ab9f28ac9e0ae22c7bd3c35
Signed-off-by: Yash Upadhyay <quic_yupadhya@quicinc.com>
2024-05-17 02:52:53 -07:00
Camera Software Integration
494d493271 Merge "msm: camera: common: Fixing potential OOB cases" into camera-kernel.lnx.7.0 2024-05-09 00:20:06 -07:00
Camera Software Integration
2bf0b709e0 Merge "msm: camera: isp: Avoiding OOB in defer bufdone handling" into camera-kernel.lnx.7.0 2024-05-09 00:20:03 -07:00
Camera Software Integration
950fb5e35a Merge "msm: camera: utils: populate applied clock rate properly" into camera-kernel.lnx.7.0 2024-05-09 00:19:58 -07:00
Yash Upadhyay
5736242bea msm: camera: isp: Avoiding OOB in defer bufdone handling
Adds changes to dynamically allocate memory for defer bufdone
index array as per number of ports acquired instead of
hardcoded max resource value which could change target wise.

CRs-Fixed: 3788295
Change-Id: I5d5f43ac41e6abbac0b270eeaf97475b4e39a5d7
Signed-off-by: Yash Upadhyay <quic_yupadhya@quicinc.com>
2024-04-30 14:25:05 +05:30
Yash Upadhyay
96bbf9473a msm: camera: common: Fixing potential OOB cases
This change validates scratch buffer offset and kmd
cmd buffer offset length to avoid OOB access issues,
This change adds fix to sizeof operater's parameter,
Adds fix to avoid buffer overflow.

CRs-Fixed: 3800787
Change-Id: I619b56e8dc262911b17072a03c103e2986c32ed4
Signed-off-by: Yash Upadhyay <quic_yupadhya@quicinc.com>
2024-04-29 05:46:19 -07:00
Camera Software Integration
d32cda396b Merge "msm: camera: cpas: Add support to update camera qos" into camera-kernel.lnx.7.0 2024-04-28 22:45:18 -07:00
Camera Software Integration
eed9e1d11b Merge "msm: camera: common: correct mmrm dependency for volcano" into camera-kernel.lnx.7.0 2024-04-28 22:44:40 -07:00
Camera Software Integration
88daa83530 Merge "msm: camera: sync: Avoiding UAF on get dma fence" into camera-kernel.lnx.7.0 2024-04-28 22:44:10 -07:00
Camera Software Integration
1aa641e0f3 Merge "msm: camera: cdm: Prevention from OOB on virtual cdm write" into camera-kernel.lnx.7.0 2024-04-25 07:26:01 -07:00
Camera Software Integration
cf0526ccbd Merge "msm: camera: sensor: Offset Validation before dereferencing" into camera-kernel.lnx.7.0 2024-04-25 07:25:59 -07:00
Alok Chauhan
1f72d2fd80 msm: camera: utils: populate applied clock rate properly
Currently applied clock rate variable is getting updated
with default -ve value for clocks for which no rate set.
This is giving wrong impression of clock rate being applied.

Updated applied clock rate based on clock rate value set.

CRs-Fixed: 3794045
Change-Id: Ib37165dbaf4c1ec56abff1d3ba3eaf21eae79734
Signed-off-by: Alok Chauhan <quic_alokc@quicinc.com>
2024-04-22 02:13:07 -07:00
Alok Chauhan
97e470d1ac msm: camera: common: correct mmrm dependency for volcano
Corrected board list of supported msm-mmrm boards to include volcano.

CRs-Fixed: 3794045
Change-Id: I469c6b795716cae98bc29cf396c6ffd7b810343c
Signed-off-by: Alok Chauhan <quic_alokc@quicinc.com>
2024-04-22 14:39:44 +05:30
Depeng Shao
5b8ab83787 msm: camera: memmgr: Remove the mutex lock for kref variable
kref operation is atmoic operation, so no need to use mutex
to protect it, and the cam_mem_put_cpu_buf is also called
in spinlock context, so we can't use mutex lock in this
function. This change removes the mutex lock for kref
variable protextion.

CRs-Fixed: 3786887
Change-Id: Ic05bdafacf06cde6a8d8dbae7512e5d22eb7f514
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
(cherry picked from commit bb64b99c83b3bb6da0c241eda74ebe8a19b51840)
2024-04-21 19:32:15 -07:00
Yash Upadhyay
d6d05fba0b msm: camera: cdm: Prevention from OOB on virtual cdm write
Adds proper sanity on virtual cdm right operation to avoid
OOB register space access. After getting the mapped buffers
through cam_mem_get_cpu_buf() in kernel, userspace is still
able to access those buffers. So, the validation of offsets
and sizes does not have any advantage if userspace can alter
those parameters after we have validated them. That's why we
copied the information in kernel before we validate that.

CRs-Fixed: 3778045
Change-Id: I3b53549419b40a92333263e29d93220577d691e9
Signed-off-by: Yash Upadhyay <quic_yupadhya@quicinc.com>
2024-04-19 09:17:36 +05:30
Dharmender Sharma
15af46a8b6 msm: camera: cpas: Add support to update camera qos
This change add support to update camera qos statically
and dynamically via hyp.
For each NIU camera driver can call scm API with each NIU's
register offsets, value and number of registers offset that need to be
programed.

CRs-Fixed: 3781697
Change-Id: I42705dd2b379e29f7f32f9c2564cc476dc8c1308
Signed-off-by: Dharmender Sharma <quic_dharshar@quicinc.com>
2024-04-17 03:08:29 -07:00
Yash Upadhyay
96ff7cbcd8 msm: camera: sync: Avoiding UAF on get dma fence
Two threads can access same dma fence, one to get_fence and other
to put_fence. Missing locks and checks on fence could lead to use
after free case. This change adds proper locks and checks before
dma fence get call to avoid this.

CRs-Fixed: 3782903
Change-Id: I283e87f09c44b57bed3dbb782113f3629c9a29bd
Signed-off-by: Yash Upadhyay <quic_yupadhya@quicinc.com>
2024-04-16 22:19:22 -07:00
Abhilash Mahapatra
b321b9ac17 msm: camera: sensor: Offset Validation before dereferencing
- Validation of settings_array_offset which is populated
  from umd as sizeof(CSLTPGSettingsConfigCmd).

CRs-Fixed: 3788500
Change-Id: Ic848d537f1b56bcfc47b295b063e9670313c9a33
Signed-off-by: Abhilash Mahapatra <quic_abhmah@quicinc.com>
2024-04-16 02:58:27 -07:00
Camera Software Integration
f6b44a99e3 Merge "msm: camera: memmgr: Add refcount to track umd in use buffers" into camera-kernel.lnx.7.0 2024-04-15 07:20:51 -07:00
zhuo
77cdd783b0 msm: camera: memmgr: Add refcount to track umd in use buffers
Currently krefcount is using by umd and kmd. Due to sometimes
there is issue in umd, such as release twice. That maybe causes
buffer release before kmd access the buffer. This commit add
a new refcount to track umd in use buffers and use current krefcount
to track kmd in use buffers. For the same buffer use in kmd and umd
only when all refcount become zero, the buffer start to release.

CRs-Fixed: 3692103
Change-Id: I5a58d9bab4c82bdb192d6a6a3d2b3d254dc04c9e
Signed-off-by: zhuo <quic_zhuo@quicinc.com>
2024-04-06 16:44:21 +08:00
Alok Chauhan
5f8e6f8031 msm: camera: tfe: Skip overwrite bw limiter for TFE WMs
TFE is programming WM's bw limiters with default value
without considering if it's already set via blob from UMD.

Skip bw limiter programming for TFE WMs for which
limiter values programmed via blob.

CRs-Fixed: 3767707
Change-Id: I30190def8b2a08c577b3bf1fa71fd2fe3db53c86
Signed-off-by: Alok Chauhan <quic_alokc@quicinc.com>
2024-04-05 10:07:59 +05:30
Camera Software Integration
4408d24dab Merge "msm: camera: isp: fix incorrect sizeof expression" into camera-kernel.lnx.7.0 2024-04-01 01:59:10 -07:00
Camera Software Integration
dac2c184d4 Merge "msm: camera: tfe: handle out_of_sync interrupt as non fatal" into camera-kernel.lnx.7.0 2024-04-01 01:58:42 -07:00
Camera Software Integration
7faeb4a453 Merge "msm: camera: csiphy: Expand CSIPHY Onthego support" into camera-kernel.lnx.7.0 2024-04-01 01:58:29 -07:00
Camera Software Integration
2b214147d4 Merge "msm: camera: sensor: Cleaning redundant code" into camera-kernel.lnx.7.0 2024-04-01 01:58:16 -07:00
Shivi Mangal
6245be68a9 msm: camera: sensor: Handling race condition in util api
I2C cmd is coming from user space which can be modified due to
access to shared memory. This change scopes the data locally so
as to avoid vulnerability of count being modified by external
means while executing due to being in shared memory.

CRs-Fixed: 3707472
Change-Id: I8a89e23e99b80b089ed4c4cf3098feead752356e
Signed-off-by: Shivi Mangal <quic_smangal@quicinc.com>
(cherry picked from commit 4e00cc5f9f81bf471d58ee5d6beb210a5326fcff)
2024-03-26 03:53:05 -07:00
Pranav Sanwal
913a74d72a msm: camera: tfe: handle out_of_sync interrupt as non fatal
Handle out_of_sync_frame_drop interrupt as non fatal till
3 successive occurences. fix prevention of mup bit override
when programming RDI.

CRs-Fixed: 3638271
Change-Id: Ie2f7ef476b76b5074b12b0eb503ae0be1100611a
Signed-off-by: Pranav Sanwal <quic_psanwal@quicinc.com>
2024-03-26 00:10:04 -07:00
Camera Software Integration
e8fb277c8d Merge "msm: camera: sensor: Optimize usleep_range call during power on/off" into camera-kernel.lnx.7.0 2024-03-25 23:45:20 -07:00
Shivakumar Malke
dafa3fd726 msm: camera: isp: fix incorrect sizeof expression
This change fixes incorrect sizeof expression prevent
issue.

CRs-Fixed: 3765096
Change-Id: I0b9b947f44e7d9066731d741752b11022d8cc084
Signed-off-by: Shivakumar Malke <quic_smalke@quicinc.com>
2024-03-21 03:33:18 -07:00
Camera Software Integration
af0f7b69bf Merge "msm: camera: isp: Fix prevent issues in cam_isp" into camera-kernel.lnx.7.0 2024-03-20 10:14:40 -07:00
Camera Software Integration
352ce6b61d Merge "msm: camera: icp: Avoid resource leak during comp bind failure" into camera-kernel.lnx.7.0 2024-03-20 10:14:33 -07:00
Abhilash Mahapatra
9d0e75ed46 msm: camera: sensor: Cleaning redundant code
Change includes proper handling of identical
code in if-else conditional blocks.

CIDs-Fixed: 116678, 115377
CRs-Fixed: 3764553
Change-Id: Ib83b6644a5df741d299af76f30ed5137c657415e
Signed-off-by: Abhilash Mahapatra <quic_abhmah@quicinc.com>
2024-03-20 02:53:24 -07:00
Camera Software Integration
c05628a87e Merge "msm: camera: common: Added support for multiple project configuration" into camera-kernel.lnx.7.0 2024-03-19 11:15:54 -07:00
Camera Software Integration
ad7bb7184b Merge "msm: camera: isp: Fixing CSID halt sequence" into camera-kernel.lnx.7.0 2024-03-19 11:15:37 -07:00
Camera Software Integration
f392c81e33 Merge "msm: camera: isp: Enhance logging in isp" into camera-kernel.lnx.7.0 2024-03-19 11:15:19 -07:00
Camera Software Integration
c88327f907 Merge "msm: camera: isp: Fixing missing logging parameter" into camera-kernel.lnx.7.0 2024-03-19 11:15:03 -07:00
Camera Software Integration
2faf41ecbe Merge "msm: camera: sync: Prevent double lock/unlock on fence object" into camera-kernel.lnx.7.0 2024-03-19 11:14:47 -07:00
Mukund Deshmukh
3989f5c473 msm: camera: sensor: Added macro-check to enable WLED compilation
-include header for WLED flash

CRs-Fixed: 3759419.

Change-Id: Ib2fefd4deeeccf7a2bd5a6c8e7c8e4fd19f712ed
Signed-off-by: Mukund Deshmukh <quic_mdeshmuk@quicinc.com>
2024-03-18 15:19:13 +05:30
liji
5ea0047a7a msm: camera: sensor: Optimize usleep_range call during power on/off
Decrease max value of usleep_range during sensor power on/off

CRs-Fixed: 3698124
Change-Id: If152fce49331fa057cf6bcb63f99b17b184dd00e
Signed-off-by: liji <quic_liji@quicinc.com>
(cherry picked from commit a4c76acef4188da15247304a58d262b4d2bb9c8d)
2024-03-16 22:18:12 -07:00
Shivakumar Malke
8a4731d3c1 msm: camera: isp: Fix prevent issues in cam_isp
This change fixes prevent issues like incorrect
sizeof expression and incorrect format specifiers
in cam_isp.

CRs-Fixed: 3751374
Change-Id: Ia1383a655412176c4de30ef17412c2ff900f768e
Signed-off-by: Shivakumar Malke <quic_smalke@quicinc.com>
2024-03-12 22:41:35 -07:00
Yash Upadhyay
68c51a5a48 msm: camera: isp: Fixing missing logging parameter
Fixes missing logging parameter in few of the logs.

CRs-Fixed: 3758192
Change-Id: Ic4d351fdf11213c515d975bda48a299e885e123d
Signed-off-by: Yash Upadhyay <quic_yupadhya@quicinc.com>
2024-03-12 22:37:24 -07:00
Mukund Deshmukh
dc1b82712d msm: camera: csiphy: Update PHY secure CP register for volcano
Update secure CP register bitmask for volcano csiphy-v2.2.1

CRs-Fixed: 3753058.

Change-Id: Ie44d52ad3ad18b42163c2f848d90d203015ccebf
Signed-off-by: Mukund Deshmukh <quic_mdeshmuk@quicinc.com>
2024-03-12 21:47:17 -07:00