Commit graph

602771 commits

Author SHA1 Message Date
Vijayanand Jitta
42a7efc865 iommu: iommu-debug: don't pass null character to copy_to_user
Doing a cat on pte,test_virt_addr from adb shell prints a null
character as well which is at the end of the string this is not
required so, don't pass this null character to copy_to_user.

Change-Id: I8d9120f64d1df84a704379eb00bd239fc7059e9e
Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org>
2019-02-17 21:50:33 -08:00
Deepak Kumar Singh
3f49920e67 soc: qcom: Validate read and write index before calculating ptr
Currently we are not validating read and write index of
tx and rx fifo's before calculating ptr, this can lead to
out-of-bound access. The patch adds proper check for the same.

CR-Fixed: 2355425
Change-Id: I7b158e94ae743a90ac364783fe31914ca0fa582b
Signed-off-by: Deepak Kumar Singh <deesin@codeaurora.org>
2019-02-17 21:25:32 -08:00
Vikash Garodia
e18e27735c msm: vidc: Ensure validity of shared Q indices
Video driver and firmware communicates over shared queue.
The queue header has the indices which synchronizes the read
and write between the driver and firmware modules.
This change ensures that the indices are within the valid
range before accessing them.

CRs-fixed: 2345481
Change-Id: I8da6bb4218a5b8ec0e2e2c7b87f6cc9eec21bd16
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Signed-off-by: Paras Nagda <pnagda@codeaurora.org>
Signed-off-by: Vasantha Balla <vballa@codeaurora.org>
2019-02-15 03:27:21 -08:00
Vinayak Menon
979cdd6f6e ion: fix system secure force alloc
Even when ION_FLAG_POOL_FORCE_ALLOC is set for secure alloc,
alloc_from_pool_preferred tries to get the pages from pool
first. In case if it enters split_page_from_secure_pool,
free_buffer_page can end up calling __free_pages on the page
from pool which is hyp assigned, resulting in issues for e.g.
a fault if page poisoning is enabled.

Change-Id: I68759dc17551a5705693506a5c137977d429fe36
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
2019-02-12 21:47:51 -08:00
Jann Horn
38f4fba64d mm/vmstat.c: fix outdated vmstat_text
7a9cdebdcc17 ("mm: get rid of vmacache_flush_all() entirely") removed the
VMACACHE_FULL_FLUSHES statistics, but didn't remove the corresponding
entry in vmstat_text.  This causes an out-of-bounds access in
vmstat_show().

Luckily this only affects kernels with CONFIG_DEBUG_VM_VMACACHE=y, which
is probably very rare.

Change-Id: Ia4f5f0327d58a7831aff010949fa31bfd56139dc
Link: http://lkml.kernel.org/r/20181001143138.95119-1-jannh@google.com
Fixes: 7a9cdebdcc17 ("mm: get rid of vmacache_flush_all() entirely")
Signed-off-by: Jann Horn <jannh@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Roman Gushchin <guro@fb.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Christoph Lameter <clameter@sgi.com>
Cc: Kemi Wang <kemi.wang@intel.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 28e2c4bb99aa40f9d5f07ac130cbc4da0ea93079
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
2019-02-10 21:55:41 -08:00
Linux Build Service Account
6fd3e4ce63 Merge "mm: get rid of vmacache_flush_all() entirely" 2019-02-08 11:43:33 -08:00
Linux Build Service Account
3e34840002 Merge "msm: vidc: fix KCFI errors" 2019-02-08 03:13:58 -08:00
Linus Torvalds
13fbdf9d9a mm: get rid of vmacache_flush_all() entirely
commit 7a9cdebdcc17e426fb5287e4a82db1dfe86339b2 upstream.

Jann Horn points out that the vmacache_flush_all() function is not only
potentially expensive, it's buggy too.  It also happens to be entirely
unnecessary, because the sequence number overflow case can be avoided by
simply making the sequence number be 64-bit.  That doesn't even grow the
data structures in question, because the other adjacent fields are
already 64-bit.

So simplify the whole thing by just making the sequence number overflow
case go away entirely, which gets rid of all the complications and makes
the code faster too.  Win-win.

[ Oleg Nesterov points out that the VMACACHE_FULL_FLUSHES statistics
  also just goes away entirely with this ]

Change-Id: Ib485c9f33638e844f2378a1ec376e64200d30fd2
Reported-by: Jann Horn <jannh@google.com>
Suggested-by: Will Deacon <will.deacon@arm.com>
Acked-by: Davidlohr Bueso <dave@stgolabs.net>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 84580567f1f856d2c7a610273315852e345bc3ac
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
2019-02-08 01:55:58 -08:00
Govindaraj Rajagopal
b6376f2b6d msm: vidc: fix KCFI errors
Fix errors reported after enabling Kernel Control Flow
Integrity (KCFI) on kernel code. This is a security
mechanism that disallows changes to the original
control flow of a compiled binary.

Change-Id: I1e1e901c5889d9928411dc785da88e1eac378560
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Signed-off-by: Sanjay Singh <sisanj@codeaurora.org>
2019-02-07 18:07:35 +05:30
Linux Build Service Account
45d0550497 Merge "msm: vidc: Add memory barrier after queue header update" 2019-02-06 23:03:58 -08:00
Sanjay Singh
2eae84f039 msm: vidc: Correct error handling for allocation failure cases
In error handling, trying to free memory which is not yet
allocated. Fix is added to correct this error handling.

Change-Id: I4e91a95f7ebd9132141d8686ae2bdfaed3a9a8c1
Signed-off-by: Sanjay Singh <sisanj@codeaurora.org>
Signed-off-by: Vasantha Balla <vballa@codeaurora.org>
2019-02-06 00:46:18 -08:00
Maheshwar Ajja
7fef9d4e2d msm: vidc: Add memory barrier after queue header update
Add memory barrier after updating queue header variables
to ensure main memory is updated so that video hardware
reads the updated header values.

CRs-Fixed: 2135048
Change-Id: I1a2778bee16c9093284c4d33980e6985c279f499
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Signed-off-by: Sanjay Singh <sisanj@codeaurora.org>
2019-02-06 11:44:38 +05:30
Linux Build Service Account
8b4d96792a Merge "msm: vidc: ensure codec count is in supported session range" 2019-02-04 06:38:19 -08:00
Vijayanand Jitta
412b07f4da iommu: dma-mapping-fast: Add a check for count in fast_smmu_alloc
In fast_smmu_alloc size_t variable size is type casted to int
variable count, this variable count can get truncated and can
result in memory corruption during unmap, make count as size_t
and also add a check for count as sg_alloc_table_from_pages
accepts unsigned int value for count.

Change-Id: I4780a554c5c062fd9dd229e5cc0ac804b1ba31d8
Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org>
2019-02-03 22:25:34 -08:00
Dikshita Agarwal
329c3ba349 msm: vidc: ensure codec count is in supported session range
Ensure the count of supported encoder and decoder returned
from firmware are within the range of supported sessions

Change-Id: If3eae7bc82dc8302444e2e4104fb6ae3cfbfed5a
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
Signed-off-by: Vasantha Balla <vballa@codeaurora.org>
2019-02-03 22:12:38 -08:00
Shreyas Narayan
a440819fb4 Merge commit '1653208bf47b0d44ebc2ba96f07c639049176669' into HEAD
Change-Id: I9c5823d88f65f85c639d97a74eaf041b24876a0e
Signed-off-by: Shreyas Narayan <shrena@codeaurora.org>
2019-02-01 07:59:12 +05:30
Linux Build Service Account
afbf8abea5 Merge "msm: mdss: Fix potential null pointer dereference" 2019-01-31 10:35:18 -08:00
Linux Build Service Account
1971c91580 Merge "ipc: Implement FIFO queue to fix sequence inconsistency" 2019-01-30 23:34:48 -08:00
Xiaojun Sang
1d6109e0e9 ipc: Implement FIFO queue to fix sequence inconsistency
The SVA history buffer is out of order if there are
more than 2 continuous RX buffer done from GLINK. Implement
FIFO to ensure sequence consistency.

Change-Id: If70e2d0160e8f3140d621298b0db03bd89ba88ba
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
2019-01-31 10:48:51 +08:00
Mayank Rana
539ae5515f dwc3: gadget: Take copy of dwc->gadget_driver before releasing lock
gadget_driver can become null if gadget_stop is called while any other
gadget callbacks are in progress. As gadget callbacks needs to release
spinlock before the callback, store the local copy of gadget_driver to
avoid the race with gadget_stop.

Change-Id: I7f0cbf9af3e3b286f2826647f08215f29f699de1
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
2019-01-30 00:30:51 -08:00
Linux Build Service Account
1653208bf4 Merge "msm: ais: ispif: Fix invalid type conversion" 2019-01-23 05:14:38 -08:00
Linux Build Service Account
2c72b0a902 Merge "msm: camera: isp: Fix invalid type conversion" 2019-01-23 05:14:15 -08:00
E V Ravi
0655daaa91 msm: ais: ispif: Fix invalid type conversion
Due to improper type conversion compilation
issue will be seen. Made change to access the
appropriate type.

Change-Id: I54777fe71a2f29297b439ac26f80b9684222d89a
Signed-off-by: E V Ravi <evenka@codeaurora.org>
2019-01-22 23:01:01 -08:00
Meera Gande
0d2dac557e msm: camera: isp: Fix invalid type conversion
Due to improper type conversion compilation
issue will be seen. Made change to access the
appropriate type.

Change-Id: I2c61364f0385c83aa304788cc705bf4ca48ac2cc
Signed-off-by: Meera Gande <mgande@codeaurora.org>
2019-01-22 23:00:51 -08:00
Linux Build Service Account
87edacbe36 Merge "usb: pd: Don't reject sink request based on max current" 2019-01-22 19:57:25 -08:00
Linux Build Service Account
e3357a357e Merge "msm: wlan: Update ETSI1 and ETSI13 countries" 2019-01-22 07:37:11 -08:00
Linux Build Service Account
d33de034f0 Merge "iommu/iommu-debug: fix buffer overflows in debugfs read functions" 2019-01-22 07:37:10 -08:00
Rajeev Kumar Sirasanagandla
4a7a770994 msm: wlan: Update ETSI1 and ETSI13 countries
In db.txt, update ETSI1 and ETSI13 countries with NO-OUTDOOR flag
for frequency ranges: (5170 - 5250) and (5250 - 5330).

CRs-Fixed: 2379868
Change-Id: I8a9ce955e82b14814ead5f0bf118608ea90cbc53
Signed-off-by: Rajeev Kumar Sirasanagandla <rsirasan@codeaurora.org>
2019-01-22 03:48:18 -08:00
Srinivasarao P
6a8e47eb57 iommu/iommu-debug: fix buffer overflows in debugfs read functions
The kernel buffer 'ubuf' can overflow while copying data to user
space in debugfs read functions. Fix it by limiting the length of
data to be copied to userspace.

Change-Id: Ibb3d8c4fb637ddc0e63677ec2dff14a4cf8c0c73
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
2019-01-22 01:04:00 -08:00
Linux Build Service Account
0bfccff096 Merge "msm: adsprpc: Fix memory out of bounds error" 2019-01-21 22:50:39 -08:00
Linux Build Service Account
62f5f5cf6f Merge "f2fs: fix to account IO correctly" 2019-01-21 09:12:48 -08:00
Jack Pham
bccbbac9f0 usb: pd: Don't reject sink request based on max current
A fixed sink PDO request includes both operating current and
max current. Although the max current requested may be greater
than the available source advertisement, as per spec only the
operating current request needs to be considered. The sink will
likely have also set the Capability Mismatch bit as well. Hence,
don't reject the request otherwise the sink will keep
re-requesting and never enter a contract.

Change-Id: Ia15e2e17abe43f2bcbc1fe7011b70ab0e0f5d9eb
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2019-01-18 09:45:23 -08:00
Chao Yu
046b4ced72 f2fs: fix to account IO correctly
Below race can cause reversed reference on dirty count, fix it by
relocating __submit_bio() and inc_page_count().

Thread A				Thread B
- f2fs_inplace_write_data
 - f2fs_submit_page_bio
  - __submit_bio
					- f2fs_write_end_io
					 - dec_page_count
  - inc_page_count

Cc: <stable@vger.kernel.org>
Fixes: d1b3e72d5490 ("f2fs: submit bio of in-place-update pages")
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Git-Commit: 2cc5dcf7a9e074c5bdfdefea1801aa0a657750d6
Git-Repo: https://android.googlesource.com/kernel/common
Change-Id: Ifff46ef82be68fc910ea3dbcc2299a22664587d4
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
2019-01-18 14:54:15 +05:30
gaolez
0524c91128 msm: wlan: Update regulatory database
Update country ETSI13 related country's frequency range and tx
power.

Change-Id: Iae27b12df3b36621c395ef9e8a3b1b46461848b6
CRs-Fixed: 2246140
Signed-off-by: Gaole Zhang <gaolez@codeaurora.org>
2019-01-17 02:03:24 -08:00
Linux Build Service Account
e04cd35fd5 Merge "msm: wlan: Remove DSRC channels for US" 2019-01-16 10:20:13 -08:00
Amar Singhal
28aafa4f47 msm: wlan: Remove DSRC channels for US
DSRC channels are not required when SRD channels are enabled. Therefore
remove them.

Signed-off-by: Amar Singhal <asinghal@codeaurora.org>
Change-Id: I1b2937c45d43d31c5689c7c4d134fcfb9a265b0e
CRs-Fixed: 2174850
2019-01-16 16:42:54 +05:30
Amar Singhal
e476b565b0 msm: wlan: Add support for UNI-III ETSI sub-band
Per the EU STD. ETSI EN 300 440, sub-band 5725-5875 is
allowed in EU at reduced power of 25 mW. Add the sub-band to
the EU countries that support this sub-band.

CRs-Fixed: 2141740
Change-Id: I0a43e99c4357527f607110faecddd9d0fd444fc6
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>
Signed-off-by: Rajeev Kumar Sirasanagandla <rsirasan@codeaurora.org>
2019-01-16 16:25:01 +05:30
Linux Build Service Account
79ca956b8e Merge "soc: qcom: fix race condition while freeing private data" 2019-01-16 01:31:57 -08:00
Linux Build Service Account
0ec3a4d049 Merge "ARM: dts: msm: Specify the temperature sensor name for msm8996" 2019-01-14 04:37:24 -08:00
Sunil Khatri
9548b41a99 ARM: dts: msm: Specify the temperature sensor name for msm8996
Specify the name of GPU temperature sensor in the device tree.
This name is used to get the sensor's temperature by querying the
thermal driver API.

CRs-Fixed: 1064728
Change-Id: Ia93d93a442aa848cbd42a5fb8ecad5ef875f9abf
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
Signed-off-by: Sunil Khatri <sunilkh@codeaurora.org>
Signed-off-by: Archana Sriram <apsrir@codeaurora.org>
2019-01-10 11:50:18 +05:30
Mohammed Nayeem Ur Rahman
74bc55d2fa msm: adsprpc: Fix memory out of bounds error
Fixes memory out of bound error.

Change-Id: I9cc11b5231ba3654588eadf7a7adca68aff35684
Signed-off-by: Mohammed Nayeem Ur Rahman <mohara@codeaurora.org>
2019-01-08 04:47:37 -08:00
Linux Build Service Account
b486ad9760 Merge "msm: adsprpc: allocate all remote memory in kernel" 2019-01-06 23:14:54 -08:00
guqicai
fed10a0fce Increase MAX_RESERVED_REGIONS
Increase MAX_RESERVED_REGIONS for reserved regions

Change-Id: Ica7f7196d2c10d99a7d134f1036131657753df93
(cherry picked from commit f071e4e0734f90eb1be8c6c3d41cbc60cc46e243)
2019-01-05 10:01:15 +01:00
Wei Wang
dabbcf23c7 oneplus5: set default readahead to 2048KB
Android has been benefiting quicker boot from bigger readahead during
boottime than runtime. However, the boottime readahead setting is set
when init is established after treble early mount. This patch will make
readahead bigger by default so early boot can benefit from it. Readahead
will be reset by init on boot_complete.

Bug: 62413151
Test: boot walleye 100ms faster
Change-Id: Ic9dad5666ce3d4836d73afbcee04cfb875f64f5d
Signed-off-by: Wei Wang <wvw@google.com>
2019-01-05 10:00:32 +01:00
Wei Wang
4d467694ff ANDROID: mm: add config for default readahead size
Change the VM_MAX_READAHEAD value from the default 128KB to a
configurable value. This will allow the readahead window to grow to a
maximum size bigger than 128KB, which greatly benefits to sequential
read throughput and thus boot performance.

Bug: 62413151
Test: boot walleye 100ms faster
Change-Id: Iad448cf1198056de46654dcb409466802b3b908d
Signed-off-by: Wei Wang <wvw@google.com>
2019-01-05 10:00:14 +01:00
Tharun Kumar Merugu
092de9c894 msm: adsprpc: allocate all remote memory in kernel
Allocate all memory given to remote subsystem in the kernel
instead of mapping memory allocated in userspace.

Change-Id: I79c1f40d426e271403afa67514714fe6af26cf4e
Acked-by: Thyagarajan Venkatanarayanan <venkatan@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
2019-01-04 16:42:12 +05:30
davidliu
7cd83df04f mdss: Optimized sRGB display mode
repair that the sRGB is not effect after screen on

Change-Id: I568fad38bdaf1129e13e6741664a50986d0d6cd9
2019-01-01 17:59:48 +01:00
Johannes Berg
da24b5fa50 ipv4: add option to drop gratuitous ARP packets
In certain 802.11 wireless deployments, there will be ARP proxies
that use knowledge of the network to correctly answer requests.
To prevent gratuitous ARP frames on the shared medium from being
a problem, on such deployments wireless needs to drop them.

Enable this by providing an option called "drop_gratuitous_arp".

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 4078228159c9f54cca7347a8bdace29f2abdef65)

Change-Id: I8772dbd7471085878f8b4161eb2a056d79b8b232
2018-12-30 12:35:55 +01:00
Pranav Vashi
6fe8b6e686 cpufreq: deoneplusify and remove PM QOS changes
Change-Id: I5a4fc49a9238d996cfe372a82e8988df3cfe0e30
2018-12-30 10:12:25 +01:00
Johannes Berg
ef6786d280 ipv6: add option to drop unsolicited neighbor advertisements
In certain 802.11 wireless deployments, there will be NA proxies
that use knowledge of the network to correctly answer requests.
To prevent unsolicitd advertisements on the shared medium from
being a problem, on such deployments wireless needs to drop them.

Enable this by providing an option called "drop_unsolicited_na".

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit aec215e7aa380fe5f85eb6948766b58bf78cb6c3)

Change-Id: Iad429a767a786087b0985632be44932b2e3fd1a8
2018-12-30 10:11:48 +01:00