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>
diag: Fix race condition in diagchar driver

diag driver maintains socket logging process in global driver
structure which is manipulated in switch_logging and in close
file_operation.
There is a possibility of race while clearing the socket logging
process in close operation and sending signal in switch_logging
operation. Adding lock to serialize the two operations.

CRs-Fixed: 495063
Change-Id: I0064509c9ace18a8ff40c5a744363546a9021612
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
leds: leds-pm8xxx: use snprintf for sysfs attribute show method

Sysfs attribute show method is passed a buffer of length PAGE_SIZE.
To prevent from overwriting this buffer, replace usage of sprintf()
with snprintf().

Change-Id: I0f12a2e1309940d0971dab1e7a29c9c03424a682
Signed-off-by: Himanshu Aggarwal <haggarwa@codeaurora.org>
input: atmel_mxt_ts: Add NULL pointer check

Add null pointer exception check for pointer 'fw'
which may be NULL after request_firmware() call
and may be deferenced.

Change-Id: Ie4b4bb8548eb89b01f7f688372d8b0300542f72a
Signed-off-by: Himanshu Aggarwal <haggarwa@codeaurora.org>
msm_fb:hdmi: Fix for audio playback pause issue

When there is non-secure audio playback and if
HDCP authentication fails due to Ri mismatch then
no need to send disconnect event to audio driver.

Change-Id: I57ed85c9677d4df6ccb2ed20217b64c78ff34180
Signed-off-by: Sandeep Panda <spanda@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>
hdmi_msm: Fix CEC timedout on write

Fixes timeout issue when a CEC send is exectued. It was waiting for
a threaded ISR inside the same ISR. Added a polling option with
period of HZ >> 2. The fix handles both cases: when this function
is called within the same ISR, and when this function is called
outside of the ISR.

CRs-fixed: 531377

Change-Id: Ie32a2f80f7f338c07aae8b8854d75c9d706e9ed9
Signed-off-by: Howard Pang <hpang@codeaurora.org>
hdmi: hdcp: added HDMI plugout event for WFD

Invokes a call to check_topology whenever a plugout is detected. The
check_topology will invoke the hdcp manager in the user space. A new
return code enumeration is added, HDMI_DISCONNECTED.

CRs-fixed: 529419

Change-Id: Iae8e9b9b864fda266c7b0993ae3a60559483ed37
Signed-off-by: Howard Pang <hpang@codeaurora.org>
Merge "msm_fb:hdmi: Fix for audio playback pause issue"
msm_fb:hdmi:Target freeze with Non-HDCP Sink

Target freezes when play secure content on non-HDCP
sink because in case of no HDCP authentication function
hdmi_msm_encrypt_en is not relaseing mutex before return

Change-Id: I205ef7dddf2b6a51183de3e565d32afa684dcf73
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
msm_fb:hdmi:Enable encryption if already in secure session

When playing secure content if cable is unplugged and
plugged in again then there is no notification to
HDMI driver to re-enable the encryption again.
So after successful authentication of HDCP, if we are
already in secure session then enable encryption.

Change-Id: Idae88de8fa1bc0ba528664ecca23f715e38d0864
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
Merge "hdmi: hdcp: added HDMI plugout event for WFD"
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"
Merge "hdmi_msm: Fix CEC timedout on write"