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>
msm: kgsl: Improved bounds checking on user specified parameters

Verify that the user specified length for a PMEM region is smaller
than the size of the entire region as reported by the kernel APIs.

CRs-fixed: 380282
Change-Id: Ic0dedbad0127bdaed70eafc00238b44f982b093b
Signed-off-by: Jordan Crouse <jcrouse@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>
gpu: ion: Correcting Klockwork errors

Change-Id: I9f0d909782ee2c00aae73c25a7234756cfe2f5f3
CRs-Fixed: 566918
Signed-off-by: Venkatesh Yadav Abbarapu <quicvenkat@codeaurora.org>
Merge "msm: qdsp5: Memset stack buffer allocation."
EHCI: HSIC: Handle asynchronous interrupt properly

Runtime PM resume and asynchronous interrupt can run in parallel. When
this happens, there is a possibility of PM usage counter mismatch.
Fix this by checking the return value of pm_runtime_get() and by
disabling the USB interrupt while resuming the HSIC.

Consider asynchronous interrupt case when resuming HSIC during system
resume.

CRs-Fixed: 444883
Change-Id: I315fb6cecffcea83c03037be899e3ff840791c21
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Danny Segal <dsegal@codeaurora.org>
usb: ehci-msm-hsic: Add support for ASYNC IRQ to exit LPM

Some HSIC controllers have dedicated IRQ line for ASYNC interrupts
to notify any wakeup event during low power state. Add support for
the same.

CRs-Fixed: 452718
Change-Id: I63f7b21c8306e043128e3c4cae32732a3af60e67
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
Signed-off-by: Danny Segal <dsegal@codeaurora.org>
usbnet: decrease suspend count if returning -EBUSY for runtime suspend

From commit 5eeb3132eb4c5e9ca92e5247fe4575fe9f8c3efe upstream.

This patch decreases dev->suspend_count in the -EBUSY failure path
of usbnet_suspend. Without the change, the later runtime suspend
will do nothing except for increasing dev->suspend_count.

Signed-off-by: Ming Lei <ming.lei@canonical.com>
Acked-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Change-Id: I5e1cbd39e4469150de7cc98af9517a4dbdc80780
CRs-Fixed: 404339
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Signed-off-by: Danny Segal <dsegal@codeaurora.org>
Merge "EHCI: HSIC: Handle asynchronous interrupt properly"
Merge "usb: ehci-msm-hsic: Add support for ASYNC IRQ to exit LPM"
Merge "usbnet: decrease suspend count if returning -EBUSY for runtime suspend"
hwmon: pm8xxx-adc: Fix buffer overflow issue

Fix buffer overflow problem with array
pm8xxx_amux_scaling_ratio.

CRs-Fixed: 566906
Change-Id: I03fdb2171d3027b84659820d5027eddc1f59d6e4
Signed-off-by: Dipen Parmar <dipenp@codeaurora.org>
ASoC: msm: qdsp6v2: Copy frame data based on frame length

Copying data based on count will result in copying
uninitialized data to userspace which can potentially
disclose sensitive data. Fix by copying data based on
frame instead.

CRs-Fixed: 552528, 552531
Change-Id: I307b285ef2aefe00b953cf650582e9ff7e03ceb1
Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
Merge "ASoC: msm: qdsp6v2: Copy frame data based on frame length"
usb: usb_bam: Fix issue for not checking NULL returned value

Ensure to correctly check the right pointer returned
from a call to function platform_get_resource_byname()
in order to prevent accessing this pointer afterwards
in case this pointer is NULL.

Change-Id: I8f6ba2944a4c60d2b4e668686c8bf7bc2640f46b
CRs-Fixed: 535640
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
Signed-off-by: Lena Salman <esalman@codeaurora.org>
msm: ipc: Check pointer validity before dereferencing it

Transport OPEN and CLOSE events are handled by dynamically allocating a
work. Check that the work item is properly allocated before dereferencing
it.

Change-Id: Icb73548f0747494791f14f9c8014f8effd4b844c
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
msm: ipc: Access pointers after a successful check

Some pointers in msm_ipc_router_extract_msg function are accessed either
before a NULL pointer check or if one of the conditions in the check is
true.

Fix the code to dereference those pointers only after the pointer is not
NULL and the other associated conditions are true.

CRs-Fixed: 471110
Change-Id: Ic45fe118818caa6985e5e56403ab3cc467174cf6
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@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: I592d5df4ecd410c3ae0f2aefd58850db75ea25d3

Signed-off-by: Mohammad Johny Shaik <mjshai@codeaurora.org>
Merge "msm: Remove files no longer buildable under arch/arm/mach-msm"
Merge "hwmon: pm8xxx-adc: Fix buffer overflow issue"