qseecom: Add NULL pointer check in qseecom_ioctl

NULL pointer check is added to the qseecom driver in qseecom_ioctl,
which is required to validate the data pointer before executing any
other code from ioctl's.

Change-Id: I6fecf13769b4d7e94eebd4dc075a5ece79b18e1b
Signed-off-by: AnilKumar Chimata <anilc@codeaurora.org>
qseecom: Fix QSEECOM_IOCTL_UNLOAD_EXTERNAL_ELF_REQ kernel crash

Fixes the kernel crash occuring with IOCTL_UNLOAD_EXTERNAL_ELF_REQ
ioctl by adding unavailable client type to qseecom_client_handle_type
enum, which is required in the driver during qseecom_release().

Change-Id: I73b817255149ffc4a808852feb2954a0ba3c317f
CRs-fixed: 508253
Signed-off-by: AnilKumar Chimata <anilc@codeaurora.org>
msm: scm: Add scm_call_noalloc and helper macros

Currently, scm_call internally calls kmalloc() to allocate a command
buffer structure. This prevents scm_call from working before kmalloc
structures are initialized or during atomic contexts. Allow clients
to pass in a pre-allocated buffer for scm_call to be used for internal
structures.

Change-Id: Id09500c8c696298228aefdcc2a61953e654677c9
CRs-Fixed: 498392
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
arm: Add ARCH_RANDOM Kconfig

Some boards may support architecture generated random numbers. Add
the appropriate Kconfig.

Change-Id: I0077a982c9bb6d3a35435cc27fe40b7e0596ca84
CRs-Fixed: 498392
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
msm: implement ARCH_RANDOM

Currently, the software random number generator is not intialized
until relatively late in the boot process. Software that relies on
random numbers early will not be reliable. Entropy sources are
available early but not early enough for some use cases which means
that moving the software random number generation earlier is not an
option. As an alternate solution, implement the functions associated
with CONFIG_ARCH_RANDOM. These functions currently make a call into
trustzone to get reliable random numbers. The functions are disabled
once the regular random number generator is sufficiently reliable.

Change-Id: If40cfcb96b091fa26a28047c10a902287b26f6c1
CRs-Fixed: 498392
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
init: Move stack canary initialization after setup_arch

Stack canary intialization involves getting a random number.
Getting this random number may involve accessing caches or other
architectural specific features which are not available until
after the architecture is setup. Move the stack canary initialization
later to accomodate this.

Change-Id: I00b564a2c3172229a44339c061fa380c17fe7d8e
CRs-Fixed: 498392
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Merge "qseecom: Add NULL pointer check in qseecom_ioctl"
Merge "qseecom: Fix QSEECOM_IOCTL_UNLOAD_EXTERNAL_ELF_REQ kernel crash"
Bluetooth: Fix for the l2cap layer crashes while turning OFF BT

-This patch fix a case where while turning OFF BT l2cap channel
 & l2cap conn get deleted in one process context, which preempted
 the another process, where l2cap con was being used while trying to
 disconnect l2cap.  As the result l2cap conn pointer become invalid.
 Later which is leading a crash.  L2cap conn should be guarded by
 spin lock while disconnecting l2cap to avoid preemption which will
 avoid  crash due invalid conn pointer.

-This patch fix list_add crash due to invalid skb pointer.
 & BUG sleep warning as well.

CRs-Fixed: 499732, 504054

Change-Id: I90c5d29cc8728566a420f0dedaf7075846b32d1a
Signed-off-by: Nitin Shivpure <nshivpur@codeaurora.org>
Merge "msm: scm: Add scm_call_noalloc and helper macros"
Merge "arm: Add ARCH_RANDOM Kconfig"
Merge "msm: implement ARCH_RANDOM"
Merge "init: Move stack canary initialization after setup_arch"
msm: kgsl: Remove extra call to sync_fence_put()

sync_fence_put is called twice and cause NULL pointer dereference.

Change-Id: Ia29e676af28d9040d1ba1ee8669f1306cc8b4035
Signed-off-by: Alex Wong <waiw@codeaurora.org>
Merge "msm: kgsl: Remove extra call to sync_fence_put()"
Merge "Bluetooth: Fix for the l2cap layer crashes while turning OFF BT"