unix: fix a race condition in unix_release()

As reported by Jan, and others over the past few years, there is a
race condition caused by unix_release setting the sock->sk pointer
to NULL before properly marking the socket as dead/orphaned.  This
can cause a problem with the LSM hook security_unix_may_send() if
there is another socket attempting to write to this partially
released socket in between when sock->sk is set to NULL and it is
marked as dead/orphaned.  This patch fixes this by only setting
sock->sk to NULL after the socket has been marked as dead; I also
take the opportunity to make unix_release_sock() a void function
as it only ever returned 0/success.

Dave, I think this one should go on the -stable pile.

Special thanks to Jan for coming up with a reproducer for this
problem.

CRs-Fixed: 660580
Change-Id: I0e39b84464cf3f4c9daf8677bba444d0d6d94825
Reported-by: Jan Stancek <jan.stancek@gmail.com>
Signed-off-by: Paul Moore <pmoore@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Git-commit: ded34e0fe8fe8c2d595bfa30626654e4b87621e0
Git-repo: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/
Signed-off-by: Vignesh Radhakrishnan <vigneshr@codeaurora.org>
NFC: don't reparse device tree

probe function parses device tree at the begginning. device tree should not
be reparsed in the middle of the probe.  use the first parse value.

Change-Id: I6695d76c9b05ec9ba2d8f73ee0815ab86078da31
Signed-off-by: Houston Hoffman <hhoffman@codeaurora.org>
ARM: dts: msm: revert the change for HSIC host controller

Due to this change might influence the WCN solution on APQ8074,
revert this change.

Change-Id: Id1feaf5af9e72823f7e0c27c6198c3ebe6eb3465
Signed-off-by: Ming-yi Lin <mylin@codeaurora.org>
ARM: dts: msm: revert the change that disable WCN services

Due to WCN services will be disabled, and it might lead to problems
that WCN driver will not be able to load successfully on APQ8074,
revert this change.

Change-Id: Ia6baabc0885cf8f353ae9fa9f4dc9eeef2629b8c
Signed-off-by: Ming-yi Lin <mylin@codeaurora.org>
ARM: dts: msm: revert the change settings of L19/L10

Due to this change might influence the WCN solution on APQ8074,
revert this change.

Change-Id: If08baa1faa576133ac62222967bed268de51a6bd
Signed-off-by: Ming-yi Lin <mylin@codeaurora.org>
msm: ocmem: Call restore_sec_config() after every power collapse

As the QRIB is enabled, after every power collapse of ocmem, the
QRIB is reset to the maximum security state. Due to this the apps
processor cannot access the ocmem register space.

The restore_sec_config() scm call needs to be called before any
register is accessed after a power collapse to ensure that the
security configuration is restored. The clocks need to be turned
on before every call that is made into TZ to ensure that there
is no power collapse.

CRs-Fixed: 651324, 660089
Change-Id: Ieb6b635142057e219de29e811c93749f6500cec5
Signed-off-by: Neeti Desai <neetid@codeaurora.org>
ASoC: Add external EC reference.

Add support to set external EC reference. The external
reference are set to start along with multimedia
capture session.

Change-Id: I36a8baab5c2b6c45562074a360a53383cef47471
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
ASoC: Correct the mixer control name.

Change the mixer to match userspace mixer control.
Fix the null pointer dereference caused in soc core.
This null pointer exception was found in monkey run.

Change-Id: I41c0d61216b1dd63a295f36593be81697e8a90cb
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
msm: vidc: Validate userspace buffer count

Makesure the number of buffers count is less than
the maximum limit to avoid structure overflow errors.

Change-Id: Icf3850de36325637ae43ac95f1c8f0f63e201d31
CRs-fixed: 563694
Signed-off-by: Pachika, Vikas Reddy <vpachi@codeaurora.org>
msm: vidc: Validate userspace buffer count before using it

Validate the number of buffers count variable before
using it to avoid structure overflow error.

Change-Id: I61582c93e0f26ec6842e437134fb8a42bdbc36ff
CRs-fixed: 563654
Signed-off-by: Pachika, Vikas Reddy <vpachi@codeaurora.org>
Merge "ARM: dts: msm: revert the change for HSIC host controller"
Merge "ARM: dts: msm: revert the change that disable WCN services"
Merge "ARM: dts: msm: revert the change settings of L19/L10"
mdss: Dynamic timeout calculation for cmd stop

Time out condition was hard coded to 60 fps. If dynamic fps
feature was used, an invalid timeout might occur.

Change-Id: I0abe52416c10ef4ae0af6f541d22c66f6c8a6b5e
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
Merge "ASoC: Add external EC reference."
Merge "ASoC: Correct the mixer control name."
msm: mdss: enable fb_split feature for dual-dsi panels

Currently fb_split feature is limited to dual-pipe but single
interface, i.e eDP 2560x1600, panels. Extend use of this feature
to dual-dsi panels as well and by default enable equal split to
support dual-dsi portrait panels, i.e 1600x2560. Default settings
will be over-ridden by split settings from device tree if available.

Change-Id: I38279e1af7dcd1278fa203f51b8b33f82d0848af
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm: vidc: queue output-1 buffers to FW

While seeking, FW returns all the buffers to host.
In multi-stream usecase like downscaling, the o/p
buffers need to be re-queued back to FW.

Change-Id: I5ea8534c06b3e48dadd4d73ab4432a13687a99c1
CRs-Fixed: 631827
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
qseecom: Check the return value of "ion_phys"

Check for return value of "ion_phys" and handle
the error cases appropriately.

Change-Id: Ib4f24af24de2b2553ed91479f46b2f79e0be0446
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
qseecom: Replace kzalloc with ion_alloc

Allocate memory to common lib through kzalloc issues no page error due to
higher order memory requests. So allocate the memory from the heap specially
dedicated to QSEECOM.

Change-Id: Ice4a609d6791ce5adc84b9882231def31674f461
Signed-off-by: AnilKumar Chimata <anilc@codeaurora.org>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>