msm: audio: qdsp5: Fix to Update acdb_audpp_entry in device switch

-Issue: Parameters of acdb_audpp_entry like, AUDIO_NS_TX, AUDIO_AGC_TX,
AUDIO_IIR_TX is not updating when device switched during recording.
-Incorrect audio session information getting updated to acdb driver
during audio preproc enable call back.
-Fix: By updating the value of acdb_data.audrec_applied variable when
device got changed, acdb_audpp_entry's parameters are getting update.
-By updating audio recording session before calling audio preproc enable.

Change-Id: I224d626ccce0f91eccc29890d870ff98d7fb05ce
CRs-Fixed: 509455
Signed-off-by: Nitesh Bhardwaj <nbhard@codeaurora.org>
qdsp5: memset stack buffer allocation.

This is needed to avoid garbage data in uninitialized variables.

Change-Id: I8a55cd188f8dac86bfafe9c1fc1b4c9e44623776
CRs-Fixed: 553260
Signed-off-by: Mohammad Johny Shaik <mjshai@codeaurora.org>
ASoC:msm:qdsp5: Checks to avoid buffer overflow.

This is needed to avoid buffer over flow, when userspace data in
kernel may go beyond buffer boundary.

Change-Id: Ic56599511ddef8e53808b2dc7e983060c0e104ef
CRs-Fixed: 550177
CRs-Fixed: 550181
CRs-Fixed: 550196
Signed-off-by: Mohammad Johny Shaik <mjshai@codeaurora.org>
msm: qdsp5: Memset stack buffer allocation.

This is needed to avoid garbage data in uninitialized variables.

Change-Id: I2ef43f64b1d31e88bc2435169632c2efc4fb9f88
CRs-Fixed: 553262
Signed-off-by: Mohammad Johny Shaik <mjshai@codeaurora.org>
msm: qdsp5: memset stack buffer allocation.

This is needed to avoid garbage data in uninitialized variables.

Change-Id: Ib3362ae4bc9453e16eb6951a6e2829e4a0decb8e
CRs-Fixed: 554300
Signed-off-by: Mohammad Johny Shaik <mjshai@codeaurora.org>
msm: qdsp5: memset stack buffer allocation.

This is needed to avoid garbage data in uninitialized variables.

Change-Id: I061e7373c05d0239e2c0cb53c71a9ca1cebe6fc8
CRs-Fixed: 554317
CRs-Fixed: 554822
CRs-Fixed: 554844
CRs-Fixed: 556206
CRs-Fixed: 556792
CRs-Fixed: 556786
CRs-Fixed: 556782
CRs-Fixed: 556223
CRs-Fixed: 556219
CRs-Fixed: 556217
CRs-Fixed: 556216
CRs-Fixed: 556212
Signed-off-by: Mohammad Johny Shaik <mjshai@codeaurora.org>
msm: qdsp5: Update code to avoid access userspace data

Copy userspace data to kernel and then access the data
to avoid invalid pointer access issue.
Also, prevent use of uninitialized variables by checking
sscanf return value.

Change-Id: I53c6b0218b26823abfa60fcc015e6c44882b9e5e
CRs-Fixed: 547923
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
msm:qdsp5:Fix to avoid kernel memory disclosure in audio_mvs_ioctl

In audio_mvs_ioctl, msm_audio_mvs_config structre's dtx_mode and
min_max_rate are not initializing, this can lead to a situation
where kernel stack memory is leaked back to user space.
Initializing the strcuture to zero befor using to avoid this situation.

Change-Id: I79a80db4acc3d7b17aeb8ff6b8aa79c562a43c3b
CRs-Fixed: 553259
Signed-off-by: Mohammad Johny Shaik <mjshai@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
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Gopal G Goberu <ggober@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
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/Makefile

Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
msm_serial_hs:Increase rx buffer size to 1024bytes

Increase the UARTDM rx buffer size from 512 bytes
to 1024 bytes. This patch helps to increase the
rx data rates of the clients that uses serial_hs driver.
CRs-Fixed: 514385

Change-Id: I957b1e47887931047e66da555e73683e7dca49a8
Signed-off-by: Dilip Kota <c_dkota@codeaurora.org>
msm: Remove files no longer buildable under arch/arm/mach-msm

Removed the files to reduce efforts as we move driver code out of mach-msm

Change-Id: I6db1521425d22f6b6d8bdfa89156303cc337db24
Signed-off-by: Mohammad Johny Shaik <mjshai@codeaurora.org>
Bluetooth: Update auth type based on link key type

This patch updates connection authentication type, before sending
new authentication request to remote device when remote device has
removed the link key. This is done based on existing link key type.
If Existing link key type is Authenticated Link Key, then
authentication type is reset to Dedicated Bonding from General
Bonding.

Change-Id: I077f9223185a85ff4adf87a4d7f43758b24bcd1e
CRs-Fixed: 522813
Signed-off-by: Hemant Gupta <hemantg@codeaurora.org>
ARM: 7527/1: uaccess: explicitly check __user pointer when !CPU_USE_DOMAINS

The {get,put}_user macros don't perform range checking on the provided
__user address when !CPU_HAS_DOMAINS.

This patch reworks the out-of-line assembly accessors to check the user
address against a specified limit, returning -EFAULT if is is out of
range.

[will: changed get_user register allocation to match put_user]
[rmk: fixed building on older ARM architectures]

CRs-Fixed: 504011
Change-Id: I3818045a136fcdf72deb1371b132e090fd7ed643
Reported-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Git-commit: 8404663f81d212918ff85f493649a7991209fa04
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>

Conflicts:
	arch/arm/include/asm/uaccess.h
USB: msm72k_udc: Synchronize ep dequeue to handle race

The rndis composition switch and handling a rndis command
or a standard request like setup can lead to a race
condition. While the command is getting completed,
ep dequeue may happen as a part of android_disable which
can lead to crash.

Have a busy state marked to the endpoint while
the completion on that request is running and let
ep dequeue wait untill command is completed.

CRs-Fixed: 523964
Change-Id: Ia3a1bbadccdf8abe24cc14ee64aad3d9eae1d3e5
Signed-off-by: Sujeet Kumar <ksujeet@codeaurora.org>
arm: Add ARCH_RANDOM Kconfig

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

Change-Id: I0077a982c9bb6d3a35435cc27fe40b7e0596ca84
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Gopal G Goberu <ggober@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
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
msm: hdmi-cec: bounds check cec frame size

Ensure that the frame size for the HDMI-CEC message
frame size doesn't exceed the maximum size when
reading message from userspace through sysfs interface.
This avoids potential overflow in cec send msg routine.

Change-Id: I09eb8f7a6dee64be2b504c6448b49e1da902aa47
CRs-Fixed: 520140
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
msm: audio: qdsp6v2:  Check return code from audio_aio_open()

When audio_aio_open() is triggered in blocking fashion, it  frees audio
resouces and returns error code. In the current implementation,  callers
did not check the error code which can lead to dereference to freed
resources and cause system crash.  Update the callers to check return
code and then return error back to application to avoid the issue. In
the meanwhile, update the audio_aio_open not to free memory for caller
and leave the caller to free the memory in error condition.

Change-Id: If3bc82f1704ff7cfa0814072eba871d8deb0fd54
CRs-fixed: 436653
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
perf: Treat attr.config as u64 in perf_swevent_init()

Trinity discovered that we fail to check all 64 bits of
attr.config passed by user space, resulting to out-of-bounds
access of the perf_swevent_enabled array in
sw_perf_event_destroy().

Introduced in commit b0a873ebb ("perf: Register PMU
implementations").

Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: davej@redhat.com
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Patch-mainline: linux-kernel @ 04/13/13, 19:49
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.com>

Conflicts:
	kernel/events/core.c

Change-Id: I04e665bfcf2b4889be19264eee3fa8ea02c53e76