Commit Graph

18942 Commits

Author SHA1 Message Date
Suren Baghdasaryan 3c2f8a8d47 staging: android: ashmem: Disallow ashmem memory from being remapped
When ashmem file is being mmapped the resulting vma->vm_file points to the
backing shmem file with the generic fops that do not check ashmem
permissions like fops of ashmem do. Fix that by disallowing mapping
operation for backing shmem file.

Bug: 142938932
Bug: 142903466
Reported-by: Jann Horn <jannh@google.com>
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I718dfca02c83845f8a41d88506871b0aa21326d7
2020-07-11 12:21:47 +02:00
voidanix af6f221a60 configs: add vndbinder 2019-08-26 15:26:21 +02:00
Sudarshan Rajagopalan 24ceae54a2 ion: fix logical-not comparison warning
Fixes compiler warning when a logical-not on a variable
is applied while comparing it with value zero.

Change-Id: I92aa16bd0d57a0d59ecd26eef1ac92220332998d
Signed-off-by: Sudarshan Rajagopalan <sudaraja@codeaurora.org>
Signed-off-by: Joe Maples <joe@frap129.org>
2019-08-26 14:20:53 +02:00
Joe Maples 353f0539b5 micro-optimization: Use DSTRLEN to remove incorrect strlen uses
strlen is often used incorectly to get the length of strings
defined at compile time. In these cases, the behavior can be
replicated with sizeof(X) - 1, which is calculated at compile
time rather than runtime, reducing overhead. I've created a
simple macro to replace these instances and applied it to all
the files compiled into the angler kernel.

Signed-off-by: Joe Maples <joe@frap129.org>
2019-08-26 13:31:43 +02:00
voidanix b771f33460 Merge remote-tracking branch 'android-linux-stable/android-msm-bullhead-3.10' into lineage-16.0 2019-07-11 15:28:52 +02:00
Kevin F. Haggerty 4115353eb6 Android 8.1.0 Release 0.117 (OPM7.181105.004,bullhead)
-----BEGIN PGP SIGNATURE-----
 
 iF0EABECAB0WIQRDQNE1cO+UXoOBCWTorT+BmrEOeAUCW+DaGQAKCRDorT+BmrEO
 eGKTAJ97G0+75IGVr/gbYlnLLLhbFmx/WgCfenCn3CPztVR4qXGqCeqehq4b3lM=
 =aUQa
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEA2skEMxbPHNb/U7LbZVRKTMRJykFAlvlEuAACgkQbZVRKTMR
 JykSbBAApb4dCJ5WqvQ2ZGzMfifau2+Vr2cjBa0r3B7VTPC8eRqShABHmZjSZ3w8
 gM0v6LiYHerOMQT7I6ISULZabPv1aunHUC0nCDh3l3z9DVhVQ4o3vCz0wVJxKlvR
 I5UHEje1DzT7stSl2kvcGbXOWXND5eVIb5ViGp2YtxoAHZk0UrAdXkDNWPSN/Ebb
 3nosXTHN1Kmpq707iJ7uVrnnu7dmqQKPkxtSwTqYHbffEDY7X7Vii51qJUnMvAJm
 qAts4+BGuTJCsbIy5pU6DWltYJyGyXI1VfC5MCQEAk93G2oQVFDDXoPjhokzZYzP
 52igJg63/wd9IWejCZRUCgk0xJI4j9811hhsJTZC6ReCrfClQyLKBft0/hC4I5RD
 BhXmGA5CX3rbv5Ulk8Ho3zC2qMDE4Db4oBrXNrSTIKS7m0/3SJrvifuUuCOOu9VH
 fHaod5cjFdf/zYRgrKx6fKOb2rhWn1L+Eu6Gi+Pm7NOx1J1MPuOTHMZpt+bv8Qqo
 +UsivVoL+7JWCKo8ogWaL8P1Z1FkhjA61Kk9cRcWyU+thyyKbj5H1vpYtwxhjJeV
 K2Ti1DNtDryw/OKoRliTCpYkVl2rlim+V5Y1vx+0wAP2+Qg89lfkOP5E/poW5/z9
 iqxns7p1T+dyKr6sPRdmRNH0H1vEtVVerZIQ3EZpIV7AjoeTVbI=
 =bg5j
 -----END PGP SIGNATURE-----

Merge tag 'android-8.1.0_r0.117' into lineage-15.1

Android 8.1.0 Release 0.117 (OPM7.181105.004,bullhead)

* tag 'android-8.1.0_r0.117': (26 commits)
  Release 4.4.23.022
  qcacld-2.0: Sanity check for ssid length in limLookupNaddHashEntry
  qcacld-2.0: Merge extcapie before get dot11f payload size
  qcacld-2.0: Clear the bits in Ext Cap IE if AP not support
  qcacld-2.0: Use variable length for Ext Cap IE
  Revert "Revert "qcacld-2.0: Check ie_len against 255 in function get_container_ies_len""
  Revert "Revert "qcacld-2.0: Check the length of IE's before appending""
  Revert "Revert "qcacld-2.0: Fix potential OOB read in dot11f.c""
  qcacld-2.0: Fix buffer overwrite in csrRoamCheckForLinkStatusChange
  qcacld-2.0: Add check for vdev_id
  qcacld-2.0: use hdd request manager for ocb set config
  qcacld-2.0: Use hdd request manager for get tsf timer
  qcacld-2.0: Use HDD request manager for get dcc stats
  qcacld-2.0: Use request manager for get temperature
  qcacld-2.0: Use request manager for linkspeed
  qcacld-2.0: Use request manager for enter bmps
  qcacld-2.0: Use request manager to handle WE_SET_POWER requests.
  qcacld-2.0: Use request manager for RSSI
  qcacld-2.0: Use request manager for Class A stats
  qcacld-2.0: Use request manager for get link status.
  ...

Change-Id: I4c6ba79dd3e2a15606a817be656c7009fcc73714
2018-11-08 21:53:50 -07:00
Nathan Chancellor 3491fde977 Android 8.1.0 Release 0.117 (OPM7.181105.004,bullhead)
-----BEGIN PGP SIGNATURE-----
 
 iF0EABECAB0WIQRDQNE1cO+UXoOBCWTorT+BmrEOeAUCW+DaGQAKCRDorT+BmrEO
 eGKTAJ97G0+75IGVr/gbYlnLLLhbFmx/WgCfenCn3CPztVR4qXGqCeqehq4b3lM=
 =aUQa
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEJDfLduVEy2qz2d/TmXOSYMtstxYFAlvg6BAACgkQmXOSYMts
 txZrRRAAopNI6rVKe+OIRHWHvfhS3nt/gSx/X1x0d8LX2L153lPiJ8i9ZVVeV2AF
 ox+2mRtM6C8WslrsYg7EoJkPBh8TgR05kbVvc9ZyU7Xj5PRkqmedm/xpQ6K8Zaha
 Bf/2idI4D5CTzq5E0Rcx1RUeqFWUvz0D7XENG8ZxLThIQ4EjNYp3JXI4iZJ148+p
 FXgPRVwlVxBZQCzCGaVlsH9p0A+6oHoY7M8/zst1VbFgFvAqpjUaaCAf6DV6af70
 rhhUOufExicKPlh/ISrkVqrRFivKZgzY7yIzTyqdjO7iRDRg3dLyZvknYtjP5lWf
 cPV6t7nMnE3IIUkpQvqx00IA2hIOAviAv/8UXgWsMxdWrWkWcNbnBYq2TgYTkQz8
 i2gjuHB+ZBcpp1KYqjpRwdrzEynurvXc9hoqFm6vvnMGu/0nipkgwFKDxQ/d+gGx
 vVCirkRlDyXATKdPzvtftcHVcmyHG7r/dLzeOuEFRZmfprFIuIvMwJu7XnAhWiTt
 BUvoFFeTf6RTtO87YXfGl1FBMAewjdUXMZsyXrgN+SfP7+YdhF2I234nTOs76kID
 4uCPxbt6iycdFyE+PDmzkMzSpPlNl36yVqKE3l6g31iS7YsBADdTB7ijSuwZgRFL
 gS0vKJnMLYs8/FgZTVPfde9a9pz+sMG8RN4Wl5wBeHHq7n05X2E=
 =s4en
 -----END PGP SIGNATURE-----

Merge tag 'android-8.1.0_r0.117' into android-msm-bullhead-3.10

Android 8.1.0 Release 0.117 (OPM7.181105.004,bullhead)

* tag 'android-8.1.0_r0.117':
  Release 4.4.23.022
  qcacld-2.0: Sanity check for ssid length in limLookupNaddHashEntry
  qcacld-2.0: Merge extcapie before get dot11f payload size
  qcacld-2.0: Clear the bits in Ext Cap IE if AP not support
  qcacld-2.0: Use variable length for Ext Cap IE
  Revert "Revert "qcacld-2.0: Check ie_len against 255 in function get_container_ies_len""
  Revert "Revert "qcacld-2.0: Check the length of IE's before appending""
  Revert "Revert "qcacld-2.0: Fix potential OOB read in dot11f.c""
  qcacld-2.0: Fix buffer overwrite in csrRoamCheckForLinkStatusChange
  qcacld-2.0: Add check for vdev_id
  qcacld-2.0: use hdd request manager for ocb set config
  qcacld-2.0: Use hdd request manager for get tsf timer
  qcacld-2.0: Use HDD request manager for get dcc stats
  qcacld-2.0: Use request manager for get temperature
  qcacld-2.0: Use request manager for linkspeed
  qcacld-2.0: Use request manager for enter bmps
  qcacld-2.0: Use request manager to handle WE_SET_POWER requests.
  qcacld-2.0: Use request manager for RSSI
  qcacld-2.0: Use request manager for Class A stats
  qcacld-2.0: Use request manager for get link status.
  qcacld-2.0: Use request manager for station stats
  qcacld-2.0: Use request manager for SNR
  qcacld-2.0: Use request manager for tsm metrics
  qcacld-2.0: Use request manager for fw state.
  qcacld-2.0: Use request manager for get_peer_rssi
  qcacld-2.0: Introduce and enable HDD Request Manager infrastructure

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2018-11-05 18:02:06 -07:00
Nathan Chancellor 2568111e20 Android 8.1.0 Release 0.102 (OPM6.171019.030.K1,bullhead)
-----BEGIN PGP SIGNATURE-----
 
 iF0EABECAB0WIQRDQNE1cO+UXoOBCWTorT+BmrEOeAUCW48UjgAKCRDorT+BmrEO
 eM3uAJ4rqJ3N9CFF8T0r6BvCBvqWGJ4tHACcDYFq1SGprHRkbQsHWKKPLhfg/As=
 =1a/f
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEJDfLduVEy2qz2d/TmXOSYMtstxYFAluPGGkACgkQmXOSYMts
 txaO6xAAmpz1MVhqTLXIrUJCDKP3jVeqFhW6jgAoFVwbGUS+lpuOz91NMxeFw32e
 9z3EgZqutxsO41AIogn4x2cx8YrwSL1IlXscMiIVCSJnppB0ZLJ/Pkt6j5r/T2fT
 5cFuW1Tj9mXzP/YJeCbO+6V1nxA5qs1Ihoac44qrSg22VZnjyW8SuljYuzDEpNMj
 HzIXnOc7qWs7WdhgUdT2I9cF5jzAQ2SvADGalsq14spKTAXlPPOb69YnFHj3ynts
 QS5mWtcFUpeqnK0WhCISw05IeSmXWnKNF55yJOMqk+yn6X1epRxZNHqnAp6E06x8
 Ri356+glNfQAaq7A1vJprDhCgQZgNJep47pfqsZTwLhuuzjKNv932OZRXQSB1Qyu
 6XgBOX9B1OZKrfKGMtBu+OgBLJufyOIpt6ATp+3QOvTu9dGBkw/rH1eHaYgqhCT3
 3qYiAnveDUBHd98xuixygwhmBBf4rpquQNotYaIr6yFDXcLB/4Qgu40fLcozGOtX
 UHaPeJBXVqdxQYkENIPNkghQgEmAub+seLqmV26Kf1q9itw7t3hrH4ZZs+OrpXdn
 k4AuGsc4kEtB55dRsXsHOd5iGq+jIwnAcXV4Q8kQf5a4QhtQ7hmwE0V2H0HlImY/
 Cdq9HtF4VCluLV7xn4XeyGSeaEknGICctzKm44jmFwvAM4IVICw=
 =RwYM
 -----END PGP SIGNATURE-----

Merge tag 'android-8.1.0_r0.102' into android-msm-bullhead-3.10

Android 8.1.0 Release 0.102 (OPM6.171019.030.K1,bullhead)

* tag 'android-8.1.0_r0.102':
  Revert "arm64: move sp_el0 and tpidr_el1 into cpu_suspend_ctx"
  Revert "arm64: Add macro for Cortex A72 primary part number"
  Revert "arm64: Delay ELF HWCAP initialisation until all CPUs are up"
  Revert "arm64: Move post_ttbr_update_workaround to C code"
  Revert "drivers/firmware: Expose psci_get_version through psci_ops structure"
  Revert "arm64: Add skeleton to harden the branch predictor against aliasing attacks"
  Revert "arm64: Implement branch predictor hardening for cortex A57, A72"
  Revert "arm64: PSCI Wrapper for branch predictor flush"
  arm64: PSCI Wrapper for branch predictor flush
  arm64: Implement branch predictor hardening for cortex A57, A72
  arm64: Add skeleton to harden the branch predictor against aliasing attacks
  drivers/firmware: Expose psci_get_version through psci_ops structure
  arm64: Move post_ttbr_update_workaround to C code
  arm64: Delay ELF HWCAP initialisation until all CPUs are up
  arm64: Add macro for Cortex A72 primary part number
  arm64: move sp_el0 and tpidr_el1 into cpu_suspend_ctx
  NFC: llcp: Limit size of SDP URI
  qcacld-2.0: Fix UAF in WLAN HDD
  qcacld-2.0: Fix OOB write in wma_passpoint_match_event_handler
  qcacld-2.0: Fix buffer overflow in ol_rx_in_order_indication_handler
  msm: ipa: Fix to handle NULL pointer dereference
  ASoC: msm: qdspv2: initialize variables before use
  ASoC: msm: qdspv2: add spin lock to protect ac
  ANDROID: HID: debug: check length in hid_debug_events_read() before copy_to_user()
  voice_svc: Avoid double free in voice_svc driver
  qcacld-2.0: Fix UAF in the function wlan_hdd_execute_remain_on_channel
  usb: dwc3: dbm: Fix double free in msm_dbm_probe
  qcacld-2.0: Resolve possible OOB while posting SET PASSPOINT WMA event
  qcacld-2.0: Fix information leak issue during memcpy

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2018-09-04 16:42:31 -07:00
Srinivas Girigowda c0325a1003 Release 4.4.23.022
Release 4.4.23.022

Bug: 111135102
Change-Id: I1cebdb8777c3e997428011f70b3cd0f218df22a7
CRs-Fixed: 688141
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
2018-08-30 16:58:07 -07:00
tinlin b4995ea3c2 qcacld-2.0: Sanity check for ssid length in limLookupNaddHashEntry
Remote malice AP may send beacon or probe response with
fake ssid IE length. Add sanity check for ssid IE length
in limLookupNaddHashEntry.

Bug: 112277852
Change-Id: I5c79bff3427a842036af788fea5003a96c7696a6
CRs-Fixed: 2235576
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
2018-08-30 16:57:55 -07:00
Hu Wang ec60fc3f6d qcacld-2.0: Merge extcapie before get dot11f payload size
Commit I910edfddf3ea64bc3000b6e7803dc57a50399dbb use variable length
for extcapie, which may cause extcapie length increase. If get
dot11f payload size first, then merge extcapie, when the extcapie
size inceases, the payload size is smaller than real packet size,
due to which dot11f packet pack will fail.

This change is to merge extcapie before get dot11f payload size.

Bug: 111135102
Change-Id: I17ea8d54930681401b62ff4b8a73c5cb19989046
CRs-Fixed: 1076370
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
2018-08-30 16:57:46 -07:00
Hu Wang 1c6a3222c4 qcacld-2.0: Clear the bits in Ext Cap IE if AP not support
prima to qcacld-2.0 propagation

Some specific AP will send assoc reject if DUT set the bits in
Ext Cap IE which AP not advertise in beacon or probe response.
To avoid the IoT issue, clear the bits in Ext Cap IE if AP not
support.

Bug: 111135102
Change-Id: I632f5474331abf51257cacdcce412d7a110d2433
CRs-Fixed: 1052140
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
2018-08-30 16:57:37 -07:00
Srinivas Girigowda d64d120ef1 qcacld-2.0: Use variable length for Ext Cap IE
prima to qcacld-2.0 propagation

Ext Cap IE is defined as fixed length in driver. But some
AP sends beacon or probe resp with variable length of
Ext Cap IE, then dot11f will decode it to invalid value.

To fix this, use variable length for Ext Cap IE.

Bug: 111135102
Change-Id: I910edfddf3ea64bc3000b6e7803dc57a50399dbb
CRs-Fixed: 1052140
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
2018-08-30 16:57:28 -07:00
Srinivas Girigowda cac9e8ff31 Revert "Revert "qcacld-2.0: Check ie_len against 255 in function get_container_ies_len""
This reverts commit 5b6007bc96533ef573fdf326a321b2d2dc7511d1.

Bug: 72957155
Change-Id: I8a3720ef5957dbb4027bf38797fdb9338c258cdf
CRs-Fixed: 2116546
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
2018-08-30 16:57:13 -07:00
Srinivas Girigowda bf2537ace3 Revert "Revert "qcacld-2.0: Check the length of IE's before appending""
This reverts commit 04504529636011eec61db7298de9355b53480a8b.

Change-Id: Id19aba9f811fa85f715314f7845452be4afa2cd8
CRs-Fixed: 2116592
Bug: 70237718
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
2018-08-30 16:57:04 -07:00
Srinivas Girigowda bdb34feca9 Revert "Revert "qcacld-2.0: Fix potential OOB read in dot11f.c""
This reverts commit 6a5133ffb1e99e1084cb73b06f167311bd32fa71.

Change-Id: I77457ee692d58b48726d24fb039e6fa059eace2c
CRs-Fixed: 2164014
Bug: 72957385
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
2018-08-30 16:56:51 -07:00
Srinivas Girigowda 4d932de52c qcacld-2.0: Fix buffer overwrite in csrRoamCheckForLinkStatusChange
Propagation from cld3.0 to cld2.0

Fix possible buffer overwrite in csrRoamCheckForLinkStatusChange
function.

Bug: 111128841
Change-Id: Icf4a39e0a2a291f1c084353985aa7952e3c8e136
CRs-Fixed: 2276642
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
2018-08-30 16:56:40 -07:00
tinlin 74074c944b qcacld-2.0: Add check for vdev_id
Add sanity check for vdev_id in wma_apfind_evt_handler
and wma_lost_link_info_handler.

Bug: 112277186
Change-Id: I1f469b25ac88deb4d5bbaf754c0ea441e6cb04de
CRs-Fixed: 2227076
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
2018-08-30 16:56:27 -07:00
Zhang Qian bfa108fa71 qcacld-2.0: use hdd request manager for ocb set config
Change hdd_ocb_set_config_req to hdd request manager framework.

Bug: 111127988
Change-Id: I57e327e61943f0754dd1b0db7e129ebb39be4f80
CRs-Fixed: 2230058
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
2018-08-30 16:56:17 -07:00
Zhang Qian bd4cc3cf34 qcacld-2.0: Use hdd request manager for get tsf timer
Change wlan_hdd_cfg80211_ocb_get_tsf_timer to HDD request
manager framework.

Bug: 111127908
Change-Id: I731cd303cfdee056039f0546408406fc70ab3448
CRs-Fixed: 2230953
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
2018-08-30 16:56:05 -07:00
Zhang Qian fb9ab96ac3 qcacld-2.0: Use HDD request manager for get dcc stats
Change wlan_hdd_cfg80211_dcc_get_stats to HDD request manager framework.

Bug: 111128839
Change-Id: I5cc4cdb3cc3b85988816eb80a93438ed6aff3e3a
CRs-Fixed: 2230971
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
2018-08-30 16:55:40 -07:00
gaolez f0960a0c34 qcacld-2.0: Use request manager for get temperature
propagation from qcacld-3.0 to qcacld-2.0

We are transitioning to the new request manager framework. Change
wlan_hdd_get_temperature() and hdd_GetTemperatureCB() to this
framework.

Bug: 111128007
Change-Id: I3b828827acaa16a64a8a6cfd1c0665da7be166de
CRs-Fixed: 2207693
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
2018-08-30 16:55:28 -07:00
Jiachao Wu c0878fb494 qcacld-2.0: Use request manager for linkspeed
We are transitioning to the new request manager framework.
Change wlan_hdd_get_linkspeed_for_peermac() to this framework.
Note that this framework provides the infrastructure to pass data
from the response thread to the request thread and hence
eliminates the need to maintain tSirLinkSpeedInfo in the HDD adapter
struct.

Bug: 111128836
Change-Id: Ie0c84c271cee188e8bd1663095022daefd703f97
CRs-Fixed: 2207694
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
2018-08-30 16:55:18 -07:00
bings f46a1532ab qcacld-2.0: Use request manager for enter bmps
We are transitioning to the new request manager framework. Change
the wlan_hdd_enter_bmps to this framework.

Bug: 111127854
Change-Id: Ia1ac62b97230a3e4240a039b5c8280c051245579
CRs-Fixed: 2207576
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
2018-08-30 16:55:06 -07:00
wadesong a6c9af4ff6 qcacld-2.0: Use request manager to handle WE_SET_POWER requests.
Use the new request manager framework for handling WE_SET_POWER
related iw requests.

Bug: 111127947
Change-Id: I1d833ced2096a92b855cc861c84a448029e592b7
CRs-Fixed: 2208402
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
2018-08-30 16:54:53 -07:00
hqu b6a191cb31 qcacld-2.0: Use request manager for RSSI
propagation from qcacld-3.0 to qcacld-2.0

We are transitioning to the new request manager framework. Change
wlan_hdd_get_rssi() and hdd_get_rssi_cb() to this framework.

Bug: 111126462
Change-Id: Ib0b74e288ad3dc4588440f0de7cfbebc9f88a49a
CRs-Fixed: 2207558
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
2018-08-30 16:54:43 -07:00
hqu 84255d50d6 qcacld-2.0: Use request manager for Class A stats
propagation from qcacld-3.0 to qcacld-2.0

We are transitioning to the new request manager framework. Change
wlan_hdd_get_classAstats() and hdd_get_class_a_statistics_cb() to
this framework.

Bug: 111127063
Change-Id: I6cfa2155187e3d9ac4099f1e4480835917fd9ca6
CRs-Fixed: 2207553
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
2018-08-30 16:54:32 -07:00
Will Huang d540503a28 qcacld-2.0: Use request manager for get link status.
propagation from qcacld-3.0 to qcacld-2.0

We are transitioning to the new request manager framework. Change
wlan_hdd_get_link_status() and hdd_get_link_status_cb() to adapte.

Bug: 111128638
Change-Id: I697eecf6afc6bf26c5b708f35280344138e3a132
CRs-Fixed: 2207627
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
2018-08-30 16:54:23 -07:00
hqu 1f58b09b28 qcacld-2.0: Use request manager for station stats
propagation from qcacld-3.0 to qcacld-2.0

We are transitioning to the new request manager framework. Change
wlan_hdd_get_station_stats() and hdd_get_station_statistics_cb() to
this framework.

Bug: 111127792
Change-Id: I4f0255975e8c37fa91215bcddc7896bb8d309cf8
CRs-Fixed: 2207548
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
2018-08-30 16:54:13 -07:00
hqu 52b8110c37 qcacld-2.0: Use request manager for SNR
propagation from qcacld-3.0 to qcacld-2.0

We are transitioning to the new request manager framework. Change
wlan_hdd_get_snr() and hdd_get_snr_cb() to this framework.

Bug: 111127985
Change-Id: Ib7628ee6931450b3b1ee73a0ede6c21ba6427407
CRs-Fixed: 2207562
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
2018-08-30 16:54:04 -07:00
Min Liu 99568b812a qcacld-2.0: Use request manager for tsm metrics
Propagation from qcacld-3.0 to qcacld-2.0

We are transitioning to the new request manager framework. Change
hdd_get_tsm_stats() and hdd_GetTsmStatsCB() to this framework. Note
that this framework provides the infrastructure to pass data from the
response thread to the request thread and hence eliminates the need to
maintain temporary tsmStats in the HDD adapter struct.

Bug: 111127986
Change-Id: I799ec4eb32a37a1edaef6d3c1fcaa10a7a9130af
CRs-Fixed: 2207636
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
2018-08-30 16:53:54 -07:00
Paul Zhang 7129ed0f5b qcacld-2.0: Use request manager for fw state.
propagation from qcacld-3.0 to qcacld-2.0

We are transitioning to the new request manager framework. Change
wlan_hdd_get_fw_state() and hdd_get_fw_state_cb() to this framework.

Bug: 111127907
Change-Id: Ibd450d5c50caf6c7c94457e67d1b3a18a30e3955
CRs-Fixed: 2207624
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
2018-08-30 16:53:44 -07:00
Liangwei Dong b17e8fddc8 qcacld-2.0: Use request manager for get_peer_rssi
propagation from qcacld-3.0 to qcacld-2.0
We are transitioning to the new request manager
framework. Change wlan_hdd_get_peer_rssi,
hdd_get_peer_rssi_cb, __iw_get_peer_rssi.

Bug: 111128835
Change-Id: I4d5350b4046063fe27cb68dea03408ca672b728f
CRs-Fixed: 2207614
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
2018-08-30 16:53:32 -07:00
hqu cee86797f9 qcacld-2.0: Introduce and enable HDD Request Manager infrastructure
propagation from qcacld-3.0 to qcacld-2.0

List qcacld-3.0 changes as following:
"Change-Id: I4e598e51983475318bc668e786aca690a934bd6c",
"Change-Id: I31e268ca02b4b5c2831c540933ee059a27bd9c7e",
"Change-Id: If4d5912710f8a3b5e87adf76f828a646b7cc2983".

Many operations within the wlan driver occur in an asynchronous
manner. Requests are received by HDD via one of the kernel interfaces
(ioctl, nl80211, virtual file system, etc.). The requests are
translated to an internal format and are then passed to lower layers
for processing. For requests which require a response, that response
comes up from the lower layers in a separate thread of execution,
ultimately resulting in a call to a callback function that was
provided by HDD as part of the initial request. So a mechanism is
needed to synchronize the request and response.

Currently there are various mechanisms which perform these
synchronizations, but experience with them has revealed some flaws.
So an universal mechanism is needed to synchronize the request and
response which addresses all of the known flaws. This framework
provides that mechanism. Enable the HDD Request Manager by invoking
the init() and deinit() APIs as appropriate.

Bug: 111135102
Change-Id: Ic4267507dcdbe550d49422bf3e75450ba66021aa
CRs-Fixed: 2205626
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
2018-08-30 16:53:22 -07:00
Min Liu 20556b5d80 qcacld-2.0: Fix UAF in WLAN HDD
UAF issue is in function hdd_open_adapter:

pAdapter is freed by calling free_netdev(pAdapter->dev),
but pAdapter->macAddressCurrent.bytes is referenced afterwards.

Fix the issue by swapping these two statements.

Bug: 65423852
Change-Id: I6910a56f9a204fdd8eaad54d8443867ee6a37fdb
CRs-Fixed: 2213280
Signed-off-by: Ecco Park <eccopark@google.com>
2018-07-12 16:45:13 -07:00
tinlin 5828a40d73 qcacld-2.0: Fix OOB write in wma_passpoint_match_event_handler
Propagation from cld3.0 to cld2.0.

In the function wma_passpoint_match_event_handler, fixed param event data
from firmware is filled in the destination buffer and indication is sent
to upper layers. The buffer allocation is done for the size
(wmi_passpoint_event_hdr*) + event->ie_length + event->anqp_length. The
maximum firmware event message size is WMI_SVC_MSG_MAX_SIZE. If either,
ie_length and anqp_length combined is greater than WMI_SVC_MSG_MAX_SIZE or
either of the two exceeds WMI_SVC_MSG_MAC_SIZE, an OOB write will occur in
wma_passpoint_match_event_handler.

Add check to ensure either of the values ie_length or anqp_lenth or
(ie_length + anqp_length) doesnt exceed the WMI_SVC_MAX_SIZE. Return
failure if it exceeds.

Bug: 109741911
Change-Id: I21f473ca0b99ebb8488f2cca3c0774817ea97c3a
CRs-Fixed: 2212696
Signed-off-by: Ecco Park <eccopark@google.com>
2018-07-12 16:45:06 -07:00
jinweic chen 3d6830c0f1 qcacld-2.0: Fix buffer overflow in ol_rx_in_order_indication_handler
Propagation from cld3.0 to cld2.0.
Currently variable "tid" is from message, which is used directly
as array size which causes buffer over-write.

To address this issue, add check for the array size.

Bug: 109741886
Change-Id: Idb6bd8ceaa217620a60bc04f2e84a551113e6edb
CRs-Fixed: 2204463
Signed-off-by: Ecco Park <eccopark@google.com>
2018-07-12 16:45:03 -07:00
Bala Venkatesh 9640ff8bda qcacld-2.0: Fix UAF in the function wlan_hdd_execute_remain_on_channel
In function wlan_hdd_execute_remain_on_channel after calling
sme_remain_on_channel  Buffer pointed by "pRemainChanCtx" may be freed
in other thread "wlan_hdd_remain_on_channel_callback". UAF will happen
on when accessing "pRemainChanCtx->rem_on_chan_request".

Access pRemainChanCtx only when it is not NULL.

Change-Id: I32696ca9d88bc55f7c9841c7d602f363c35ed49f
CRs-Fixed: 2189054
Bug: 109741735
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
2018-07-12 16:40:00 -07:00
Hanumanth Reddy Pothula f5a04818b2 qcacld-2.0: Resolve possible OOB while posting SET PASSPOINT WMA event
qcacld-3.0 to qcacld-2.0 propagation

Presently, while processing SET_PASSPOINT_LIST vendor command
HDD is not making sure realm string passed by upper-layer is NULL
terminated, this may lead to buffer overflow as strlen is used
to get realm string length to construct PASSPOINT WMA command.

Make sure realm is NULL terminated before passing the same to
down layers.

Bug: 109741777
Change-Id: I417f2b89dc219664afe5deac00dc361cac4048d6
CRs-Fixed: 2217476
Signed-off-by: Kumar Anand <kumaranand@google.com>
2018-07-12 16:39:28 -07:00
Alok Kumar b7fcc1b9c0 qcacld-2.0: Fix information leak issue during memcpy
The buffer allocated with lenth "ATH6KL_FWLOG_PAYLOAD_SIZE "
is not initialized, this may lead to information leak during
memcpy when len < ATH6KL_FWLOG_PAYLOAD_SIZE.

To resolve this issue, memset the buffer for length
(ATH6KL_FWLOG_PAYLOAD_SIZE - len) to 0

Bug: 73885536
Change-Id: If4a49347d674ad2af0438b408a4a4b9308c61026
CRs-Fixed: 2253103
Signed-off-by: Ecco Park <eccopark@google.com>
2018-07-12 16:39:25 -07:00
Nathan Chancellor 597e0c0a08 Android 8.1.0 Release 0.81 (OPM6.171019.030.E1,bullhead)
-----BEGIN PGP SIGNATURE-----
 
 iF0EABECAB0WIQRDQNE1cO+UXoOBCWTorT+BmrEOeAUCWzqrkwAKCRDorT+BmrEO
 eEXHAJ9/sH2vpR/1jb8Wipa4cRmW88yxpwCeJ0Z8mWzMyXnwHBUDn9tTe0Kneok=
 =lGEU
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEJDfLduVEy2qz2d/TmXOSYMtstxYFAls6tUQACgkQmXOSYMts
 txYAtQ/+JJqWFaVB/RA2guSB+6y2I8ReiR7LpzqeC34ksRjFKjyfrtXzEsJmJrIM
 By7U5b62k0FxwpcuSMYfo4srAJo0t/1b8P84iogvHYb1jOkXP9IIbtYmaoknhorS
 zSsyEV8oW2rXadFHjsL95zxU2N+aqNC9qAUFLKOy7bwbiZsAlnHLU9i6zcLn9TLI
 0Ip0MIWXfmUycFrL6DHz27S+DE9ph8k5KFJuhUb7ZRJthNCcitwLykOTxX4Dy4TK
 x7wY0SvVBTUy0jM8XY1K1nlWxGCCLdbjVREMPjqvnqWSjKmzwZR0KAjXXA2/oH6p
 5g2mmNTiaNYcwnmKwkkRmEKWWNJGA5dw8ZwZuayLPBCfHDYd8oEntOVq3gGjRP27
 EBNcc/8tuoU/JHsDoADo526AnJIwENfyH/hvxh/6Z1LHWEG+EJlPnCRgAcQbnNjS
 5mLkF+PvY7Q8P83zjWVikWszi/CQLsunRl5a1E+KB6JlJwBS3/PqTLymg/1/qjNK
 MmR7k/0LsZ/YEXaS7EldWZxJFMYo9qRIoTsGngE7rpTWOhSaOs/8Z+qBSRH6Kcfr
 4SW3vLJat7b8vlkaxS0sflYgOPRKVMYsMAtC88ds6bXOcXEFiX8hS03BQL9i2R4e
 EbCgXVPPl7HLDDSqMloAL7i88QYifYlb7jsnQbAvTMENy0NUuBk=
 =xjfK
 -----END PGP SIGNATURE-----

Merge tag 'android-8.1.0_r0.81' into android-msm-bullhead-3.10

Android 8.1.0 Release 0.81 (OPM6.171019.030.E1,bullhead)

* tag 'android-8.1.0_r0.81':
  qcacld-2.0: add validation check for APFIND event
  ASoC: msm: qdsp6v2: check for buffer size before read
  qcacld-2.0: Fix integer underflow and buffer over-read in fwlog
  qcacld-2.0: Add sanity check for wmi TLV length
  msm: mdss: fix race condition between rotator api's
  BACKPORT: futex: Prevent overflow by strengthen input validation
  UPSTREAM: scsi: sg: don't return bogus Sg_requests
  BACKPORT: futex: Remove requirement for lock_page() in get_futex_key()
  drivers: cpuidle: lpm-levels: Fix untrusted pointer dereference.
  BACKPORT: msm: adsprpc: Use unsigned integer for length values
  udp: consistently apply ufo or fragmentation
  msm: sensor: ois: add conditional check for ioctl
  soc: q6dspv2: apr: fix client registration refcount

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2018-07-02 16:20:07 -07:00
Nathan Chancellor 68bcf63600 Android 8.1.0 Release 0.62
-----BEGIN PGP SIGNATURE-----
 
 iF0EABECAB0WIQRDQNE1cO+UXoOBCWTorT+BmrEOeAUCWxWzwwAKCRDorT+BmrEO
 eEmGAJ9Y4YMBAgQmIsz5GjbvNk3Kqu3RGACdEcAsk2is8cSq1kKvF6Hmlappr3w=
 =pyl6
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEJDfLduVEy2qz2d/TmXOSYMtstxYFAlsVt6IACgkQmXOSYMts
 txaWWg//bg+TS8zJixr4WwRjFL/eMLtLVKViMQX5p7ZEaaKZzzV178fG/yICUEGa
 TIDjR9RIFU2P17y7NJCN/Jwn3qSNgf1gxuSSUboNAPYUK3L9qFIGTmUZHGQ0nGMc
 q6eVO+leIF38+aePzD6utysAzrCO3rd7MKFyHaukQUVX0z46ObUZYUkNlxcalVfL
 /+8rzUOX5JnuD0iUaU1LwgxY/Kox2IDkmJCiI1mnexUGJ7fCDOZN5HLG+7bsRw2r
 +YiKzzOqsoAIiXNlZOL7K4fnB3kt0pslcsv4apt75547xqSl1guVM3qUOLhvgpKL
 yn2C0DLwi7QP5WOJjiyT7dNlmRBE1d5X/cWZZGffUbhMMcvFDxXO9yXmI9cS2nB9
 2tfhlvEjf4COtmoai/5LwsyoLfJn+gtiAzQ2J7D+/FqMSYcF4p+cj0nKNNu5+aN7
 od5RFOnodKIeGoGf6XJcPQtOZnCu+TpUe+xMaACTnolT/xHlcyCV5xCL+E6waNg5
 0mGCOEOyXM3+LlFul8o++dd8UFDQr83Sq9VJ+S6flKIM/ShIle9bxvsO3TSu9Uy/
 QlmP9/NBdnLmPqdabauq1HNINpQAFAnPFtP8MqHYGEdZczpAGf9ihJWFtAEPRWSw
 /KoFtUWCMsvFMnIz3EDAr2i3afb2/vE1seQc/X44uErwqsng8M8=
 =PN63
 -----END PGP SIGNATURE-----

Merge tag 'android-8.1.0_r0.62' into android-msm-bullhead-3.10

Android 8.1.0 Release 0.62

* tag 'android-8.1.0_r0.62':
  Revert "ion: ensure CMO target is valid"
  msm: ADSPRPC: Use ID in response to get context pointer
  qcacld-2.0: Fix potential buffer overwrite in the htt_t2h_lp_msg_handler
  qcacld-2.0: Add data_len check to avoid OOB access
  BACKPORT: ASN.1: fix out-of-bounds read when parsing indefinite length item
  UPSTREAM: KEYS: fix out-of-bounds read during ASN.1 parsing
  qcacld-2.0: Fix potential buffer overflow
  ion: ensure CMO target is valid
  crypto: hmac - require that the underlying hash algorithm is unkeyed
  qcacld-2.0: Move NBUF_UPDATE_TX_PKT_COUNT before freeing netbuf
  diag: dci: check signed values for negativity
  diag: Add conditional check for len in dci_process_ctrl_status()
  diag: Validate copying length against source buffer length
  mm-camera2:isp2: Handle use after free buffer
  ANDROID: Bluetooth: hidp: buffer overflow in hidp_process_report
  UPSTREAM: HID: Bluetooth: hidp: make sure input buffers are big enough
  qcacld-2.0: Remove FW memory dump feature
  BACKPORT: ipv6: fix udpv6 sendmsg crash caused by too small MTU
  UPSTREAM: ipv4, ipv6: ensure raw socket message is big enough to hold an IP header
  msm: ADSPRPC: use access_ok to validate pointers
  ASoC: wcd_cpe_core: Add mutex lock for CPE session

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2018-06-04 15:05:19 -07:00
Yu Wang e176033505 qcacld-2.0: add validation check for APFIND event
Check whether the data_len is valid, to avoid
out-of-bounds reading issue.

Bug: 77528805

Change-Id: If9fef306f455fcc1bd34d7aa713dd5c5535b8bfb
CRs-Fixed: 2170392
Signed-off-by: Ahmed ElArabawy <arabawy@google.com>
2018-05-10 21:55:47 +00:00
Guisen Yang 2afc5f8bd0 qcacld-2.0: Fix integer underflow and buffer over-read in fwlog
Currently, there is no check of:
1) Firmware event parameters in dbglog_parse_debug_logs(), which can
result in integer underflow.
2) Number of dbg log args against the total length, which can result in
buffer over-read.

To fix this, compare size of firmware event parameters and number of
dbg log args with total buffer length.

Bug: 77528512
Change-Id: I981441ecf8e866afc00cf2e0e316779c8cc803c6
CRs-Fixed: 2205372
Signed-off-by: Ecco Park <eccopark@google.com>
2018-05-10 21:54:31 +00:00
Zhang Qian 3786d0d554 qcacld-2.0: Add sanity check for wmi TLV length
Add sanity check for wmi TLV header length before padding/shrinking
elements in a wmi which has a variable length for its TLV structure.

Currently, the TLV length is not checked so its maximum value could
be 65535 which results in a hugh count for elements. Number of elements
is used to terminate the loop for padding/shrinking. If the number
was too large, there would be memory overflow.

CRs-Fixed: 2169157
Bug: 77527719
Change-Id: I99c700d62f8c0db84cbd95fc6efcb5249b89eb1d
Signed-off-by: Ecco Park <eccopark@google.com>
2018-05-10 21:53:27 +00:00
Nathan Chancellor 60d69b24b0 Android 8.1.0 Release 0.53 (OPM4.171019.016.A1,bullhead)
-----BEGIN PGP SIGNATURE-----
 
 iF0EABECAB0WIQRDQNE1cO+UXoOBCWTorT+BmrEOeAUCWvDR2QAKCRDorT+BmrEO
 eOqWAKCGUTiqryJJ2OXdC6U2te09FUz2BwCeNufH5WgVIQ1qp8goaKRa9g84HmI=
 =Kwnk
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEJDfLduVEy2qz2d/TmXOSYMtstxYFAlrw04gACgkQmXOSYMts
 txb+ag//fA6h2OtpBGqthtb05ohJl3YunWQa8blVrepphXn9ZF7Ackrgbf9dz+2z
 5nAW3bujdNYNPMkQ/bJ+y4WptQr/IYQG6+IlKXQx4CejBb/h21xBVyfX1OSw9u/q
 cXFfwVx74B2K6nfRkM5IUvzt5JwugCRDPZVKsphU5aW7I7FUPt0s2qJGTBhoPdn+
 hhilVk3VVtgkc81t7TGFdmCn/nZvc8sHfa4+LUXhw5g2tDI7/m/AASZrcT55wZ0Z
 Cyqg6swJA4fbdrt72x3NbMUEMSZXRHaQwf2pcSwqhW8MsvX6mPKQlT9d5WV9NPsw
 wDULHlcA5aARDOoGk8GA/zpLgWA7AKSgYuGXgLMYYpWfOsOv03XuVE+zxjc5Grbm
 +1vCPgb/zOGNKsrST0ssNXcuQxlJKD7nuPivjy8X6FnXa5O6JY4VZGU8bBd1N5d/
 gyI/e3G4tEe9rdbf9Fp1xduvyKWG8ccdkOtX73ULHOz1M+n7MsTI7ZMKHuJRsh3L
 s+bHvIRBgt0twvZvP9gmwFHsDnXxKwMWgSML+txvFbrq8T6D0J6eb765YcWzMUSV
 QBDw3lAFrRXf696yec1GYYPhbmXpYAQK8CgxOpl32PXzseWGXF4Gcu5bwvk9B3BG
 Eq1R941GEhcNkxDqJn5KuhrbVGTxMpOFeQfHsa1rPIhGwzrgz4g=
 =Vl6W
 -----END PGP SIGNATURE-----

Merge tag 'android-8.1.0_r0.53' into android-msm-bullhead-3.10-oreo-m2

Android 8.1.0 Release 0.53 (OPM4.171019.016.A1,bullhead)

* tag 'android-8.1.0_r0.53':
  qcacld-2.0: Fix potential buffer overwrite in wma_vdev_start_rsp_ind
  qcacld-2.0: Fix potential buffer overwrite
  qcacld-2.0: Race condition while using pkt log buffer
  qcacld-2.0: Dump the txrx stat req if the queue is not empty
  qcacld-2.0: Fix memory leak for txrx_fw_stats cmd
  qcacld-2.0: Avoid possible stack overflow in hdd_ProcessGENIE API
  qcacld-2.0: Fix potential buffer overflow for TX_COMPL_IND
  qcacld-2.0: Fix Out-of-bound access in sapInterferenceRssiCount
  qcacld-2.0: Avoid buffer overflow
  drivers: qdsp6v2: Add mutex unlock to properly release lock
  msm: msm_bus: Add mutex lock for floor vote data
  qcacld-2.0: Fix buffer overwrite due to ssid_len in WMA handlers
  UPSTREAM: loop: fix concurrent lo_open/lo_release
  msm: mdss: adjust mdss_mdp_get_plane_sizes parameters init order
  Input: gtco - fix potential out-of-bound access
  msm: sensor: actuator: fix out of bound read for region params
  msm: sensor: actuator: add null pointer check for i2c array
  msm: camera: sensor: Validate destination step position
  msm: sensor: actuator: check NULL pointer for actuator ctrl
  msm: sensor: actuator: avoid accessing out of bound memory
  qcacld-2.0: Add mutex lock for proc handlers

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2018-05-07 15:30:30 -07:00
Daniel Mentz f7affbf1a6 Revert "ion: ensure CMO target is valid"
This reverts commit 88e7e58956.

Bug: 72957321
Bug: 79219092
Change-Id: I8894188f90682c00f9b2fec0b5f6b74cf4a8562c
Signed-off-by: Daniel Mentz <danielmentz@google.com>
2018-05-07 12:35:24 -07:00
Tiger Yu 1c03a6dae0 qcacld-2.0: Fix potential buffer overwrite in the htt_t2h_lp_msg_handler
Check for the validity of tx_desc_id when received the htt message of
HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND from firmware to ensure the buffer
overwrite does not happen.

Bug: 74237532

Change-Id: I0afc781b7fff303525352b817e7eb60b8b05e4d3
CRs-Fixed: 2157917
Signed-off-by: Ahmed ElArabawy <arabawy@google.com>
2018-04-16 18:21:30 +00:00
tinlin 0963d6ebad qcacld-2.0: Add data_len check to avoid OOB access
Add data_len check in wma_nan_rsp_event_handler()
to avoid OOB access.

Bug: 74237168
Change-Id: Iff42da84567381a4b64bc07e69ff1a0cd4b5a543
CRs-Fixed: 2170630
2018-04-16 18:19:23 +00:00
Zhang Qian 758fa30414 qcacld-2.0: Fix potential buffer overflow
Fragment count will be larger than the upper limit of
cvg_nbuf_cb->extra_flag.num which would lead to an overread
of fragment length. Upper limit check for fragment count
is added in this change.

Change-Id: Icc078b2efee554ac84377b5edd90d0a5c7a61f98
CRs-Fixed: 2129566
Bug: 72957387
Signed-off-by: Ecco Park <eccopark@google.com>
2018-04-16 18:15:03 +00:00