Commit graph

835 commits

Author SHA1 Message Date
codeworkx
15f81a19b5 Merge tag 'LA.UM.7.4.r1-05300-8x98.0' into lineage-16.0
"LA.UM.7.4.r1-05300-8x98.0"

Change-Id: I8e27939efccb7d0bda0ac7c4e32afdf3c6d62507
2019-06-16 08:15:21 +02:00
Abhishek Choubey
cac305db85 msm: ipa: fix to validate input parameters
Validate the input parameters to avoid any unexpected
scenarios.

Change-Id: If77ac66470baf937b160800174ea14f1a8cb6408
Signed-off-by: Pooja Kumari <kumarip@codeaurora.org>
Signed-off-by: Abhishek Choubey <abchoube@codeaurora.org>
2019-06-03 11:47:17 -07:00
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
codeworkx
6861312cbe Merge tag 'LA.UM.7.4.r1-04700-8x98.0' into auto
"LA.UM.7.4.r1-04700-8x98.0"

Change-Id: I777ab5e199fb463581fbfaf4750c8358d6f9e56f
2019-03-10 16:59:28 +01:00
Praveen Kurapati
a411b9ceed msm: ipa: Fix to validate the buffer size
Adding code changes to validate buffer size.
While calling ipa_read verifying the kernel buffer
size in range or not.

Change-Id: Idc608c2cf0587a00f19ece38a4eb646f7fde68e3
Signed-off-by: Praveen Kurapati <pkurapat@codeaurora.org>
2019-03-06 21:35:38 +05:30
Mohammed Javid
9713572a3e msm: ipa3: Fix to validate the user inputs
Adding code changes to validate user inputs.
Before allocating the NAT entry verifying the
NAT entry size in range or not.

Change-Id: I21147f20a12243af5d21aebdc206703964db2be4
Acked-by: Ashok Vuyyuru <avuyyuru@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-12-26 07:58:27 +01:00
Mohammed Javid
8200545876 msm:ipa:Prevent rt rule deletion if rt rule id is invalid
Currently RT is deleted even if rt rule or header proc ctx
is invalid. Add check to prevent it.

Change-Id: Ic37ff9a33fab2b3c0d6393e43452e4b62a91d932
Acked-by: Pooja Kumari <kumarip@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-12-26 07:58:27 +01:00
Mohammed Javid
1d0bfe3b3e msm: ipa: Protect ipa default routing table
Protect ipa default routing table from
addition, deletion and modification once after
default rule added by ipa-driver.

Change-Id: I045d9c29fed23edf796d826e440b81124e1f666a
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-12-26 07:54:00 +01:00
liochen
8148b9d900 Synchronize codes for OnePlus5 & 5T OxygenOS 9.0.0
kernel device tree source code for OnePlus 5 & 5T P device

Change-Id: I84f40e66833ea1ce30eb1d9a710d6e1529e9e637
2018-12-26 11:02:39 +08:00
Skylar Chang
34e75f5628 msm: ipa3: fix holb sequence for SSR
The correct sequence for enabling HOLB drop is first
to suspend the pipe and then to HOLB drop.

Change-Id: I78b7b268eec230a4993e446bd90846f800364e06
CRs-Fixed: 2141518
Acked-by: Ady Abraham <adya@qti.qualcomm.com>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
2018-12-12 23:45:54 -08:00
Mohammed Javid
25611b44f1 msm: ipa3: Fix to validate the user inputs
Adding code changes to validate user inputs.
Before allocating the NAT entry verifying the
NAT entry size in range or not.

Change-Id: I21147f20a12243af5d21aebdc206703964db2be4
Acked-by: Ashok Vuyyuru <avuyyuru@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-10-30 02:03:24 -07:00
Mohammed Javid
0ec949132a msm:ipa:Prevent rt rule deletion if rt rule id is invalid
Currently RT is deleted even if rt rule or header proc ctx
is invalid. Add check to prevent it.

Change-Id: Ic37ff9a33fab2b3c0d6393e43452e4b62a91d932
Acked-by: Pooja Kumari <kumarip@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-10-24 02:02:32 -07:00
Mohammed Javid
eea18ae6b7 msm: ipa: Protect ipa default routing table
Protect ipa default routing table from
addition, deletion and modification once after
default rule added by ipa-driver.

Change-Id: I045d9c29fed23edf796d826e440b81124e1f666a
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-10-10 01:16:29 -07:00
Linux Build Service Account
d61ed3e62e Merge "msm: ipa3: Add mutex to prevent race condition" 2018-08-29 17:20:36 -07:00
Linux Build Service Account
434e1a76db Merge "msm:ipa: Prevent NAT table deletion only if public ip is not assigned" 2018-08-29 17:20:33 -07:00
Mohammed Javid
a78a593c7e msm: ipa3: Add mutex to prevent race condition
There is a race condition between ipa3_nat_init_cmd
and ipa_read_nat4. The two thread will R/W the critical
global variables. This will result in race conditions
and possibly buffer overread/ overwrite issues. Add code
to prevent this race condition.

Change-Id: I6bf9a837ae941cf3ad9413da6e44821916acf196
Acked-by: Pooja Kumari <kumarip@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-08-28 23:10:45 -07:00
Mohammed Javid
8f4df2ac17 msm:ipa: Prevent NAT table deletion only if public ip is not assigned
Currnetly NAT table is not deleted even if public ip is assigned to
NAT table. Add check to prevent deletion only if public ip is not assigned.

Change-Id: I4855b21472d3f6bf541d07733b18592e9e677ce6
Acked-by: Pooja Kumari <kumarip@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-08-28 11:30:16 -07:00
Mohammed Javid
7471a8d40f msm: ipa: Validate routing rule id
IPA driver expose routing rule id IOCTL's to user space.
There is a chance of getting invalid routing rule-id.
Validate it before committing it to IPA hardware.

Change-Id: If80b94d3a055f9212d25aff9a57d1b45001ba586
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-08-28 03:48:36 -07:00
Skylar Chang
6d92c598ae msm:ipa3: fix the header table gap issue
Move those deleted entries to the free
list to avoid the gap in hdr tbl list.

Change-Id: I5f5b6ec845e6b7e52c7079c2a3200a8290616951
Acked-by: Pooja Kumari <kumarip@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
2018-08-11 23:08:45 -07:00
Skylar Chang
726ce06fae msm: ipa: fix the ipa-hw rules not clean
After getting reset ioctl from user-space
module, the caches in ipa-driver are clean
however ipa-hw still has it. The fix is
to commit those caches in ipa-hw.

Change-Id: Iee0009b2bf3cdff2979d1fdba629c86a7c5afe21
Acked-by: Pooja Kumari <kumarip@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
2018-08-11 15:49:02 +05:30
Mohammed Javid
b96d7a6b84 msm: ipa: Add WLAN FW SSR event
Add WLAN FW SSR event to handle FW rejuvenate
scenario.

Change-Id: I417d46cc07f455792906a18f4b6dc8e5ca8ca3de
Acked-by: Pooja Kumari <kumarip@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-08-09 00:00:59 -07:00
Linux Build Service Account
9656c6c641 Merge "ipa: update wlan upstream iface name" 2018-08-07 15:24:16 -07:00
Linux Build Service Account
991119cca5 Merge "msm: ipa3: using rate limit api for ioctl calls" 2018-08-07 15:24:09 -07:00
Mohammed Javid
f605473d7c ipa: update wlan upstream iface name
Update WLAN upstream name to support STA SAP scenario
with wlan1 iface.

Change-Id: I0223c5b4aff8dfe24562a2c6d4ac581a7843224e
Acked-by: Pooja Kumari <kumarip@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-08-07 10:32:51 -07:00
Mohammed Javid
55dbd938ac msm: ipa3: using rate limit api for ioctl calls
ipav3 ioctl calls input arguments validation failed cases,
replacing IPAERR()/IPAHAL_ERR() with IPAERR_RL()/IPAHAL_ERR_RL()
marco for controlling logs printing on the console.

Change-Id: I0b48b4a2f8b37c71aebe82c7b747b1d8f6c1e143
Acked-by: Pooja Kumari <kumarip@qti.qualcomm.com>
Acked-by: Ashok Vuyyuru <avuyyuru@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-08-07 00:52:23 +05:30
Skylar Chang
12626bc2e3 msm: ipa3: fix hdr offset issue
Hdr offset calculation is wrong when
driver received clean-up ioctl from
user-space. The fix is to find right
hdr offset to commit ned headers.

Change-Id: I70878a19b64c3defa6101bd68d435f0b74bcfb9b
Acked-by: Pooja Kumari <kumarip@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
2018-08-06 15:05:25 +05:30
Skylar Chang
aef2c9f15c msm: ipa: support ipacm cleanup
Support header/filter, routing rules
cleanup when user-space module
crashed like ipacm and also cached
the wlan client connect messages
for ipacm to query.

Change-Id: Ib09cbe0e9114aa5a5673898ff796de7e7944af35
Acked-by: Pooja Kumari <kumarip@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
2018-08-02 00:37:49 -07:00
Linux Build Service Account
6dc8f1cb01 Merge "msm: ipa: Add support to IPA platform shutdown cleanup" 2018-07-30 23:59:59 -07:00
Mohammed Javid
ac27bafd6e msm: ipa: Add support to IPA platform shutdown cleanup
Add support for platform reboot from IPA APPS
driver perspective.

Change-Id: Id65336da06a59a28944bfd51d9482d3d82a9cc3e
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-07-31 06:07:11 +05:30
Mohammed Javid
f6b9625a3e msm: ipa3: Update holb config on USB DPL ep
Once USB DPL consumer ep is configured,
there is a chance of IPA hardware getting stalled,
if DPL client is not pulling the data over other end.
so, set holb discard over USB DPL cons ep
to avoid this stall.

Change-Id: I520b8c1ec84e03b783677c43670cbb9f904a4b4f
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-07-30 20:06:00 +05:30
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
Linux Build Service Account
80db82bdaf Merge "msm: ipa: Error prints are misleading fix it" 2018-07-17 15:06:09 -07:00
Mohammed Javid
bbff7311e9 msm: ipa: Error prints are misleading fix it
IPC logging is for debugging purpose and
it may disabled in kernel anytime.
From IPA driver printing the error log on IPC
create context is misleading.
Instead of error, make it as debug.

Change-Id: Icee2b1ad9fcef446f79dfc71f554a24a90ea3d2d
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-07-16 15:12:25 +05:30
Manoj Prabhu B
75c86dab36 SSM: Remove support for SSM driver
SSM driver is not enabled and hence needs deprecation.
Remove all the SSM driver references.

CRs-Fixed: 2268386
Change-Id: I02f82817023d2fcc6d05a2f0d7eb3aec8f60a7d5
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
2018-06-28 14:47:27 +05:30
Mohammed Javid
7770ea4a7c msm: ipa: Fix unlock spinlock in failed condition
'Commit id I427374ef44 ("msm: ipa: Fix race condition
head_desc_list variable access")' broke unlock spinlock
in failed scenarios. Added changes to fix the issue.

Change-Id: I0f7dddfa7a583a8ebd8c1e6a610ab204726d5bc1
Acked-by: Ashok Vuyyuru <avuyyuru@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-06-20 11:37:31 +05:30
Linux Build Service Account
a0e118cf53 Merge "msm: ipa: Fix race condition head_desc_list variable access" 2018-06-14 16:06:52 -07:00
Linux Build Service Account
b746664418 Merge "msm: ipa: fix to not allow NAT DMA command without device initialization" 2018-05-27 02:06:57 -07:00
Mohammed Javid
333b7dec60 msm: ipa: fix to not allow NAT DMA command without device initialization
Without NAT device initialization sending NAT DMA
commands leads to XPU violation. Added checks to
verify device initialized or not before sending DMA
command.

Change-Id: I7440abc14a81e1621573f0e2808a410d60b2458d
Acked-by: Ashok Vuyyuru <avuyyuru@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-05-26 23:56:08 +05:30
Mohammed Javid
1e03864e8a msm: ipa: Fix to slab out of bounds issue
Add changes to verify passed value with in the allocated
max array size range or not before accessing structure.

Change-Id: If70493e937f6f0bc29bbfe08bf43738bdb4e9cf4
Acked-by: Ashok Vuyyuru <avuyyuru@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-05-21 12:57:20 +05:30
Mohammed Javid
f01d00d213 msm: ipa: using debug logging instead of error logging
Adding code changes to controlling logs printing
on the console changing error logging to debug logging

Change-Id: I35f4c0e3380ad700899808d9cd6c260befb8be8f
Acked-by: Ashok Vuyyuru <avuyyuru@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-05-02 03:24:26 -07:00
Mohammed Javid
4987fb136c msm: ipa: rmnet: Make code changes with respect to CR#2046006
Check for CAP_NET_ADMIN capability of the user
space application who tries to access rmnet driver IOCTL.

Change-Id: If6bb4b54659306c5103b5e34bf02c7234c851e0a
CRs-Fixed: 2226355
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-04-30 00:07:34 -07:00
Linux Build Service Account
08acb0dfc3 Merge "msm: ipa2: Fix IPA kernel NULL pointer dereference" 2018-04-05 18:47:22 -07:00
Mohammed Javid
5b2f7c5ec7 msm: ipa2: Fix IPA kernel NULL pointer dereference
Add changes to fix IPA kernel NULL pointer dereference issue

Change-Id: I090d900688f13bc80616e7a3c49f7e1d6cf1be0b
Acked-by: Ashok Vuyyuru <avuyyuru@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-04-05 10:49:16 +05:30
Mohammed Javid
b0923ef138 msm: ipa: Fix race condition head_desc_list variable access
Protect the common shared sys head_desc_list with
spin lock to avoid the race condition.

Change-Id: I427374ef44f150d6ead4aa44e245b23a55b7dd9e
Acked-by: Ashok Vuyyuru <avuyyuru@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-03-12 15:29:11 +05:30
Mohammed Javid
806eaf6ffe msm: ipa: Fix to handle NULL pointer dereference
Header entry deleted but same entry pointer using in
routing table not updated. Added checks to confirm
header entry present or not before using it to avoid
null pointer dereference.

Change-Id: Id1d844c60b2dcb0cc7cf18352b78d62fe5a89347
Acked-by: Ashok Vuyyuru <avuyyuru@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-03-10 03:53:07 -08:00
Mohammed Javid
c2c950b468 msm: ipa3: Fix to validate the user inputs
Miss to Validate user inputs for last entry while
sending the QMI message to modem. Adding code changes to
fix to validate user inputs for last entry.

Change-Id: If2c6c4fbfc922d56355d26a16f844fd57d4992ac
Acked-by: Ashok Vuyyuru <avuyyuru@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-02-25 03:58:38 -08:00
Mohammed Javid
d0ad541f26 msm:ipa: Return mux id only for valid interface
Value of MAX_NUM_OF_MUX_CHANNEL is greater than
number of valid interfaces. So empty interface
is also getting mux id. Return mux id only for valid
interfaces.

Change-Id: I7852df0aa0ccee781c1bf6857a4183b99194f3ee
Acked-by: Pooja Kumari <kumarip@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-02-19 03:12:49 -08:00
Ghanim Fodi
b57f252a8b msm: ipa: Prevent deletion of the default route rule
The first APPS default routing table rule is installed
at the IPA driver initialization. To prevent routing
exception, this rule cannot be deleted by user application.
This change prevents deleting this rule.

Change-Id: Ia27434fd24a15fea5956018a1271b11bbe227df7
CRs-fixed: 2165859
Signed-off-by: Ghanim Fodi <gfodi@codeaurora.org>
2018-02-11 01:04:16 -08:00
Mohammed Javid
36737be7c6 msm: ipa: Fix to add string NULL terminator
Missing null terminator to userspcae provided
string leads to strlen buffer overflow in strlcpy function.
Added code changes to fix string NULL terminator issue.

Change-Id: I3f9d5f22fbb26f68de12370bc5e07a4e6bc2ced9
Acked-by: Ashok Vuyyuru <avuyyuru@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-02-07 22:49:47 -08:00
Mohammed Javid
6cb84eed2d msm: ipa: dynamic memory leak fix
This is a fix for dynamic memory leak seen with incorrectly
allocating memory of a different size than with intended
size.

Change-Id: I350719dadad9fd5c7f35a334e81c8d9f2298f888
Acked-by: Jyothi Jayanthi <jyothij@qti.qualcomm.com>
Acked-by: Ashok Vuyyuru <avuyyuru@qti.qualcomm.com>
Signed-off-by: Michael Adisumarta <madisuma@codeaurora.org>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-02-06 02:47:19 -08:00