Commit graph

606996 commits

Author SHA1 Message Date
Jann Horn
fb7adf69e0 fs/binfmt_flat.c: make load_flat_shared_library() work
commit 867bfa4a5fcee66f2b25639acae718e8b28b25a5 upstream.

load_flat_shared_library() is broken: It only calls load_flat_file() if
prepare_binprm() returns zero, but prepare_binprm() returns the number of
bytes read - so this only happens if the file is empty.

Instead, call into load_flat_file() if the number of bytes read is
non-negative. (Even if the number of bytes is zero - in that case,
load_flat_file() will see nullbytes and return a nice -ENOEXEC.)

In addition, remove the code related to bprm creds and stop using
prepare_binprm() - this code is loading a library, not a main executable,
and it only actually uses the members "buf", "file" and "filename" of the
linux_binprm struct. Instead, call kernel_read() directly.

Link: http://lkml.kernel.org/r/20190524201817.16509-1-jannh@google.com
Fixes: 287980e49ffc ("remove lots of IS_ERR_VALUE abuses")
Signed-off-by: Jann Horn <jannh@google.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Kees Cook <keescook@chromium.org>
Cc: Nicolas Pitre <nicolas.pitre@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Greg Ungerer <gerg@linux-m68k.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-10 09:56:30 +02:00
Mohammed Javid
eedc5c20ec msm: ipa: Fix pointer checked for NULL may be used
Data pointer may be NULL, check for reset value
to be false in that case and return EINVAL for
invalid argument.

Change-Id: I05a4aa96724c123516a7965bd0e939bdf0c86553
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2019-07-10 13:13:49 +05:30
Chetan C R
74b8097864 usb: phy-msm-susb-qmp: Add checks to check clk_enabled
During dwc3 suspend clk_disable is directly getting
called without calling clk_enable in dwc3 resume
functionality for SS Phy. This fix add a check and
disables clock only if it is enabled.

Change-Id: Id4c4a71ca4e57274c0f09a83ce4d22fe13909cd1
Signed-off-by: Chetan C R <cravin@codeaurora.org>
2019-07-09 23:31:39 -07:00
Sriharsha Allenki
21d3a21698 ARM: dts: msm: Enable DP DM pulsing support on MSM8996
The charger associated with MSM8996 does not support
HVDCP detection by default. Enable DP DM pulsing support
so that charger driver can support HVDCP detection.
And all the 8996 platforms does not have this charger,
hence enable the pulsing support on those platforms
where this charger is present.

Change-Id: I70549df99bd11303d7c334227c869767f5ea51a8
Signed-off-by: Sriharsha Allenki <sallenki@codeaurora.org>
2019-07-10 11:06:41 +05:30
Linux Build Service Account
a18db927c6 Merge "clocksource: arm_arch_timer: Fix a NULL Pointer dereference" 2019-07-09 16:01:05 -07:00
Jim Blackler
d657433f12 ANDROID: Fixes to locking around handle_lmk_event
get_task_struct used to reserve 'selected' outside rcu_read_lock block.
Remove the need for get_task_mm, removing the possibility of lock issues there.

Bug: 133479338
Signed-off-by: Jim Blackler <jimblackler@google.com>
Change-Id: I1399e2f669242c04e0e397bc09c987358aa97a0a
2019-07-09 13:45:40 +01:00
Jim Blackler
c93a1fab24 ANDROID: Avoid taking multiple locks in handle_lmk_event
Conflicting lock events have been reported resulting from
rcu_read_lock, mmap_sem (in get_cmdline) and  lmk_event_lock.

This CL avoids the possibility of these conditions by moving
handle_lmk_event outside rcu_read_lock and invoking get_cmdline before
lmk_event_lock is taken.

Bug: 133479338, 133829075
Signed-off-by: Jim Blackler <jimblackler@google.com>
Change-Id: Ib3c32587472bd972e3ac108798e2af3f4a5c329a
2019-07-09 13:45:40 +01:00
Ankit Mishra
bacd235ea6 clocksource: arm_arch_timer: Fix a NULL Pointer dereference
In case best_frame is not populated with virtual/physical capable frame,
NULL pointer is passed as an argument to of_iomap .To avoid  NULL pointer
dereference add a check before.

Change-Id: Ia7bad6630662ee3a4ad7c9226f9d3858b2e7a36c
Signed-off-by: Ankit Mishra <ankimi@codeaurora.org>
2019-07-09 14:05:25 +05:30
Linux Build Service Account
8f67218145 Merge "msm: sensor: actuator: fix out of bound read for bivcm region params" 2019-07-09 00:39:59 -07:00
Haibin Liu
1656e2e44d msm: sensor: actuator: fix out of bound read for bivcm region params
The region index for bivcm is not validated against the region size.
This causes out-of-bound read on the KASAN kernel.
Add restriction that region index smaller than region size.

CRs-Fixed: 2379514
Change-Id: I72c4a41a4b41c8fa70c174ffd3215a81eaa14355
Signed-off-by: Haibin Liu <haibinl@codeaurora.org>
2019-07-08 19:09:41 -07:00
Linux Build Service Account
1e577bde0f Merge "AndroidKernel: Building dtb.img to support header version 2" 2019-07-08 12:16:27 -07:00
Linux Build Service Account
a19883a728 Merge "Merge android-4.4.184 (282d84a) into msm-4.4" 2019-07-08 01:51:14 -07:00
Linux Build Service Account
1c5947a789 Merge "defconfig: msm: Enable CONFIG_HID_SONY for SDM660 and MSM8998" 2019-07-05 18:32:46 -07:00
Rahul Shahare
493febf7fb AndroidKernel: Building dtb.img to support header version 2
The dtb.img is made by concatenating all the compiled dtbs
after the kernel is compiled. This dtb.img is then added to be
a part of the boot.img.

Change-Id: I9684126c312e3f5988b1eaa298b37037a11fe747
Signed-off-by: Rahul Shahare <rshaha@codeaurora.org>
2019-07-05 18:45:01 +05:30
Swetha Chikkaboraiah
1f193de795 defconfig: msm: Enable CONFIG_HID_SONY for SDM660 and MSM8998
Enable CONFIG_HID_SONY for compliance with android Q CTS suite
requirement for SDM660 and MSM8998.

Change-Id: Ie87d55f861c47a018b7b368b58ef79f46d449268
Signed-off-by: Swetha Chikkaboraiah <schikk@codeaurora.org>
2019-07-05 04:42:18 -07:00
raghavendra ambadas
0bf1f85ad6 fbdev: msm: check for target supports dest scaler
user space can send commit message with dest scaler structure populated,
this would cause null pointer access, if dest scaler is not initialized,
this change validate if target supports dest scaler.

Change-Id: I37516f4704a013d4628688930783d6e7ab93277f
Signed-off-by: Raghavendra Ambadas <rambad@codeaurora.org>
2019-07-05 15:44:33 +05:30
Linux Build Service Account
09d42880fd Merge "msm: camera_v2: isp: update the frame drop during error case" 2019-07-05 02:59:12 -07:00
Linux Build Service Account
19d79e95f1 Merge "msm📷 add trace log support for VFE events" 2019-07-05 02:59:04 -07:00
Linux Build Service Account
3ae0451881 Merge "msm: camera_v2: Remove sysfs bind/unbind files" 2019-07-04 01:52:05 -07:00
Srikanth Uyyala
8be3b55c4c msm: camera_v2: isp: update the frame drop during error case
when pending requests are present due to drop_reconfig,
avoid skip_all programming to hardware during epoch event.

Change-Id: I9a56d179c30484c99c36bf1a9d60e8071fdd4a9a
Signed-off-by: Srikanth Uyyala <suyyala@codeaurora.org>
Signed-off-by: Sumalatha Malothu <smalot@codeaurora.org>
2019-07-03 23:44:01 -07:00
Srikanth Uyyala
45b4ac208b msm📷 add trace log support for VFE events
trace log support added for important VFE events,
these traces can be enabled with camera trace event.

Change-Id: I1e5c043ad3b69df632ff63130ff8eea10ab2097c
Signed-off-by: Srikanth Uyyala <suyyala@codeaurora.org>
Signed-off-by: Sumalatha Malothu <smalot@codeaurora.org>
2019-07-04 12:12:07 +05:30
Lokesh Kumar Aakulu
5974bd4025 msm: camera_v2: Fix page fault issue in camera ISP
Fix page fault in ISP when there is no reg update
for two consecutive request frame time.

Change-Id: Ie246f146c1ec0785e0e6fa0671dd2ff28fbe6b38
Signed-off-by: Lokesh Kumar Aakulu <lkumar@codeaurora.org>
Signed-off-by: Sumalatha Malothu <smalot@codeaurora.org>
2019-07-04 12:01:02 +05:30
Srikanth Uyyala
28e17c1f65 msm: camera_v2: isp: handle frame drop due to scheduling latency
There is possibility that due to scheduling latency of tasklet,
user threads VFE hardware could not be updated intime resulting
in fatal error, invalid memory access. Added logic to track
and gracefully handle the scheduling issues.

Change-Id: I29acde4fe23a59e6ff0e5190e1c4b9c59f6ae08f
Signed-off-by: Srikanth Uyyala <suyyala@codeaurora.org>
Signed-off-by: Sumalatha Malothu <smalot@codeaurora.org>
2019-07-04 11:53:12 +05:30
Linux Build Service Account
ed8c0918ee Merge "icnss: Reduce the shutdown timeout from 50sec to 15sec" 2019-07-03 00:25:35 -07:00
Linux Build Service Account
7e4d878022 Merge "drm/msm/dsi-staging: Add range check in debugfs_dump_info_read" 2019-07-02 07:13:43 -07:00
Mohammed Siddiq
978400398a icnss: Reduce the shutdown timeout from 50sec to 15sec
Sub-system shutdown timeout is 20 seconds. In wlan platform driver,
modem block shutdown timeout should be less than sub-system timeout.
Hence, change block shutdown timeout to 15 seconds.

Change-Id: I936e0c462858727b86b35b924dd124a5d1434780
Signed-off-by: Mohammed Siddiq <msiddiq@codeaurora.org>
2019-07-02 18:34:16 +05:30
Chris Lew
9e7a1f7c57 soc: qcom: glink_smem: Initialize buffers
Zero initialize the local variables that store information from the
remote. On the chance reading from the remote fails, the data in these
structs will now be zero instead of stale data.

Change-Id: Iafaeb71a5dc57e27a34b4250ea529fbe27df2393
Signed-off-by: Chris Lew <clew@codeaurora.org>
2019-07-02 12:45:28 +05:30
Venu Raidu
4e08c8cbac msm: camera_v2: Remove sysfs bind/unbind files
This change disables dynamic bind/unbind capability
for CPP/JPEG/FD modules since it is not currently supported.

Change-Id: Ice692d7d700c3b7a75463b109265f958993031eb
Signed-off-by: Venu Raidu <vraidu@codeaurora.org>
Signed-off-by: Sumalatha Malothu <smalot@codeaurora.org>
2019-07-02 00:00:19 -07:00
Linux Build Service Account
79a8f21570 Merge "ASoC: sdm660_cdc: Set speaker amplifier enable bit" 2019-07-01 08:54:15 -07:00
Linux Build Service Account
c0f636f832 Merge "cnss2: Update board data file name format" 2019-07-01 00:42:14 -07:00
Srinivasarao P
2958c456e6 Merge android-4.4.184 (282d84a) into msm-4.4
* refs/heads/tmp-282d84a
  Linux 4.4.184
  tcp: refine memory limit test in tcp_fragment()

Change-Id: I99ffacfb623b2cc5acb0401a3dfc08bae6461810
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
2019-07-01 10:48:12 +05:30
Linux Build Service Account
bd48b0a101 Merge "msm: kgsl: Add missing check for snapshot IB dump" 2019-06-29 15:41:50 -07:00
Linux Build Service Account
2f5e49a218 Merge "defconfig: msm: Disable EXT2 and EXT3 FS configs for MSM8998" 2019-06-29 15:41:49 -07:00
Linux Build Service Account
46ece1ae20 Merge "sched/walt: Fix the memory leak of idle task load pointers" 2019-06-29 15:41:48 -07:00
Linux Build Service Account
7854013373 Merge "soc: qcom: smem: validate fields of shared structures" 2019-06-29 15:41:47 -07:00
Linux Build Service Account
196d97abd3 Merge "Merge android-4.4.183 (94fd428) into msm-4.4" 2019-06-29 15:41:46 -07:00
Linux Build Service Account
fad4d2e837 Merge "msm: kgsl: Change data type for GPU ib vote" 2019-06-29 15:41:45 -07:00
Linux Build Service Account
54d23a97a0 Merge "drivers: thermal: Use FCAP scm call instead of DMAX in LMH DCVSh" 2019-06-29 15:41:42 -07:00
Greg Kroah-Hartman
282d84add5 This is the 4.4.184 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAl0UCi4ACgkQONu9yGCS
 aT49SxAAliuKcsgijn3gXsIdsJLJPPx/vRJz5anTBAJ5uUX5pBRiEzNFNnU5mBho
 msD4sc1tW/6SopAqC+Wh4p+dg913SC3raVbhT2e+wXY0p8Tu0rCIeHdLOS0UzF9w
 ukYdQuhlXkxjr/m6bBRNxNKGgP0SV9oxWRGZoHGLMPNTVkIqonWyX/uBnXq0R5xo
 Xseu5F2C0BJ21rCwLxhzW1oQn4KXVj/qbZbv59q8KNdyupGMLJdZxQquhcERSLka
 Q7d1U5+YLT0/0+dr8aVAfA23pSHxxpnSocBb7jpPi8mABSTgWjJg983ESOWGA/iO
 /JwH7+und7yo4Iw5dwmEAY7WprXFuv3HgedNAT0dkSo70UjkxqpA+/LPEgOB6KPo
 AZuDQf/cnp7bktfFTucFVtlqc+odPG4yc/DZ9CygxAVqkQI9OWAbVYHL0zNN5LiD
 xbVJ+9sHg6m2e1PPaHQNJdzi9fKiWesMu3hhP5rovuqZa6QMtWxCviAkiKY8n0XM
 Wbc7Aoi7w2U/01YkklUq+Ku99ceh8d8i33j/WDawb0+Jy2/VynDu1faQTZ/Qx+in
 604TG6mOfru9nVaOXM8e2+PU4ZtCorXyc0+yPsAnQs+aCRrC3PEWSAAnCoCAXGMu
 nbQXsMFKwS3wjRYVbBsROjE+Nn2hhNiGleqpNaVMugr6V+TJNhI=
 =6BDD
 -----END PGP SIGNATURE-----

Merge 4.4.184 into android-4.4

Changes in 4.4.184
	tcp: refine memory limit test in tcp_fragment()
	Linux 4.4.184

Change-Id: I7119c826708041464de37eaec1d6c5a344be8124
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2019-06-28 11:20:02 +02:00
Rajesh Kemisetti
1379d11803 msm: kgsl: Add missing check for snapshot IB dump
During ringbuffer parsing, same IB can exist multiple times
but size validation happens only for the first time.
This leads to out of bound access if the subsequent sizes are
greater than the allocated size.

Add a check to make sure that requested size is within the
allocated range.

Change-Id: Ie5d3c02c1669de2e6188821399e985f0991aa57c
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
2019-06-28 14:34:10 +05:30
Naitik Bharadiya
2c8f4699fd defconfig: msm: Disable EXT2 and EXT3 FS configs for MSM8998
This is required to fix the VTS test case failures which are failing
as the kernel supports EXT2/EXT3 but the tools mkfs.ext2/mkfs.ext3
doesn't exist anymore.

Change-Id: Iaa17b827439e4f775cdfe9044d35b8a0155f8f08
Signed-off-by: Naitik Bharadiya <bharad@codeaurora.org>
2019-06-27 12:53:27 +05:30
Deepak Kumar Singh
fcc47ec62a soc: qcom: smem: validate fields of shared structures
Structures in shared memory that can be modified by remote
processors may have untrusted values, they should be validated
before use.

Adding proper validation before using fields of shared
structures.

CRs-Fixed: 2421611
Change-Id: Ifed71c506a26105eac3db9ee35f086d7dbf5a3a3
Signed-off-by: Deepak Kumar Singh <deesin@codeaurora.org>
2019-06-27 10:32:41 +05:30
Greg Kroah-Hartman
72d1ee93e9 Linux 4.4.184 2019-06-27 08:13:33 +08:00
Eric Dumazet
46c7b5d6f2 tcp: refine memory limit test in tcp_fragment()
commit b6653b3629e5b88202be3c9abc44713973f5c4b4 upstream.

tcp_fragment() might be called for skbs in the write queue.

Memory limits might have been exceeded because tcp_sendmsg() only
checks limits at full skb (64KB) boundaries.

Therefore, we need to make sure tcp_fragment() wont punish applications
that might have setup very low SO_SNDBUF values.

Fixes: f070ef2ac667 ("tcp: tcp_fragment() should apply sane memory limits")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Christoph Paasch <cpaasch@apple.com>
Tested-by: Christoph Paasch <cpaasch@apple.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-27 08:13:33 +08:00
Soumya Managoli
7151def9c7 ASoC: sdm660_cdc: Set speaker amplifier enable bit
During playback on speaker mute is observed if spk
amplifier is not enabled. Enable speaker amplifier
when SPK PA is enabled.

CRs-Fixed: 2374703
Change-Id: I932d78afc58051b42a21ee77b394a13f111e68c6
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
2019-06-26 11:35:22 +05:30
Pavankumar Kondeti
f395d5810f sched/walt: Fix the memory leak of idle task load pointers
The memory for task load pointers are allocated twice for each
idle thread except for the boot CPU. This happens during boot
from idle_threads_init()->idle_init() in the following 2 paths.

1. idle_init()->fork_idle()->copy_process()->
		sched_fork()->init_new_task_load()

2. idle_init()->fork_idle()-> init_idle()->init_new_task_load()

The memory allocation for all tasks happens through the 1st path,
so use the same for idle tasks and kill the 2nd path. Since
the idle thread of boot CPU does not go through fork_idle(),
allocate the memory for it separately.

Change-Id: I4696a414ffe07d4114b56d326463026019e278f1
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
[schikk@codeaurora.org: resolved merge conflicts]
Signed-off-by: Swetha Chikkaboraiah <schikk@codeaurora.org>
2019-06-25 20:37:06 -07:00
Manaf Meethalavalappu Pallikunhi
03f0af3c21 drivers: thermal: Use FCAP scm call instead of DMAX in LMH DCVSh
LMH-DCVSh driver right now achieves the software mitigation by using
the domain max scm call. But this could have some delays in clearing
the mitigation.

To avoid the delay, use the frequency cap scm call to place the
mitigation.

Change-Id: I00f1b2534505e02c8e66f6ce8088c37bfbb98198
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
2019-06-25 18:07:10 +05:30
Manaf Meethalavalappu Pallikunhi
f6ee0c2bb4 drivers: thermal: Use FCAP scm call instead of DMAX in KTM
KTM driver right now achieves the software mitigation by using
the domain max scm call. But this could have some delays in clearing
the mitigation.

To avoid the delay, use the frequency cap scm call to place the
mitigation.

Change-Id: If357a57836fe0be13977a56a1f20567715908f25
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
2019-06-25 18:02:20 +05:30
Archana Sriram
cb7df67908 msm: kgsl: Change data type for GPU ib vote
Change data type for gpu ib vote to unsigned
long to suit the bw vote data type in devfreq
governor functions.

Change-Id: I6aeb201ee67d111ee527c17e051b5125968a9683
Signed-off-by: Archana Sriram <apsrir@codeaurora.org>
Signed-off-by: Pranav Patel <pranavp@codeaurora.org>
2019-06-25 15:51:56 +05:30
Rajasekaran Kalidoss
c94369b4c1 cnss2: print firmware cap info in stats
Show firmware capability information i.e Chip ID
Chip family, SOC Info, Board id,Firmware Version,
and Firmware Build Timestamp in /d/cnss/stats.

Change-Id: I1d2f2e4a88960e690aabe610182d33cf8035f6c1
Signed-off-by: Rajasekaran Kalidoss <rkalidos@codeaurora.org>
2019-06-24 00:47:44 -07:00