Commit graph

10 commits

Author SHA1 Message Date
Jishnu Prakash
797de5526f msm: sps: Update debug message format specifier
Restrict printing of kernel virtual addresses in SPS driver.

In debug prints, handles to bam device structures may be printed
as integers. As these handles are obtained by casting pointer
to bam device structures to integer, they can reveal addresses
of the structures to attackers.

Cast the handles in debug prints to pointers, printed with with %pK,
which hides these values if kptr_restrict is set (default on Android).

Change-Id: Idd28c7d11a06113605f7428a4cfc2505c1ae0073
Signed-off-by: Jishnu Prakash <jprakash@codeaurora.org>
2019-05-09 07:44:19 -07:00
Siva Kumar Akkireddi
058355d2bf msm: sps: Suppress bind/unbind attributes
SPS driver does not support manual bind/unbind operations
through sysfs. Suppress the bind/unbind nodes. Do not free
SPS struct in sps_device_de_init since it is being done in
sps_exit, and also to avoid use-after-free.

Change-Id: If6da6c5fb9d1a44d0420c6151f7f9d0a33cb2d04
Signed-off-by: Siva Kumar Akkireddi <sivaa@codeaurora.org>
2018-07-26 08:43:13 -07:00
Jishnu Prakash
958acd2989 msm: sps: Restore ipc log destroy commands
Changes got reverted accidentally with commit e498154c09
("msm: sps: Update debug message format specifier")
restoring them again.

Change-Id: I6c2c7b4d636131341139d89ff4d59b608df5da9b
Signed-off-by: Jishnu Prakash <jprakash@codeaurora.org>
2017-11-24 13:20:19 +05:30
Jishnu Prakash
e498154c09 msm: sps: Update debug message format specifier
Restrict printing of kernel virtual addresses in SPS driver.
In debug code, %p is used to print virtual addresses of
kernel objects, which can be exploited by attackers. It is
replaced with %pK, which hides these values if kptr_restrict
is set (default on Android).

Change-Id: I57585fa655abc01b2e8d694c8f31b7617bbf4ec7
Signed-off-by: Jishnu Prakash <jprakash@codeaurora.org>
2017-11-19 20:11:26 +05:30
Rama Krishna Phani A
a24f14b69d msm: sps: Destroy debug log during BAM deregistration
Clients can register and deregister to BAM based on usecase.
IPC Log pages are created during clients registration to BAM.
Update support to destroy log pages during BAM deregistration.

Change-Id: I1da266c61ebd57d6cfead6fc5b64a05be5620cf4
Signed-off-by: Rama Krishna Phani A <rphani@codeaurora.org>
2017-08-22 21:30:47 -07:00
Siva Kumar Akkireddi
be32f1d527 msm: sps: Fix race condition in SPS debugfs APIs
SPS debugfs APIs can be called concurrently which can result
in dangling pointer access. This change synchronizes access
to the SPS debugfs buffer.

Change-Id: I409b3f0618f760cb67eba47b43c81d166cdae4aa
Signed-off-by: Siva Kumar Akkireddi <sivaa@codeaurora.org>
2017-06-19 23:19:19 -07:00
Yan He
642effc4f6 msm: sps: add the checking of userspace input length
Add the checking of the input length from userspace so kernel space
will not copy any content outside the input buffer.

Change-Id: I3cef834ed1df836356ba40e6e950a534ec49819d
Signed-off-by: Yan He <yanhe@codeaurora.org>
2017-01-06 10:27:45 -08:00
Rama Krishna Phani A
56b66ab231 msm: sps: Change the default SPS IPC log level
Set the default IPC logging level to minimal logging in
case client driver does not specify ipc logging level.

Change-Id: I83174225b4eb7ae72cb16bc8f6dcf9659bc1342e
Signed-off-by: Rama Krishna Phani A <rphani@codeaurora.org>
2016-08-17 05:33:27 -07:00
Yan He
043d337047 msm: sps: update SPS logging
Update the logging in SPS driver to catch additional info for
the interaction between SPS driver and BAM client drivers.

Change-Id: Icd5955d2d4dd83124f47e60e052ec3b3a2611025
Signed-off-by: Yan He <yanhe@codeaurora.org>
2016-03-23 21:17:01 -07:00
Yan He
f46f720b22 platform: msm: Add snapshot of the SPS/BAM driver
Add the MSM SPS (Smart Peripheral Switch) driver.

SPS may be used as a DMA engine to move data in either Peripheral-to-
Peripheral (a.k.a. BAM-to-BAM) mode or Peripheral-to-Memory (a.k.a
BAM-System) mode.

This snapshot is taken as of msm-3.18 commit 132e1315c1

Change-Id: I7ec9781c3b608b9ee0fffdf7ba3e1b33bfa4dfcd
Signed-off-by: Yan He <yanhe@codeaurora.org>
2016-03-22 11:08:35 -07:00