3 years agousb: gadget: f_fs: make it support v2 func descp
Hans Yang [Tue, 4 Oct 2016 06:48:35 +0000]
usb: gadget: f_fs: make it support v2 func descp

To support Android N adb via super spped to work,
need to accept V2 function descriptors from user space
drivers; without this change it will crash when adb is
working as superspeed.

Bug 200235473

Change-Id: I06f74880e26dd9c71e4cee2c8034d44a0259d5a1
Signed-off-by: Hans Yang <hansy@nvidia.com>
Reviewed-on: http://git-master/r/1231235
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
(cherry picked from commit 90105aa07f720c14e175499809351f240b5b6f8e)
Reviewed-on: http://git-master/r/1243574
Reviewed-by: WK Tsai <wtsai@nvidia.com>
Reviewed-by: ChihMin Cheng <ccheng@nvidia.com>
Reviewed-by: Mark Kuo <mkuo@nvidia.com>
Reviewed-by: Vinayak Pane <vpane@nvidia.com>

3 years agousb: gadget: xudc: fix null update deq pointer
Hans Yang [Wed, 19 Oct 2016 03:28:46 +0000]
usb: gadget: xudc: fix null update deq pointer

This commit adds pointer-check to prevent empty dma address
from an event trb (Ring Overrun/Underrun) being dereferenced
at updating dequeue pointer in udc driver.

The empty dma address will also be translated to null virtual
address and hence dereferencing it causes a kernel panic:

Unable to handle kernel NULL pointer dereference at virtual
address 0000001c
[  269.335313] PC is at update_dequeue_pt+0x38/0x5c
[  269.339925] LR is at update_dequeue_pt+0x2c/0x5c

Bug 200241737

Change-Id: I77c71703ea3ee353005349e9b33e4a587a81cef3
Signed-off-by: Hans Yang <hansy@nvidia.com>
Reviewed-on: http://git-master/r/1243062
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>

3 years agonet: wireless: bcmdhd_88: security enhancement for BRCM ether type
Ramanathan R [Mon, 24 Oct 2016 08:06:34 +0000]
net: wireless: bcmdhd_88: security enhancement for BRCM ether type

Strict checkup for type and event data length
Patch to fix CVE-2016-0801 in DHD driver

Bug 200240360

Change-Id: I67cab7809740c1cba9079fbab0a3ad1848cd7586
Signed-off-by: Ramanathan R <ramanathan.r@broadcom.com>
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: http://git-master/r/1241426
GVS: Gerrit_Virtual_Submit
Reviewed-by: Om Prakash Singh <omp@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>

3 years agovideo: tegra: dc: protect unpin handle using mutex
Prafull Suryawanshi [Wed, 13 Jul 2016 09:14:11 +0000]
video: tegra: dc: protect unpin handle using mutex

bug 200208064

This change fixes the race condition where detach dma buffer
happens due to parallel paths in dc driver.
hpd worker and fb blank calls unpin window which unpin dma handles.
This is also done by flip_worker. There is possibility that same
buffer can be detached twice causing kernel panic. This change
protects cur_handle which is referred before doing unpin dma handles.

Change-Id: I8fa317d8d5fe62724c44c3630f71739ebb0c23ed
Signed-off-by: Prafull Suryawanshi <prafulls@nvidia.com>
Reviewed-on: http://git-master/r/1180645
(cherry picked from commit f48c266c999337b216abe3f49d709843b58d2fdb)
Reviewed-on: http://git-master/r/1199050
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>

3 years agousb: gadget: xudc: fix retrieve request logic
Hans Yang [Sat, 22 Oct 2016 05:58:36 +0000]
usb: gadget: xudc: fix retrieve request logic

This commit fixes a wrong memory access issue.
When the gadget function driver dequeues a request which
may has been completed by HW, then at handling its transfer
event, retrieving its corresponding request pointer could
be incorrect. SW should check if the request queue
is empty and the request is the correct one to avoid incorrect
memory access.

Below shows the call trace for an incorrect memory access case
Unable to handle kernel paging request at virtual
address ff0000c0be320e0a
PC is at ep_matches+0x38/0x2b4
LR is at usb_ep_autoconfig_ss+0x148/0x180
[<ffffffc00078b50c>] ep_matches+0x38/0x2b4
[<ffffffc00078b8d0>] usb_ep_autoconfig_ss+0x148/0x180
[<ffffffc00078b918>] usb_ep_autoconfig+0x10/0x18
[<ffffffc0007a9c84>] __ffs_func_bind_do_descs+0x100/0x170
[<ffffffc0007aa94c>] ffs_do_descs+0x4c/0x13c
[<ffffffc0007b29b8>] ffs_func_bind+0x224/0x338
[<ffffffc00078bdc4>] usb_add_function+0x98/0x180
[<ffffffc0007b3a68>] functionfs_bind_config+0xd0/0x100
[<ffffffc0007b3ab0>] ffs_function_bind_config+0x18/0x20
[<ffffffc0007a94e8>] android_bind_config+0x44/0x94
[<ffffffc00078c40c>] usb_add_config+0x7c/0x2ac
[<ffffffc0007b3cf4>] android_enable.isra.53+0x44/0x78
[<ffffffc0007ba154>] ffs_ep0_write+0x5c0/0x7bc
[<ffffffc0001a11ec>] vfs_write+0xc0/0x17c
[<ffffffc0001a1a28>] SyS_write+0x94/0x164

Bug 1824860

Change-Id: If742a8b4f8686cfa147c085913cf065b54dd022b
Signed-off-by: Hans Yang <hansy@nvidia.com>
Reviewed-on: http://git-master/r/1243044
Reviewed-by: Mark Kuo <mkuo@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinayak Pane <vpane@nvidia.com>

3 years agodevfreq: governor_pod: Raise threshold for vic03
Nicolin Chen [Thu, 13 Oct 2016 19:35:27 +0000]
devfreq: governor_pod: Raise threshold for vic03

The threshold used to govern the vic03 clock rate
is set at 250 (25% of the total capacity) which
seems to be too low as it's easier for devfreq to
drive the clock higher and then impact the power.

So this patch raises the threshold further to 30%
so as not to make the frequency fluctuate much.

Bug 200228585

Change-Id: Id13950bf170b21c8f6f9caf670efff25c4341f67
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-on: http://git-master/r/1236174
GVS: Gerrit_Virtual_Submit
Reviewed-by: Somdutta Roy <somduttar@nvidia.com>
Reviewed-by: Aleksandr Frid <afrid@nvidia.com>
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
Tested-by: Somdutta Roy <somduttar@nvidia.com>

3 years agoiio: common: nvs: Set st->trig null after free
Spencer Sutterlin [Fri, 28 Oct 2016 01:11:33 +0000]
iio: common: nvs: Set st->trig null after free

Bug 200244923

Change-Id: Icd3cb01825fed14604130b278af6fa64b70365c0
Signed-off-by: Spencer Sutterlin <ssutterlin@nvidia.com>
Reviewed-on: http://git-master/r/1244153
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Vinayak Pane <vpane@nvidia.com>
GVS: Gerrit_Virtual_Submit

3 years agomedia: i2c: ov5693: Fix potential power-leaks
Sudhir Vyas [Wed, 14 Sep 2016 05:58:45 +0000]
media: i2c: ov5693: Fix potential power-leaks

- Make sure to power off camera rails
in case of intermediate errors.
- Remove unnecessary return error checks for
power-off function calls.

Bug 200186908
Bug 200233021

Change-Id: I63ef1929535756b8378380fee5134b9c275d96bb
Signed-off-by: Sudhir Vyas <svyas@nvidia.com>
Reviewed-on: http://git-master/r/1220516
(cherry picked from commit 600f6a141c99893ac92d937d4cb0e37834faf2fc)
Reviewed-on: http://git-master/r/1242841
Reviewed-by: Aaron Huang <aaronh@nvidia.com>
Tested-by: Aaron Huang <aaronh@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Jihoon Bang <jbang@nvidia.com>

3 years agovideo: tegra: hdmi2.0: fix hpd state in recovery
Prafull Suryawanshi [Mon, 24 Oct 2016 07:03:01 +0000]
video: tegra: hdmi2.0: fix hpd state in recovery

bug 200242122
bug 200243233

In kernel recovery path, we accidently disable hdmi
monitor in hpd event. This causes no display on hdmi
monitor in recovery mode which is 480p.
In normal scenario, rest of hpd engine takes care
but recovery, hpd is disabled causing this issue.
The hpd state is now checked which is set by bl for
this specific scenario.

Change-Id: I8812753927a2c6845c6b1c58cde83e91abbbbec0
Signed-off-by: Prafull Suryawanshi <prafulls@nvidia.com>
Reviewed-on: http://git-master/r/1241478
Reviewed-by: Aly Hirani <ahirani@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Santosh Galma <galmar@nvidia.com>
Reviewed-by: Mitch Luban <mluban@nvidia.com>

3 years agohid: jarvis: Use kmalloc for pcm buffers
Ankita Garg [Wed, 12 Oct 2016 19:46:07 +0000]
hid: jarvis: Use kmalloc for pcm buffers

For buffering voice data before mic open,
we moved buffer allocations to the
audio_dec function. However, audio_dec
could be called from interrupt context if
the controller is connected over USB
instead of BT. So the allocations inside
audio_dec cannot use vmalloc.

This change causes the audio buffers to
be pre-allocated at device probe time
and will be allocated until the device
is connected.

Bug 1825439

Change-Id: I26dab7f232a5e146168482e13d7d19301bf8a4c9
Signed-off-by: Ankita Garg <ankitag@nvidia.com>
Reviewed-on: http://git-master/r/1235462
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>

3 years agoarch: arm64: config: enable cpuset for t210 android
Christopher Freeman [Tue, 4 Oct 2016 20:26:03 +0000]
arch: arm64: config: enable cpuset for t210 android

boot.img size is increased by 18432 bytes

Bug 1815239

Change-Id: I5bb8fd436f2fc9de19f2fd0ff8b9f08d06b17d6f
Signed-off-by: Christopher Freeman <cfreeman@nvidia.com>
Reviewed-on: http://git-master/r/1231557
(cherry picked from commit f05cb72943a893a73cbfd9edd667b2b12241dd87 in
rel-24-jetson-vr)
Reviewed-on: http://git-master/r/1240275
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>

3 years agokernel: cpuset: Make cpusets restore on hotplug
Riley Andrews [Fri, 12 Jun 2015 21:36:28 +0000]
kernel: cpuset: Make cpusets restore on hotplug

This deliberately changes the behavior of the per-cpuset
cpus file to not be effected by hotplug. When a cpu is offlined,
it will be removed from the cpuset/cpus file. When a cpu is onlined,
if the cpuset originally requested that that cpu was part of the cpuset, that
cpu will be restored to the cpuset. The cpus files still
have to be hierachical, but the ranges no longer have to be out of
the currently online cpus, just the physically present cpus.

Bug 1815239

Change-Id: I3efbae24a1f6384be1e603fb56f0d3baef61d924
Signed-off-by: Christopher Freeman <cfreeman@nvidia.com>
Reviewed-on: http://git-master/r/1231559
(cherry picked from commit 2b02e3175e322505383c4c2cb123de34294e77e5 in
rel-24-jetson-vr)
Reviewed-on: http://git-master/r/1235405
Reviewed-by: Maneet Maneet Singh <mmaneetsingh@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Raymond Poudrier <rapoudrier@nvidia.com>

3 years agoangler: Add allow_attach hook for cpusets on android.
Riley Andrews [Sat, 6 Jun 2015 01:59:29 +0000]
angler: Add allow_attach hook for cpusets on android.

Bug 1815239

Change-Id: Ic1b61b2bbb7ce74c9e9422b5e22ee9078251de21
[cfreeman@nvidia.com: change uid comparators]
Signed-off-by: Christopher Freeman <cfreeman@nvidia.com>
Reviewed-on: http://git-master/r/1231558
(cherry picked from commit c310b0a2468af82b44e7b320c43de2acfbd2f478 in
rel-24-jetson-vr)
Reviewed-on: http://git-master/r/1240274
Reviewed-by: Maneet Maneet Singh <mmaneetsingh@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Raymond Poudrier <rapoudrier@nvidia.com>

3 years agomm: remove gup_flags FOLL_WRITE games from __get_user_pages()
Gagan Grover [Fri, 21 Oct 2016 08:25:48 +0000]
mm: remove gup_flags FOLL_WRITE games from __get_user_pages()

commit 19be0eaffa3ac7d8eb6784ad9bdbc7d67ed8e619 upstream.

This is an ancient bug that was actually attempted to be fixed once
(badly) by me eleven years ago in commit 4ceb5db9757a ("Fix
get_user_pages() race for write access") but that was then undone due to
problems on s390 by commit f33ea7f404e5 ("fix get_user_pages bug").

In the meantime, the s390 situation has long been fixed, and we can now
fix it by checking the pte_dirty() bit properly (and do it better).  The
s390 dirty bit was implemented in abf09bed3cce ("s390/mm: implement
software dirty bits") which made it into v3.9.  Earlier kernels will
have to look at the page state itself.

Also, the VM has become more scalable, and what used a purely
theoretical race back then has become easier to trigger.

To fix it, we introduce a new internal FOLL_COW flag to mark the "yes,
we already did a COW" rather than play racy games with FOLL_WRITE that
is very fundamental, and then use the pte dirty flag to validate that
the FOLL_COW flag is still valid.

bug 1829674

Change-Id: I13a55845a79f92c0c90228a229947d2bdf616a4a
Reported-and-tested-by: Phil "not Paul" Oester <kernel@linuxace.com>
Acked-by: Hugh Dickins <hughd@google.com>
Reviewed-by: Michal Hocko <mhocko@suse.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Willy Tarreau <w@1wt.eu>
Cc: Nick Piggin <npiggin@gmail.com>
Cc: Greg Thelen <gthelen@google.com>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[wt: s/gup.c/memory.c; s/follow_page_pte/follow_page_mask;
     s/faultin_page/__get_user_page]
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Gagan Grover <ggrover@nvidia.com>
Reviewed-on: http://git-master/r/1240465
Reviewed-by: Dhiren Parmar <dparmar@nvidia.com>
Tested-by: Dhiren Parmar <dparmar@nvidia.com>

3 years agovideo: tegra: host: add lower bound to num_syncpt_incrs
Gagan Grover [Fri, 21 Oct 2016 06:15:00 +0000]
video: tegra: host: add lower bound to num_syncpt_incrs

Check if there is at least one syncpt_incrs in each job.

Bug 1812182

Change-Id: I0bd0b2e7c4d01641c83ba729ec34390ddea81496
Reviewed-on: http://git-master/r/1221226
Signed-off-by: Gagan Grover <ggrover@nvidia.com>
Reviewed-on: http://git-master/r/1240374
GVS: Gerrit_Virtual_Submit
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>

3 years agoARM64: t210 android reboot on hard/soft locks
David DSH [Wed, 19 Oct 2016 21:12:54 +0000]
ARM64: t210 android reboot on hard/soft locks

Reboot the device on hard lock up to get proper backtraces.

Bug 1827051

Change-Id: I7968e663004b19a6a9d14b7d68740d5c918e2cd2
Signed-off-by: David DSH <ddastoussthi@nvidia.com>
Reviewed-on: http://git-master/r/1239437
Reviewed-by: Vinayak Pane <vpane@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Manish Tuteja <mtuteja@nvidia.com>

3 years agoiio: imu: tsfw_icm: Fix report length + compass
Spencer Sutterlin [Wed, 19 Oct 2016 22:33:56 +0000]
iio: imu: tsfw_icm: Fix report length + compass

Fix reports #1a and 1b length and data offset

Add compass rotation matrix

Minor code clean up also

Bug 1827951
Bug 1828167

Change-Id: Id3df844487303b3de9475f45701f949093263de0
Signed-off-by: Spencer Sutterlin <ssutterlin@nvidia.com>
Reviewed-on: http://git-master/r/1239497
GVS: Gerrit_Virtual_Submit
Reviewed-by: Siddardha Naraharisetti <siddardhan@nvidia.com>
Reviewed-by: Vinayak Pane <vpane@nvidia.com>

3 years agommc: card: Disable Secure Erase/trim for SANDISK eMMC
Pavan Kunapuli [Fri, 21 Oct 2016 10:55:03 +0000]
mmc: card: Disable Secure Erase/trim for SANDISK eMMC

Disabling secure erase/trim feature on Sandisk eMMC with the
product names SDW16G, SDW32G, SDW64G

Bug 200205692

Change-Id: I8ea990203423a65096ed40a478eba93c5fd84643
Signed-off-by: Pavan Kunapuli <pkunapuli@nvidia.com>
Reviewed-on: http://git-master/r/1240605
Reviewed-by: Venu Byravarasu <vbyravarasu@nvidia.com>
GVS: Gerrit_Virtual_Submit

3 years agoRevert "arm64: dts: Add new dts file for Darcy with new memory"
Martin Gao [Thu, 13 Oct 2016 21:16:20 +0000]
Revert "arm64: dts: Add new dts file for Darcy with new memory"

Bug 1772578

This reverts commit 790caf00c2ef2e025ed8651c0aec5c8e4539a545.

Change-Id: Icb4352ee10cf2a1c57e1a8067b68e73076509517
Signed-off-by: Martin Gao <marting@nvidia.com>
Reviewed-on: http://git-master/r/1228093
(cherry picked from commit 82f268dc302921d4d6fe8d7e021ae98bb6437e92)
Reviewed-on: http://git-master/r/1236917
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinayak Pane <vpane@nvidia.com>

3 years agoUPSTREAM: netfilter: x_tables: validate e->target_offset early
Florian Westphal [Tue, 22 Mar 2016 17:02:49 +0000]
UPSTREAM: netfilter: x_tables: validate e->target_offset early

(cherry pick from commit bdf533de6968e9686df777dc178486f600c6e617)

We should check that e->target_offset is sane before
mark_source_chains gets called since it will fetch the target entry
for loop detection.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Change-Id: Ic2dbc31c9525d698e94d4d8875886acf3524abbd
Bug: 29637687
Bug 1797728
(cherry picked from commit 7ed1e120e1cc31bea816709c25ebb80203ce9f1b)
Signed-off-by: Mithun Maragiri <mmaragiri@nvidia.com>
Reviewed-on: http://git-master/r/1214540
GVS: Gerrit_Virtual_Submit

(cherry picked from commit 7f418177a6ac021fc6a10560b17733577b898b6f)
Signed-off-by: Gagan Grover <ggrover@nvidia.com>
Change-Id: I4381d3ca09eb1e22f720071be6bfa2701e14b885
Reviewed-on: http://git-master/r/1226957
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>

3 years agogpu: nvgpu: fix use-after-free in case of error notifier
Gagan Grover [Wed, 12 Oct 2016 11:35:06 +0000]
gpu: nvgpu: fix use-after-free in case of error notifier

A use-after-free scenario is possible where one thread in
gk20a_free_error_notifiers() is trying to free the error
notifier and another thread in gk20a_set_error_notifier()
is still using the error notifier

Fix this by introducing mutex error_notifier_mutex for
error notifier accesses

Take mutex in gk20a_free_error_notifiers() and in
gk20a_set_error_notifier() before accessing notifier

In gk20a_init_error_notifier(), set the pointer
ch->error_notifier_ref inside the mutex and only
after notifier is completely initialized

Bug 1824788

Change-Id: I47e1ab57d54f391799f5a0999840b663fd34585f
Reviewed-on: http://git-master/r/1233988
Signed-off-by: Gagan Grover <ggrover@nvidia.com>
Reviewed-on: http://git-master/r/1235222
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

3 years agoppp: take reference on channels netns
Guillaume Nault [Wed, 23 Mar 2016 15:38:55 +0000]
ppp: take reference on channels netns

Let channels hold a reference on their network namespace.
Some channel types, like ppp_async and ppp_synctty, can have their
userspace controller running in a different namespace. Therefore they
can't rely on them to preclude their netns from being removed from
under them.

==================================================================
BUG: KASAN: use-after-free in ppp_unregister_channel+0x372/0x3a0 at
addr ffff880064e217e0
Read of size 8 by task syz-executor/11581
=============================================================================
BUG net_namespace (Not tainted): kasan: bad access detected
-----------------------------------------------------------------------------

Disabling lock debugging due to kernel taint
INFO: Allocated in copy_net_ns+0x6b/0x1a0 age=92569 cpu=3 pid=6906
[<      none      >] ___slab_alloc+0x4c7/0x500 kernel/mm/slub.c:2440
[<      none      >] __slab_alloc+0x4c/0x90 kernel/mm/slub.c:2469
[<     inline     >] slab_alloc_node kernel/mm/slub.c:2532
[<     inline     >] slab_alloc kernel/mm/slub.c:2574
[<      none      >] kmem_cache_alloc+0x23a/0x2b0 kernel/mm/slub.c:2579
[<     inline     >] kmem_cache_zalloc kernel/include/linux/slab.h:597
[<     inline     >] net_alloc kernel/net/core/net_namespace.c:325
[<      none      >] copy_net_ns+0x6b/0x1a0 kernel/net/core/net_namespace.c:360
[<      none      >] create_new_namespaces+0x2f6/0x610 kernel/kernel/nsproxy.c:95
[<      none      >] copy_namespaces+0x297/0x320 kernel/kernel/nsproxy.c:150
[<      none      >] copy_process.part.35+0x1bf4/0x5760 kernel/kernel/fork.c:1451
[<     inline     >] copy_process kernel/kernel/fork.c:1274
[<      none      >] _do_fork+0x1bc/0xcb0 kernel/kernel/fork.c:1723
[<     inline     >] SYSC_clone kernel/kernel/fork.c:1832
[<      none      >] SyS_clone+0x37/0x50 kernel/kernel/fork.c:1826
[<      none      >] entry_SYSCALL_64_fastpath+0x16/0x7a kernel/arch/x86/entry/entry_64.S:185

INFO: Freed in net_drop_ns+0x67/0x80 age=575 cpu=2 pid=2631
[<      none      >] __slab_free+0x1fc/0x320 kernel/mm/slub.c:2650
[<     inline     >] slab_free kernel/mm/slub.c:2805
[<      none      >] kmem_cache_free+0x2a0/0x330 kernel/mm/slub.c:2814
[<     inline     >] net_free kernel/net/core/net_namespace.c:341
[<      none      >] net_drop_ns+0x67/0x80 kernel/net/core/net_namespace.c:348
[<      none      >] cleanup_net+0x4e5/0x600 kernel/net/core/net_namespace.c:448
[<      none      >] process_one_work+0x794/0x1440 kernel/kernel/workqueue.c:2036
[<      none      >] worker_thread+0xdb/0xfc0 kernel/kernel/workqueue.c:2170
[<      none      >] kthread+0x23f/0x2d0 kernel/drivers/block/aoe/aoecmd.c:1303
[<      none      >] ret_from_fork+0x3f/0x70 kernel/arch/x86/entry/entry_64.S:468
INFO: Slab 0xffffea0001938800 objects=3 used=0 fp=0xffff880064e20000
flags=0x5fffc0000004080
INFO: Object 0xffff880064e20000 @offset=0 fp=0xffff880064e24200

CPU: 1 PID: 11581 Comm: syz-executor Tainted: G    B           4.4.0+
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.8.2-0-g33fbe13 by qemu-project.org 04/01/2014
 00000000ffffffff ffff8800662c7790 ffffffff8292049d ffff88003e36a300
 ffff880064e20000 ffff880064e20000 ffff8800662c77c0 ffffffff816f2054
 ffff88003e36a300 ffffea0001938800 ffff880064e20000 0000000000000000
Call Trace:
 [<     inline     >] __dump_stack kernel/lib/dump_stack.c:15
 [<ffffffff8292049d>] dump_stack+0x6f/0xa2 kernel/lib/dump_stack.c:50
 [<ffffffff816f2054>] print_trailer+0xf4/0x150 kernel/mm/slub.c:654
 [<ffffffff816f875f>] object_err+0x2f/0x40 kernel/mm/slub.c:661
 [<     inline     >] print_address_description kernel/mm/kasan/report.c:138
 [<ffffffff816fb0c5>] kasan_report_error+0x215/0x530 kernel/mm/kasan/report.c:236
 [<     inline     >] kasan_report kernel/mm/kasan/report.c:259
 [<ffffffff816fb4de>] __asan_report_load8_noabort+0x3e/0x40 kernel/mm/kasan/report.c:280
 [<     inline     >] ? ppp_pernet kernel/include/linux/compiler.h:218
 [<ffffffff83ad71b2>] ? ppp_unregister_channel+0x372/0x3a0 kernel/drivers/net/ppp/ppp_generic.c:2392
 [<     inline     >] ppp_pernet kernel/include/linux/compiler.h:218
 [<ffffffff83ad71b2>] ppp_unregister_channel+0x372/0x3a0 kernel/drivers/net/ppp/ppp_generic.c:2392
 [<     inline     >] ? ppp_pernet kernel/drivers/net/ppp/ppp_generic.c:293
 [<ffffffff83ad6f26>] ? ppp_unregister_channel+0xe6/0x3a0 kernel/drivers/net/ppp/ppp_generic.c:2392
 [<ffffffff83ae18f3>] ppp_asynctty_close+0xa3/0x130 kernel/drivers/net/ppp/ppp_async.c:241
 [<ffffffff83ae1850>] ? async_lcp_peek+0x5b0/0x5b0 kernel/drivers/net/ppp/ppp_async.c:1000
 [<ffffffff82c33239>] tty_ldisc_close.isra.1+0x99/0xe0 kernel/drivers/tty/tty_ldisc.c:478
 [<ffffffff82c332c0>] tty_ldisc_kill+0x40/0x170 kernel/drivers/tty/tty_ldisc.c:744
 [<ffffffff82c34943>] tty_ldisc_release+0x1b3/0x260 kernel/drivers/tty/tty_ldisc.c:772
 [<ffffffff82c1ef21>] tty_release+0xac1/0x13e0 kernel/drivers/tty/tty_io.c:1901
 [<ffffffff82c1e460>] ? release_tty+0x320/0x320 kernel/drivers/tty/tty_io.c:1688
 [<ffffffff8174de36>] __fput+0x236/0x780 kernel/fs/file_table.c:208
 [<ffffffff8174e405>] ____fput+0x15/0x20 kernel/fs/file_table.c:244
 [<ffffffff813595ab>] task_work_run+0x16b/0x200 kernel/kernel/task_work.c:115
 [<     inline     >] exit_task_work kernel/include/linux/task_work.h:21
 [<ffffffff81307105>] do_exit+0x8b5/0x2c60 kernel/kernel/exit.c:750
 [<ffffffff813fdd20>] ? debug_check_no_locks_freed+0x290/0x290 kernel/kernel/locking/lockdep.c:4123
 [<ffffffff81306850>] ? mm_update_next_owner+0x6f0/0x6f0 kernel/kernel/exit.c:357
 [<ffffffff813215e6>] ? __dequeue_signal+0x136/0x470 kernel/kernel/signal.c:550
 [<ffffffff8132067b>] ? recalc_sigpending_tsk+0x13b/0x180 kernel/kernel/signal.c:145
 [<ffffffff81309628>] do_group_exit+0x108/0x330 kernel/kernel/exit.c:880
 [<ffffffff8132b9d4>] get_signal+0x5e4/0x14f0 kernel/kernel/signal.c:2307
 [<     inline     >] ? kretprobe_table_lock kernel/kernel/kprobes.c:1113
 [<ffffffff8151d355>] ? kprobe_flush_task+0xb5/0x450 kernel/kernel/kprobes.c:1158
 [<ffffffff8115f7d3>] do_signal+0x83/0x1c90 kernel/arch/x86/kernel/signal.c:712
 [<ffffffff8151d2a0>] ? recycle_rp_inst+0x310/0x310 kernel/include/linux/list.h:655
 [<ffffffff8115f750>] ? setup_sigcontext+0x780/0x780 kernel/arch/x86/kernel/signal.c:165
 [<ffffffff81380864>] ? finish_task_switch+0x424/0x5f0 kernel/kernel/sched/core.c:2692
 [<     inline     >] ? finish_lock_switch kernel/kernel/sched/sched.h:1099
 [<ffffffff81380560>] ? finish_task_switch+0x120/0x5f0 kernel/kernel/sched/core.c:2678
 [<     inline     >] ? context_switch kernel/kernel/sched/core.c:2807
 [<ffffffff85d794e9>] ? __schedule+0x919/0x1bd0 kernel/kernel/sched/core.c:3283
 [<ffffffff81003901>] exit_to_usermode_loop+0xf1/0x1a0 kernel/arch/x86/entry/common.c:247
 [<     inline     >] prepare_exit_to_usermode kernel/arch/x86/entry/common.c:282
 [<ffffffff810062ef>] syscall_return_slowpath+0x19f/0x210 kernel/arch/x86/entry/common.c:344
 [<ffffffff85d88022>] int_ret_from_sys_call+0x25/0x9f kernel/arch/x86/entry/entry_64.S:281
Memory state around the buggy address:
 ffff880064e21680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff880064e21700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff880064e21780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                       ^
 ffff880064e21800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff880064e21880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Fixes: 273ec51dd7ce ("net: ppp_generic - introduce net-namespace functionality v2")
Reported-by: Baozeng Ding <sploving1@gmail.com>
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Bug 1797728

Change-Id: I5e04b3c178b408af0412f635714b4bb3d2ff6a44
Signed-off-by: Mithun Maragiri <mmaragiri@nvidia.com>
Reviewed-on: http://git-master/r/1214545
GVS: Gerrit_Virtual_Submit
(cherry picked from commit 493649df1bec9216bfd9ecb0430e5bfbaac61b2b)
Signed-off-by: Gagan Grover <ggrover@nvidia.com>
Reviewed-on: http://git-master/r/1226951
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

3 years agoUPSTREAM: cdc_ncm: do not call usbnet_link_change from cdc_ncm_bind
Bjørn Mork [Fri, 8 Jul 2016 18:14:51 +0000]
UPSTREAM: cdc_ncm: do not call usbnet_link_change from cdc_ncm_bind

(cherry pick from commit 4d06dd537f95683aba3651098ae288b7cbff8274)

usbnet_link_change will call schedule_work and should be
avoided if bind is failing. Otherwise we will end up with
scheduled work referring to a netdev which has gone away.

Instead of making the call conditional, we can just defer
it to usbnet_probe, using the driver_info flag made for
this purpose.

Fixes: 8a34b0ae8778 ("usbnet: cdc_ncm: apply usbnet_link_change")
Reported-by: Andrey Konovalov <andreyknvl@gmail.com>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
Change-Id: Id9a6d02bdd98bf495d26595cf2cc90e480746186
Bug: 28744625
Bug 1797728
(cherry picked from commit e0328ff123d1085b05f4e8b0ccde9c9e5203b61c)
Signed-off-by: Mithun Maragiri <mmaragiri@nvidia.com>
Reviewed-on: http://git-master/r/1213267
GVS: Gerrit_Virtual_Submit

(cherry picked from commit e69933605e81838544cceecfa44b1c86010b5287)
Signed-off-by: Gagan Grover <ggrover@nvidia.com>
Change-Id: I67daf32a73a434f3703c00646c6e2f79dc8d63c0
Reviewed-on: http://git-master/r/1221320
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

3 years agoiio: imu: tsfw_icm20628: Axis transform + frag fix
Spencer Sutterlin [Tue, 18 Oct 2016 03:31:53 +0000]
iio: imu: tsfw_icm20628: Axis transform + frag fix

Transform the axes orientations with nvs matrix

Pass non-sync fragmented data to NVS

And several cleanup fixes

Bug 1828167
Bug 1828048

Change-Id: I22a4172863d72cb21105b59a5b22e49ab89d175f
Signed-off-by: Spencer Sutterlin <ssutterlin@nvidia.com>
Reviewed-on: http://git-master/r/1238205
Reviewed-by: Mandar Padmawar <mpadmawar@nvidia.com>
Reviewed-by: Vinayak Pane <vpane@nvidia.com>

3 years agousb: gadget: ucd: reduce Data Contact Detect timeout value
Rakesh Babu Bodla [Fri, 14 Oct 2016 12:18:28 +0000]
usb: gadget: ucd: reduce Data Contact Detect timeout value

Reduce DCD timeout to 400ms to meet charging compliance
requirements.

Bug 200190604

Change-Id: If62c4ca1c6dc0fc0f8aba65fe7cea3d1a80f4118
Signed-off-by: Rakesh Babu Bodla <rbodla@nvidia.com>
Reviewed-on: http://git-master/r/1236698
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>

3 years agoarm64: dts: HE: get vbus notification from bq chip
Rakesh Babu Bodla [Fri, 14 Oct 2016 12:14:46 +0000]
arm64: dts: HE: get vbus notification from bq chip

Get the vbus notifications directly from bq charger
chip driver to reduce the time between the vbus detection
and usb charger detection code.

Bug 200190604

Change-Id: Icc9ae854342159d43726b96a864a3a2c5d6981a6
Signed-off-by: Rakesh Babu Bodla <rbodla@nvidia.com>
Reviewed-on: http://git-master/r/1236697
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

3 years agousb: gadget: tegra: fix DCD field and PD_CHG
Rakesh Babu Bodla [Thu, 13 Oct 2016 11:49:52 +0000]
usb: gadget: tegra: fix DCD field and PD_CHG

Fixes below issues.
1. Correct DCD debounce time configuration field.
2. Correct checks in tegra21x_usb_vbus_pad_protection.
3. Set PD_CHG during powering off pad.

Bug 200243453

Change-Id: Ic7a1ad523f96452d5cd47a6bf7f70bd449e16205
Signed-off-by: Rakesh Babu Bodla <rbodla@nvidia.com>
Reviewed-on: http://git-master/r/1235987
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>

3 years agonetfilter: x_tables: fix unconditional helper
Florian Westphal [Tue, 22 Mar 2016 17:02:52 +0000]
netfilter: x_tables: fix unconditional helper

Ben Hawkes says:

 In the mark_source_chains function (net/ipv4/netfilter/ip_tables.c) it
 is possible for a user-supplied ipt_entry structure to have a large
 next_offset field. This field is not bounds checked prior to writing a
 counter value at the supplied offset.

Problem is that mark_source_chains should not have been called --
the rule doesn't have a next entry, so its supposed to return
an absolute verdict of either ACCEPT or DROP.

However, the function conditional() doesn't work as the name implies.
It only checks that the rule is using wildcard address matching.

However, an unconditional rule must also not be using any matches
(no -m args).

The underflow validator only checked the addresses, therefore
passing the 'unconditional absolute verdict' test, while
mark_source_chains also tested for presence of matches, and thus
proceeeded to the next (not-existent) rule.

Unify this so that all the callers have same idea of 'unconditional rule'.

Reported-by: Ben Hawkes <hawkes@google.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

Bug 1797728

Change-Id: I7884811fd948fed4e18f1a0d38792bce4b397ed9
Signed-off-by: Mithun Maragiri <mmaragiri@nvidia.com>
Reviewed-on: http://git-master/r/1214549
GVS: Gerrit_Virtual_Submit
(cherry picked from commit 9540a626609d490cd0fff4ae97ea713f5806ddd7)
Signed-off-by: Gagan Grover <ggrover@nvidia.com>
Reviewed-on: http://git-master/r/1226931
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

3 years agoarm64: boot: dts: Add top dts for Darcy a07
Daniel Fu [Mon, 29 Aug 2016 10:43:28 +0000]
arm64: boot: dts: Add top dts for Darcy a07

- Add A07 Top dts
- Enable AOTAG
- Disable external thermal sensor
- Disable Tboard/Tdiode
- Add Thermal Trips/Maps to AOATG thermal-zones for CPU/GPU/CORE/EDP

Bug 1646378
Bug 200232561

Change-Id: I8a2148e9ea541084705f516f073891b03a0e98c6
Signed-off-by: Daniel Fu <danifu@nvidia.com>
Reviewed-on: http://git-master/r/1209126
(cherry picked from commit 5bbd3faf7033031f4f6101d5d7a9132714d1cb20)
Reviewed-on: http://git-master/r/1212924
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinayak Pane <vpane@nvidia.com>

3 years agosmp: print more useful debug info upon receiving IPI on an offline CPU
Sai Gurrappadi [Fri, 23 Oct 2015 00:57:43 +0000]
smp: print more useful debug info upon receiving IPI on an offline CPU

Manual backport of upstream commit: a219ccf4637396a2392bfbec7c12acbfe2b06b46

Bug 200107576

Change-Id: I6589871e66c4ed5a435972205728fa59eb723b8a
Signed-off-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-on: http://git-master/r/821759
Reviewed-by: Vinayak Pane <vpane@nvidia.com>
Tested-by: Vinayak Pane <vpane@nvidia.com>

3 years agoiio: Fix multi-link device removal
Erik Lilliebjerg [Fri, 14 Oct 2016 22:12:10 +0000]
iio: Fix multi-link device removal

- Create a dynamic device_type structure for drivers that use multiple links
  per device.

Bug 1824808

Change-Id: I7f803b326368f7e212c2b61cd2f76d8f2dea274a
Signed-off-by: Erik Lilliebjerg <elilliebjerg@nvidia.com>
Reviewed-on: http://git-master/r/1237017
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinayak Pane <vpane@nvidia.com>

3 years agousb: gadget: tegra: add apple charger detection
Rakesh Babu Bodla [Mon, 29 Dec 2014 11:58:10 +0000]
usb: gadget: tegra: add apple charger detection

Add detection of different apple charger 5W,10W,12W
using XUSB pad for XUSB device mode.

Bug 200054906

Change-Id: I4b1b77940e2133c3faf14ec91fa76b87c89693c1
Signed-off-by: Rakesh Babu Bodla <rbodla@nvidia.com>
Reviewed-on: http://git-master/r/1231871
Reviewed-by: Mark Kuo <mkuo@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

3 years agoarm64: t210: Enable TSFW_ICM
Spencer Sutterlin [Fri, 14 Oct 2016 02:12:57 +0000]
arm64: t210: Enable TSFW_ICM

Bug 1807528

Change-Id: I1ded0bb719459f1ae5bf8ffe582d8a20df385deb
Signed-off-by: Spencer Sutterlin <ssutterlin@nvidia.com>
Reviewed-on: http://git-master/r/1228098
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinayak Pane <vpane@nvidia.com>

3 years agoThunderstrike 9-axis sensor
Spencer Sutterlin [Thu, 25 Aug 2016 02:06:40 +0000]
Thunderstrike 9-axis sensor

hid: jarvis: TS sensor parsing

iio: imu: tsfw_icm20628: Initial stub driver

Fragmentation - working on syn packets

Dynamic stuff
- Add DYNAMIC_SENSOR_MASK flag
- Add nvs_dsm DT node

Bug 1807528

Change-Id: I54d9d8615790bd90f343da57272cb332ab8bf165
Signed-off-by: Spencer Sutterlin <ssutterlin@nvidia.com>
Reviewed-on: http://git-master/r/1228099
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinayak Pane <vpane@nvidia.com>

3 years agodts: include multiple emc table for darcy p2894
Martin Gao [Wed, 3 Aug 2016 05:20:21 +0000]
dts: include multiple emc table for darcy p2894

- darcy POR has two different memory hardware modules. To achieve single
sofeware SKU, emc tables for both types need to be included here.
- add print in emc dt parser to indicate which emc table is selected.

Bug 1772578

Change-Id: I6dd74812bf7a80580ef248e68c6e0b869b9f4d1b
Signed-off-by: Martin Gao <marting@nvidia.com>
Reviewed-on: http://git-master/r/1234874
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinayak Pane <vpane@nvidia.com>

3 years agobcmdhd_88: improve data integrity of nv_logger
Bibhay Ranjan [Mon, 26 Sep 2016 13:45:15 +0000]
bcmdhd_88: improve data integrity of nv_logger

Bug 200238576

Change-Id: I8a8ae9d66f4918fadb7107cd41de3c1670a4a4b3
Signed-off-by: Bibhay Ranjan <bibhayr@nvidia.com>
Reviewed-on: http://git-master/r/1227051
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>

3 years agobcmdhd_88: add DHD_ERROR for nv_logger
Bibhay Ranjan [Tue, 6 Sep 2016 09:09:26 +0000]
bcmdhd_88: add DHD_ERROR for nv_logger

All the logs generated via DHD_ERROR and will
now be written into nv_logger

Bug 200239493

Change-Id: Ibbbaadb397f83be2f04e8e7119da3ede44627547
Signed-off-by: Bibhay Ranjan <bibhayr@nvidia.com>
Reviewed-on: http://git-master/r/1215476
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>

3 years agotegra: dc: add support for sink capabilties ioctl
Arun Swain [Thu, 6 Oct 2016 19:57:24 +0000]
tegra: dc: add support for sink capabilties ioctl

Provides an interface to pass on sink capabilties
to user space. Even though the struct in scalable
to various types of capabilties, currently it
has support for hdr capability only. These
capabilty info comes via edid only as of today.
The plan is to provide capabilty info for dsi
panels via device tree.

Bug 1810547

Change-Id: I302efe3f6d79f6f0730668d06e6cdccd5a4cb2f1
Signed-off-by: Arun Swain <arswain@nvidia.com>
Reviewed-on: http://git-master/r/1232704
Reviewed-by: Ujwal Patel <ujwalp@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ivan Raul Guadarrama <iguadarrama@nvidia.com>
Tested-by: Ivan Raul Guadarrama <iguadarrama@nvidia.com>
Reviewed-by: Mitch Luban <mluban@nvidia.com>

3 years agotegra: dc: ext: Add support for disp capabilities
Arun Swain [Wed, 5 Oct 2016 02:58:01 +0000]
tegra: dc: ext: Add support for disp capabilities

Add support for getting display capabilities from
kernel. The struct adds new data structures to be
used for the same. This approach attends to the
following needs:
- Can be used to pass-on an array of multiple
capabilities of different types with the same ioctl.
- Each of these capabilities will have it's own
struct type and should be clearly mentioned by the
"data_type" field.

Bug 1810547

Change-Id: I315fd9e06f6cc071197376eeac1c14638e8ae523
Signed-off-by: Arun Swain <arswain@nvidia.com>
Reviewed-on: http://git-master/r/1231678
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Ujwal Patel <ujwalp@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ivan Raul Guadarrama <iguadarrama@nvidia.com>
Tested-by: Ivan Raul Guadarrama <iguadarrama@nvidia.com>
Reviewed-by: Mitch Luban <mluban@nvidia.com>

3 years agoARM64: tegra21: increase max vpr to 750MB for foster
Sri Krishna chowdary [Mon, 26 Sep 2016 09:58:31 +0000]
ARM64: tegra21: increase max vpr to 750MB for foster

The worst case requirement for vpr is 750 MB as we
support upto 4K resolution.

bug 1787861

Change-Id: I902bd47c953cbfdb758c23f8a17aefc769f7b1f0
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/1226940
(cherry picked from commit c712f49ab478a21903cd6c48c27eadd38ea710e7)
Reviewed-on: http://git-master/r/1229220
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

3 years agoplatform: tegra: Ensure driver init prior to use
Sai Gurrappadi [Wed, 9 Dec 2015 17:49:19 +0000]
platform: tegra: Ensure driver init prior to use

The cpufreq platform driver has to finish initialization before it can
call into cpufreq core. To that end, use a flag to indicate when the
driver has finished initializing. This new flag is then used to bail
out of any calls that happen prior to driver init.

Bug 200159525

Change-Id: I32e26830f09a720a58b5c43de969b639dd33f020
Signed-off-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-on: http://git-master/r/921882
(cherry picked from commit 890e7fb164fcfa4c22eee7fc7216b2aa67008fa9)
(cherry picked from commit c0f94f735da51bdd94429e8f8e3b4da225a26e03)
Reviewed-on: http://git-master/r/843650
Tested-by: Vaibhav Shinde <vashinde@nvidia.com>
Reviewed-by: Gagan Grover <ggrover@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Dhiren Parmar <dparmar@nvidia.com>

3 years agoRevert "HACK Revert "ARM: 7405/1: kexec: call platform_cpu_kill on the killer rather...
Nicolin Chen [Thu, 29 Sep 2016 01:37:10 +0000]
Revert "HACK Revert "ARM: 7405/1: kexec: call platform_cpu_kill on the killer rather than the victim""

This reverts commit f207c657eabbc231bddfe3fa72a98de16eb2d2b0.

The HACK Revert moved the platform_cpu_kill() back to the "victim"
from the "killer". However, the platform_cpu_kill() is a function
calling tegra_cpu_kill() which is supposed to run on the "killer"
to poll the status of the "victim" via AFFINITY_INFO command.

Meanwhile, the tegra_cpu_kill calls msleep(), so putting it into
an IRQ context results in "BUG: scheduling while atomic".

So we revert this HACK since it doesn't break reboot any more.

Bug 200224278
Bug 1808023

Change-Id: Iaa63f1a848378df47d3f76821d641ed187983183
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-on: http://git-master/r/1228810
GVS: Gerrit_Virtual_Submit
Tested-by: Vaibhav Shinde <vashinde@nvidia.com>
Reviewed-by: Vaibhav Shinde <vashinde@nvidia.com>
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-by: Dhiren Parmar <dparmar@nvidia.com>

3 years agoBuffer audio packets before pcm_open
Ankita Garg [Thu, 8 Sep 2016 20:56:28 +0000]
Buffer audio packets before pcm_open

Start buffering audio packets from TS even before
MIC ON request is sent from the host to TS. This
change reduces the response time for voice search
in the oder of 100ms

Bug 1811059

Change-Id: Ic336726363337a37ce0103335f14fb7ca54cc7a0
Signed-off-by: Ankita Garg <ankitag@nvidia.com>
Reviewed-on: http://git-master/r/1217350
(cherry picked from commit 68d717756250c4962f4249c84bb4f766b86cc930)
Reviewed-on: http://git-master/r/1228532
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinayak Pane <vpane@nvidia.com>

3 years agoRevert "net: show cmdline in /proc/net/{tcp udp tcp6 udp6}"
Harry Lin [Mon, 26 Sep 2016 03:41:04 +0000]
Revert "net: show cmdline in /proc/net/{tcp udp tcp6 udp6}"

This reverts commit db969bbf31dbb79c0f06497f083b4bad16ad88c7.

Bug 1185001
Bug 200236925

Change-Id: I1ec6614c87e17d734b5ce850aa90754376c42f12
Signed-off-by: Harry Lin <harlin@nvidia.com>
Reviewed-on: http://git-master/r/1226759
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Om Prakash Singh <omp@nvidia.com>
Reviewed-by: Mitch Luban <mluban@nvidia.com>

3 years agoRevert "arm64:mm: rm swtch to ASID0 in ctxt swtch"
Rohit Khanna [Wed, 7 Sep 2016 20:00:23 +0000]
Revert "arm64:mm: rm swtch to ASID0 in ctxt swtch"

This reverts commit 584b60200b8bdcc895c8edacb94f48db5929f70a.

Bug 1814735

Change-Id: Ibe5b217521b77fa5799400b9460182e3329e1779
Signed-off-by: Rohit Khanna <rokhanna@nvidia.com>
Reviewed-on: http://git-master/r/1216501
(cherry picked from commit 04c8d66d61e15198b95d54672b2f2fe047d180b3)
Reviewed-on: http://git-master/r/1222202
Tested-by: Mithun Maragiri <mmaragiri@nvidia.com>
Reviewed-by: Vinayak Pane <vpane@nvidia.com>
GVS: Gerrit_Virtual_Submit

3 years agoirqchip: gic: use CPU_PM only when registering
Ajay Nandakumar [Mon, 22 Aug 2016 06:00:27 +0000]
irqchip: gic: use CPU_PM only when registering

Use CPU_PM only when registering the cpu_notifier rather than using
the config across the functions since these are required by AGIC.

Bug 1747157

Change-Id: Ic924ce41b73a866215d5d668c9f025893df1d7fb
(cherry picked from commit d311f245859432d334e52f9ae9c56d0f639bfa72)
Reviewed-on: http://git-master/r/1206650
(cherry picked from commit 3f9a85d2d518893f340cf9dcc02e66c374491011)
Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>
Reviewed-on: http://git-master/r/1231758
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>

3 years agoARM: configs: tegra12: set ARCH_MMAP_RND_BITS to 16
Sri Krishna chowdary [Fri, 2 Sep 2016 09:53:14 +0000]
ARM: configs: tegra12: set ARCH_MMAP_RND_BITS to 16

bug 200226998

Change-Id: I3ada385947e6bd85c72297d0f773e96e133b00d0
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/1213664
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

3 years agomm: ASLR: use get_random_long()
Sri Krishna chowdary [Thu, 25 Aug 2016 09:28:05 +0000]
mm: ASLR: use get_random_long()

Replace calls to get_random_int() followed by a cast to (unsigned long)
with calls to get_random_long().  Also address shifting bug which, in
case of x86 removed entropy mask for mmap_rnd_bits values > 31 bits.

bug 200226998

Signed-off-by: Daniel Cashman <dcashman@android.com>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: David S. Miller <davem@davemloft.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Nick Kralevich <nnk@google.com>
Cc: Jeff Vander Stoep <jeffv@google.com>
Cc: Mark Salyzyn <salyzyn@android.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from 5ef11c35ce86b94bfb878b684de4cdaf96f54b2f)
Change-Id: I6fecfc781a2de256d50f9f1e06cadaf97666b294
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/1207748
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

3 years agodrivers: char: random: add get_random_long()
Daniel Cashman [Fri, 26 Feb 2016 23:19:34 +0000]
drivers: char: random: add get_random_long()

Commit d07e22597d1d ("mm: mmap: add new /proc tunable for mmap_base
ASLR") added the ability to choose from a range of values to use for
entropy count in generating the random offset to the mmap_base address.

The maximum value on this range was set to 32 bits for 64-bit x86
systems, but this value could be increased further, requiring more than
the 32 bits of randomness provided by get_random_int(), as is already
possible for arm64.  Add a new function: get_random_long() which more
naturally fits with the mmap usage of get_random_int() but operates
exactly the same as get_random_int().

Also, fix the shifting constant in mmap_rnd() to be an unsigned long so
that values greater than 31 bits generate an appropriate mask without
overflow.  This is especially important on x86, as its shift instruction
uses a 5-bit mask for the shift operand, which meant that any value for
mmap_rnd_bits over 31 acts as a no-op and effectively disables mmap_base
randomization.

Finally, replace calls to get_random_int() with get_random_long() where
appropriate.

This patch (of 2):

Add get_random_long().

bug 200226998

Signed-off-by: Daniel Cashman <dcashman@android.com>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: David S. Miller <davem@davemloft.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Nick Kralevich <nnk@google.com>
Cc: Jeff Vander Stoep <jeffv@google.com>
Cc: Mark Salyzyn <salyzyn@android.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit ec9ee4acd97c0039a61c0ae4f12705767ae62153)
Change-Id: Id432068ef328af7770f3f44ff72a6907b1cac8ac
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/1207747
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

3 years agomm: expose arch_mmap_rnd when available
Kees Cook [Tue, 14 Apr 2015 22:48:00 +0000]
mm: expose arch_mmap_rnd when available

When an architecture fully supports randomizing the ELF load location,
a per-arch mmap_rnd() function is used to find a randomized mmap base.
In preparation for randomizing the location of ET_DYN binaries
separately from mmap, this renames and exports these functions as
arch_mmap_rnd(). Additionally introduces CONFIG_ARCH_HAS_ELF_RANDOMIZE
for describing this feature on architectures that support it
(which is a superset of ARCH_BINFMT_ELF_RANDOMIZE_PIE, since s390
already supports a separated ET_DYN ASLR from mmap ASLR without the
ARCH_BINFMT_ELF_RANDOMIZE_PIE logic).

bug 200226998

Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: Hector Marco-Gisbert <hecmargi@upv.es>
Cc: Russell King <linux@arm.linux.org.uk>
Reviewed-by: Ingo Molnar <mingo@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: "David A. Long" <dave.long@linaro.org>
Cc: Andrey Ryabinin <a.ryabinin@samsung.com>
Cc: Arun Chandran <achandran@mvista.com>
Cc: Yann Droneaud <ydroneaud@opteya.com>
Cc: Min-Hua Chen <orca.chen@gmail.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: Alex Smith <alex@alex-smith.me.uk>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Cc: Vineeth Vijayan <vvijayan@mvista.com>
Cc: Jeff Bailey <jeffbailey@google.com>
Cc: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Cc: Ben Hutchings <ben@decadent.org.uk>
Cc: Behan Webster <behanw@converseincode.com>
Cc: Ismael Ripoll <iripoll@upv.es>
Cc: Jan-Simon Mller <dl9pf@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 2b68f6caeac271620cd2f9362aeaed360e317df0)
Change-Id: I1e376446aa6fa130f95be59198a59e33de99cb64
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/1207743
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

3 years agoarm64: standardize mmap_rnd() usage
Kees Cook [Tue, 14 Apr 2015 22:47:48 +0000]
arm64: standardize mmap_rnd() usage

In preparation for splitting out ET_DYN ASLR, this refactors the use of
mmap_rnd() to be used similarly to arm and x86.  This additionally
enables mmap ASLR on legacy mmap layouts, which appeared to be missing
on arm64, and was already supported on arm.  Additionally removes a
copy/pasted declaration of an unused function.

bug 200226998

Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit dd04cff1dceab18226853b555cf07914648a235f)
Change-Id: I058079c52e29888950af0e88f4547254f8cff176
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/1207742
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

3 years agoarm: factor out mmap ASLR into mmap_rnd
Kees Cook [Tue, 14 Apr 2015 22:47:41 +0000]
arm: factor out mmap ASLR into mmap_rnd

To address the "offset2lib" ASLR weakness[1], this separates ET_DYN ASLR
from mmap ASLR, as already done on s390.  The architectures that are
already randomizing mmap (arm, arm64, mips, powerpc, s390, and x86), have
their various forms of arch_mmap_rnd() made available via the new
CONFIG_ARCH_HAS_ELF_RANDOMIZE.  For these architectures,
arch_randomize_brk() is collapsed as well.

This is an alternative to the solutions in:
https://lkml.org/lkml/2015/2/23/442

I've been able to test x86 and arm, and the buildbot (so far) seems happy
with building the rest.

[1] http://cybersecurity.upv.es/attacks/offset2lib/offset2lib.html

This patch (of 10):

In preparation for splitting out ET_DYN ASLR, this moves the ASLR
calculations for mmap on ARM into a separate routine, similar to x86.
This also removes the redundant check of personality (PF_RANDOMIZE is
already set before calling arch_pick_mmap_layout).

bug 200226998

Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: Hector Marco-Gisbert <hecmargi@upv.es>
Cc: Russell King <linux@arm.linux.org.uk>
Reviewed-by: Ingo Molnar <mingo@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: "David A. Long" <dave.long@linaro.org>
Cc: Andrey Ryabinin <a.ryabinin@samsung.com>
Cc: Arun Chandran <achandran@mvista.com>
Cc: Yann Droneaud <ydroneaud@opteya.com>
Cc: Min-Hua Chen <orca.chen@gmail.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: Alex Smith <alex@alex-smith.me.uk>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Cc: Vineeth Vijayan <vvijayan@mvista.com>
Cc: Jeff Bailey <jeffbailey@google.com>
Cc: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Cc: Ben Hutchings <ben@decadent.org.uk>
Cc: Behan Webster <behanw@converseincode.com>
Cc: Ismael Ripoll <iripoll@upv.es>
Cc: Jan-Simon Mller <dl9pf@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit fbbc400f3924ce095b466c776dc294727ec0a202)
Change-Id: Id0b5621e80ef8afecbf49ad25ead9b316665cb47
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/1207741
GVS: Gerrit_Virtual_Submit
Reviewed-by: Dhiren Parmar <dparmar@nvidia.com>

3 years agoarm64: ASLR: Don't randomise text when randomise_va_space == 0
Arun Chandran [Fri, 10 Oct 2014 11:31:24 +0000]
arm64: ASLR: Don't randomise text when randomise_va_space == 0

When user asks to turn off ASLR by writing "0" to
/proc/sys/kernel/randomize_va_space there should not be
any randomization to mmap base, stack, VDSO, libs, text and heap

Currently arm64 violates this behavior by randomising text.
Fix this by defining a constant ELF_ET_DYN_BASE. The randomisation of
mm->mmap_base is done by setup_new_exec -> arch_pick_mmap_layout ->
mmap_base -> mmap_rnd.

bug 200226998

Signed-off-by: Arun Chandran <achandran@mvista.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 92980405f3537136b8e81007a9df576762f49bbb)
Change-Id: I107b48ea26bdd6a6772a81e6a4ee37093eac5be5
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/1208141
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

3 years agonet: wireless: bcmdhd: security enhancement for BRCM ether type
Ramanathan R [Thu, 29 Sep 2016 09:51:20 +0000]
net: wireless: bcmdhd: security enhancement for BRCM ether type

Strict ckeckup for type and event data length
Patch to fix CVE-2016-0801 in DHD driver

Bug 200210164

Change-Id: I1a63c1a2cfa4ad1187c6bf36a4a3b23dbe0ae154
Signed-off-by: Ramanathan R <ramanathan.r@broadcom.com>
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: http://git-master/r/1221919
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>

3 years agoARM64: dts: t210: update PMIC rails FPS config
Venkat Reddy Talla [Fri, 20 May 2016 09:54:03 +0000]
ARM64: dts: t210: update PMIC rails FPS config

Updating PMIC rails FPS configuration for darcy platform
based on sys-eng suggested platform specific ramp time
data.

//syseng/Projects/P2894/Validation/A04/T210_DARCY_A04-sequening-data.xlsx
REV:01

Bug 200163523

Change-Id: Ib9cc0cae6dd506a40c568248c58760bc98e4bca9
Signed-off-by: Venkat Reddy Talla <vreddytalla@nvidia.com>
Reviewed-on: http://git-master/r/1151070
(cherry picked from commit 5fcb84e67163c167d818cb7b8d3c6577dd59a1cb)
Reviewed-on: http://git-master/r/1213479
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

3 years agohdmihdcp: initialize session id to 0
Pranami Bhattacharya [Tue, 20 Sep 2016 00:01:20 +0000]
hdmihdcp: initialize session id to 0

- The session id should be initialized
- The session id should be reset upon close

Bug 1815206

Change-Id: Ia26aec9fc996c8a8842e09d8be0a7df4640ada97
Signed-off-by: Pranami Bhattacharya <pranamib@nvidia.com>
Reviewed-on: http://git-master/r/1225625
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinayak Pane <vpane@nvidia.com>

3 years agonet: wireless: bcmdhd: Re-arch nvtcpdump stats collection
Srinivas Ramachandran [Tue, 20 Sep 2016 19:22:06 +0000]
net: wireless: bcmdhd: Re-arch nvtcpdump stats collection

1. Add more statistics and re-design the stats logger - Bug 1752858

2. Add multiple logs buffers to tcpdump - Bug 1670088, Bug 1752858

    Update tcpdump packet log to support multiple events.

    Power and statistics events are stored in a separate log from tcpdump packet
    logs, so that they do not get over-written in case of overflow (due to
    excessive rx/tx tcpdump packets).

3. Add time synchronization packet in nvtcpdump - Bug 200042859

    Add a guaranteed time synchronization packet at the head of nvtcpdump
    buffer. The post-processing script uses this packet to compute the
    DUT timestamp for other packets in buffer.

Bug 1752858

Change-Id: I43645b5caa9536e2cb9f9e2f0ee5ecdd5cade16e
Signed-off-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-on: http://git-master/r/1223993
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>

3 years agonet: wireless: bcmdhd_88: Re-arch nvtcpdump stats collection
Srinivas Ramachandran [Tue, 20 Sep 2016 18:21:21 +0000]
net: wireless: bcmdhd_88: Re-arch nvtcpdump stats collection

1. Add more statistics and re-design the stats logger - Bug 1752858

2. Integrate rf_test sysfs - Bug 1713208

    RF testing needs wifi chip power save mode to be set to 0 and
    roaming to be turned off. Add sysfs node to enable rf_test mode
    in driver which disables roaming and power save.
    rf_test mode also persists the txchain and rxchain vars until
    disabled.

    This commit also includes following commits
    a035ae0c380bc27e881ae1afba9408fb88a22180 - Coverity ID: 20430
    1bd29fb3fc3f1143ab837412db79d436ea1d8bca - Fix compile warnings

3. Add multiple logs buffers to tcpdump - Bug 1670088, Bug 1752858

    Update tcpdump packet log to support multiple events.
    Power and statistics events are stored in a separate log from tcpdump packet
    logs, so that they do not get over-written in case of overflow (due to
    excessive rx/tx tcpdump packets).

4. Add time synchronization packet in nvtcpdump - Bug 200042859

    Add a guaranteed time synchronization packet at the head of nvtcpdump
    buffer. The post-processing script uses this packet to compute the
    DUT timestamp for other packets in buffer.

Bug 1752858

Change-Id: If4c9d6889dd781f5fe8b196ba9fc19087c4cc45c
Signed-off-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-on: http://git-master/r/1223940
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>

3 years agoproc: actually make proc_fd_permission() thread-friendly
Oleg Nesterov [Thu, 22 Sep 2016 09:03:03 +0000]
proc: actually make proc_fd_permission() thread-friendly

The commit 96d0df79f264 ("proc: make proc_fd_permission() thread-friendly")
fixed the access to /proc/self/fd from sub-threads, but introduced another
problem: a sub-thread can't access /proc/<tid>/fd/ or /proc/thread-self/fd
if generic_permission() fails.
Change proc_fd_permission() to check same_thread_group(pid_task(), current).

Bug 200237562

Change-Id: Id8e5c879305865062d8f0cce9887168a3193390d
Fixes: 96d0df79f264 ("proc: make proc_fd_permission() thread-friendly")
Reported-by: "Jin, Yihua" <yihua.jin@intel.com>
commit 54708d2858e79a2bdda10bf8a20c80eb96c20613
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Vaibhav Shinde <vashinde@nvidia.com>
Reviewed-on: http://git-master/r/1225094
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

3 years agoARM64: DT: Darcy: Use DTB for Wi-Fi card detect
Mohan Thadikamalla [Fri, 23 Sep 2016 04:31:05 +0000]
ARM64: DT: Darcy: Use DTB for Wi-Fi card detect

- Enable card detect from DT and set sdhci_host as sdmmc2
- Use power retry country from DT and set pwr_retry_cnt as 5

Bug 200233323

Change-Id: I1fe55fc7253cf900cf826e22b321906c21b3caf3
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: http://git-master/r/1217947
(cherry picked from commit c6762f4c955e716d034379930ed6f21035af80fe)
Reviewed-on: http://git-master/r/1225159
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>

3 years agoALSA: hda: Reset all stream DMAs during reboot
Andrew Chen [Wed, 7 Sep 2016 08:49:45 +0000]
ALSA: hda: Reset all stream DMAs during reboot

We need to reset all stream DMAs before azx_stop_chip() or we may hit
mc errors with the following messages:

 mc-err: (7) csw_hdaw: EMEM decode error on PDE or PTE entry
 mc-err:   status = 0x60010035; addr = 0x00000000
 mc-err:   secure: no, access-type: write, SMMU fault: nr-nw-s

Bug 200231783

Change-Id: I8ff6958a1aa88990cacd803c339976eebd7efbc2
Signed-off-by: Andrew Chen <andrewc@nvidia.com>
Reviewed-on: http://git-master/r/1217013
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sayak Choudhury <sayakc@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>

3 years agoDon't show empty tag stats for unprivileged uids
Mohamad Ayyash [Wed, 11 May 2016 20:18:35 +0000]
Don't show empty tag stats for unprivileged uids

BUG: 27577101
BUG: 27532522
(cherry picked from commit d85e322ff3bc8d7aa872ad12df6427dd236e540a)

Bug 1806975

Change-Id: I4451e6c3a1ccf0293a8ea4ffdf1822c8486ed605
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
Reviewed-on: http://git-master/r/1220563
Tested-by: Bobby Wang (SW-TEGRA) <bobwang@nvidia.com>
Reviewed-by: Bobby Wang (SW-TEGRA) <bobwang@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinayak Pane <vpane@nvidia.com>

3 years agoclocks: tegra12: Use static CPU-EMC co-relation
Somdutta Roy [Thu, 15 Sep 2016 19:13:43 +0000]
clocks: tegra12: Use static CPU-EMC co-relation

Using the actmon for handling the CPU - EMC frequency
scaling gave rise to higher AP+DRAM power and issues like
glitches in causal use cases and audio/video playback
Also the existing EMC frequency ranges were not evenly
distributed across corresponding CPU frequencies, thus
giving rise to sharp jumps in EMC frequencies at certain
CPU frequency levels. This patch addresses the above by

- Disabling mon_cpu.emc for T124 actmon.
- Enabling the cpu.emc clock.
- Using DT for static CPU-EMC freq
  corelation.
- Tweaking the lower range of the  CPU - EMC frequency
  corelation after ensuring no casual use cases get hit

Bug 1799917

Change-Id: I94238eeecee603cb6abe7f98917666119eb2fbfc

Signed-off-by: Somdutta Roy <somduttar@nvidia.com>
Change-Id: Ib10880777c68d0332a62c1b118415f0aff987ec5
Reviewed-on: http://git-master/r/1222372
Reviewed-by: Aleksandr Frid <afrid@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-by: Wen Yi <wyi@nvidia.com>
Reviewed-by: Steve Rogers <srogers@nvidia.com>

3 years agotegra-alt: adsp: avoid sleep in send msg
Viraj Karandikar [Thu, 1 Sep 2016 10:25:10 +0000]
tegra-alt: adsp: avoid sleep in send msg

Do not use blocking flag for mailbox send function.
Use mdelay instead of msleep

Bug 200222934

Change-Id: I9c121f50debb46b191ad735f7445bbe5c026e30a
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1217913
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>

3 years agotegra-alt: adsp: schedule work for freq override
Viraj Karandikar [Wed, 31 Aug 2016 12:23:14 +0000]
tegra-alt: adsp: schedule work for freq override

Schedule worker function for frequency override to avoid
adsp_override_freq() and clk_set_rate() getting called
from atomic context.

Bug 200222934

Change-Id: Ia65ce4a617bfd4494d04bdfac8b28e6d8260943c
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1211239
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Puneet Saxena <puneets@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>

3 years agoBACKPORT: FROMLIST: arm64: mm: support ARCH_MMAP_RND_BITS.
dcashman [Tue, 29 Dec 2015 23:28:13 +0000]
BACKPORT: FROMLIST: arm64: mm: support ARCH_MMAP_RND_BITS.

(cherry picked from commit https://lkml.org/lkml/2015/12/21/340)

arm64: arch_mmap_rnd() uses STACK_RND_MASK to generate the
random offset for the mmap base address.  This value represents a
compromise between increased ASLR effectiveness and avoiding
address-space fragmentation. Replace it with a Kconfig option, which
is sensibly bounded, so that platform developers may choose where to
place this compromise. Keep default values as new minimums.

Signed-off-by: Daniel Cashman <dcashman@android.com>
Signed-off-by: Daniel Cashman <dcashman@google.com>

Bug: 27796957
Patchset: ASLR sysctl

Bug 200227120

Change-Id: I2bce64c83f21c0c358e743d0d04239c805cca3f1
Signed-off-by: Kees Cook <keescook@google.com>
Signed-off-by: Vaibhav Shinde <vashinde@nvidia.com>
(cherry picked from commit 83b2f515c113d457e4be773e5f024212cf77eece)
Reviewed-on: http://git-master/r/1209026
Reviewed-by: Sri Krishna Chowdary <schowdary@nvidia.com>
Reviewed-by: Gagan Grover <ggrover@nvidia.com>
Reviewed-by: Dhiren Parmar <dparmar@nvidia.com>

3 years agoFROMLIST: mm: mmap: Add new /proc tunable for mmap_base ASLR.
dcashman [Tue, 29 Dec 2015 22:24:39 +0000]
FROMLIST: mm: mmap: Add new /proc tunable for mmap_base ASLR.

(cherry picked from commit https://lkml.org/lkml/2015/12/21/337)

ASLR  only uses as few as 8 bits to generate the random offset for the
mmap base address on 32 bit architectures. This value was chosen to
prevent a poorly chosen value from dividing the address space in such
a way as to prevent large allocations. This may not be an issue on all
platforms. Allow the specification of a minimum number of bits so that
platforms desiring greater ASLR protection may determine where to place
the trade-off.

Signed-off-by: Daniel Cashman <dcashman@android.com>
Signed-off-by: Daniel Cashman <dcashman@google.com>

Bug: 27796957
Patchset: ASLR sysctl

Bug 200227120

Change-Id: I1278914139a2e3910a301ab34755f409076768e7
Signed-off-by: Kees Cook <keescook@google.com>
Signed-off-by: Vaibhav Shinde <vashinde@nvidia.com>
(cherry picked from commit 6619fc5ad5427451d04903df37b37204502febb8)
Reviewed-on: http://git-master/r/1209024
Reviewed-by: Sri Krishna Chowdary <schowdary@nvidia.com>
Reviewed-by: Gagan Grover <ggrover@nvidia.com>
Reviewed-by: Dhiren Parmar <dparmar@nvidia.com>

3 years agoFROMLIST: arm: mm: support ARCH_MMAP_RND_BITS.
dcashman [Tue, 29 Dec 2015 23:07:17 +0000]
FROMLIST: arm: mm: support ARCH_MMAP_RND_BITS.

(cherry picked from commit https://lkml.org/lkml/2015/12/21/341)

arm: arch_mmap_rnd() uses a hard-code value of 8 to generate the
random offset for the mmap base address.  This value represents a
compromise between increased ASLR effectiveness and avoiding
address-space fragmentation. Replace it with a Kconfig option, which
is sensibly bounded, so that platform developers may choose where to
place this compromise. Keep 8 as the minimum acceptable value.

Signed-off-by: Daniel Cashman <dcashman@android.com>
Signed-off-by: Daniel Cashman <dcashman@google.com>

Bug: 27796957
Patchset: ASLR sysctl

Bug 200227120

Change-Id: Ia3c4bf2e765662fa3f600e1b626ac1543b0f0149
Signed-off-by: Kees Cook <keescook@google.com>
(cherry picked from commit 96d089f37baee5083d894e1ca8c8d669adfd67b4)
Signed-off-by: Vaibhav Shinde <vashinde@nvidia.com>
Reviewed-on: http://git-master/r/1209023
Reviewed-by: Sri Krishna Chowdary <schowdary@nvidia.com>
Reviewed-by: Gagan Grover <ggrover@nvidia.com>
Reviewed-by: Dhiren Parmar <dparmar@nvidia.com>

3 years agonet: wireless: bcmdhd_88: Add statistics counters
Michael Hsu [Tue, 13 Sep 2016 02:43:22 +0000]
net: wireless: bcmdhd_88: Add statistics counters

Implement stat sysfs node to report statistics:
- connects / disconnects
- f/w tx/rx counters
- firmware hangs
- connected wifi channels
- wifi power on failures
- etc.

Bug 1743467
Bug 200229148

Change-Id: I9007b73107cb63a19e6a29552b87bf58dce3ca66
Signed-off-by: Michael Hsu <mhsu@nvidia.com>
Reviewed-on: http://git-master/r/1219414
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>

3 years agotegra210-platforms: increase pwm granularity to 16 bits
Martin Gao [Fri, 26 Aug 2016 01:08:50 +0000]
tegra210-platforms: increase pwm granularity to 16 bits

For Darcy
- originally pwm ranges from 0 - 256, and lacks granularity
- increases to use 16 bits instead (0 - 65536)

Bug 1542391

Change-Id: Ia84338741e1a0ad4647cecabad23091edf3b27f6
Signed-off-by: Martin Gao <marting@nvidia.com>
Reviewed-on: http://git-master/r/1200172
(cherry picked from commit 3d35d72e7e220c10e3a8b75a7c7a3146adcce45c)
Reviewed-on: http://git-master/r/1219069
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinayak Pane <vpane@nvidia.com>

3 years agonvavp: Add missing mutex unlock
Soumen Kumar Dey [Thu, 15 Sep 2016 03:53:29 +0000]
nvavp: Add missing mutex unlock

Add missing mutex unlock for nvavp_submit.

bug 1775299

Change-Id: I1b525e192bfd9dd19bcd0211484400445eda7b2b
Signed-off-by: Soumen Kumar Dey <sdey@nvidia.com>
Reviewed-on: http://git-master/r/1221122
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

3 years agoarm64: boot: dts: darcy: New Fan settings
Anshul Jain [Thu, 16 Jun 2016 22:21:49 +0000]
arm64: boot: dts: darcy: New Fan settings

New fan table:
T.cpu PWM Hysterisis
63 65 30
65 110 1
79 160 10

Bug 1716449

Change-Id: I5be46de778b3cbbadb112058dcc68f43b31ad744
Signed-off-by: Anshul Jain <anshulj@nvidia.com>
Reviewed-on: http://git-master/r/1166129
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinayak Pane <vpane@nvidia.com>
(cherry picked from commit ec8ee6636f3d7922a3b3fa3991d16dcce140312a)
Reviewed-on: http://git-master/r/1220206
Reviewed-by: Automatic_Commit_Validation_User

3 years agostop_machine: serialize disable IRQ sequence
Prafull Suryawanshi [Mon, 2 Nov 2015 09:09:02 +0000]
stop_machine: serialize disable IRQ sequence

bug 200044022

On T124 platforms, we hit a hang on cpu_down(cpu=3) where
CPU3 gets stuck waiting on the gic irq_controller_lock in
gic_eoi_irq. The other CPUs have already entered the
DISABLE_IRQ stop machine state at this point.
This therefore causes the watchdog to timeout and the
system to reset. Given that we have the stopper thread
scheduled (preemption disabled), the 'hang scenario' most
likely manifests itself due to some sort of issue in
the irq context. Sequentially entering the DISABLE_IRQ
state from CPU3->CPU0 seem to somehow prevent this hang.

This change is only meant to be a temporary workaround
to improve system stability and is by no means a fix
of any sort. To that end, it is wrapped in a CONFIG
option that is turned off by default, except for T12x.

Change-Id: Ic50ecd5a6d429706e4f68bcd133707fae4e692ce
Signed-off-by: Prafull Suryawanshi <prafulls@nvidia.com>
Signed-off-by: Gagan Grover <ggrover@nvidia.com>
Reviewed-on: http://git-master/r/827027
Reviewed-by: Vaibhav Shinde <vashinde@nvidia.com>
Tested-by: Vaibhav Shinde <vashinde@nvidia.com>
Reviewed-by: Dhiren Parmar <dparmar@nvidia.com>
GVS: Gerrit_Virtual_Submit

3 years agoiio: common: NVS HAL API 1.4 support
Erik Lilliebjerg [Sun, 21 Aug 2016 09:03:06 +0000]
iio: common: NVS HAL API 1.4 support

- Add support for Android sensor HAL API 1.4:
  - Add API 1.4 sensor definitions.
  - Add dynamic sensor support.

Change-Id: Id6ad4e6200d3d980b60e8fecd1408bd92014c682
Signed-off-by: Erik Lilliebjerg <elilliebjerg@nvidia.com>
Reviewed-on: http://git-master/r/1206627
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Akhilesh Khumbum <akhumbum@nvidia.com>
Tested-by: Robert Collins <rcollins@nvidia.com>
Reviewed-by: Robert Collins <rcollins@nvidia.com>
GVS: Gerrit_Virtual_Submit

3 years agoXCHI: version is not needed.
David DSH [Mon, 29 Aug 2016 18:52:10 +0000]
XCHI: version is not needed.

Move version to user space.

Bug 1764715

Change-Id: Ifa8e16a0c4d3181e422976e0fe9f28f43578f84a
Signed-off-by: David DSH <ddastoussthi@nvidia.com>
Reviewed-on: http://git-master/r/1209231
(cherry picked from commit dda519af9b636ed0e47c2a3dcdcaf21c9a73e0e6)
Reviewed-on: http://git-master/r/1217153
Reviewed-by: Martin Gao <marting@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinayak Pane <vpane@nvidia.com>

3 years agommc: card: test: Fix out of boundary array access
Xia Yang [Mon, 15 Aug 2016 21:56:51 +0000]
mmc: card: test: Fix out of boundary array access

Allocate buffer with 1 extra byte for NULL terminator.

Bug 1791602

Change-Id: I3c3658315c2cd2a1dc7be7d72953998a5275e71e
(cherry picked from commit 53f628117d0a092182254ad81bc38cf943b994e3)
Signed-off-by: Mithun Maragiri <mmaragiri@nvidia.com>
Reviewed-on: http://git-master/r/1213890
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinayak Pane <vpane@nvidia.com>

3 years agoproc: make proc_fd_permission() thread-friendly
Oleg Nesterov [Wed, 11 Sep 2013 21:24:37 +0000]
proc: make proc_fd_permission() thread-friendly

proc_fd_permission() says "process can still access /proc/self/fd after it
has executed a setuid()", but the "task_pid() = proc_pid() check only
helps if the task is group leader, /proc/self points to
/proc/<leader-pid>.

Change this check to use task_tgid() so that the whole thread group can
access its /proc/self/fd or /proc/<tid-of-sub-thread>/fd.

Notes:
- CLONE_THREAD does not require CLONE_FILES so task->files
  can differ, but I don't think this can lead to any security
  problem. And this matches same_thread_group() in
  __ptrace_may_access().

- /proc/self should probably point to /proc/<thread-tid>, but
  it is too late to change the rules. Perhaps it makes sense
  to add /proc/thread though.

Test-case:

void *tfunc(void *arg)
{
assert(opendir("/proc/self/fd"));
return NULL;
}

int main(void)
{
pthread_t t;
pthread_create(&t, NULL, tfunc, NULL);
pthread_join(t, NULL);
return 0;
}

fails if, say, this executable is not readable and suid_dumpable = 0.

Bug 200226999

Change-Id: I4a0f2648e257b75c8b03516a63f655a1adbe942c
(Cherry-picked from 96d0df79f2644fc823f26c06491e182d87a90c2a)
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Vaibhav Shinde <vashinde@nvidia.com>
Reviewed-on: http://git-master/r/1212863
Reviewed-by: Sri Krishna Chowdary <schowdary@nvidia.com>
Reviewed-by: Dhiren Parmar <dparmar@nvidia.com>
Reviewed-by: Gagan Grover <ggrover@nvidia.com>

3 years agothermal: add sanity check for set state ops
Martin Gao [Tue, 30 Aug 2016 00:38:42 +0000]
thermal: add sanity check for set state ops

- add sanity check in set_cur_state ops, so that it only update state
  if set state is within max number of states supported

Bug 1806751

Change-Id: I9a57baf6b4e3847a639e4dcddb8336604f23b345
Signed-off-by: Martin Gao <marting@nvidia.com>
Reviewed-on: http://git-master/r/1216504
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinayak Pane <vpane@nvidia.com>

3 years agohid: jarvis: send report to app to control mic
siddardha naraharisetti [Wed, 25 May 2016 06:18:25 +0000]
hid: jarvis: send report to app to control mic

To control pepper mic, send report to userspace so that
it can send the report to pepper using gattservice
rather than sending message using hid output report.
this will help to prevent multiple concurrent requests
to pepper, as Gattservice will serialize the requests

Bug 1769205

Change-Id: Ifa2084610529cdf6353b547be267d6434b79e82e
Signed-off-by: siddardha naraharisetti <siddardhan@nvidia.com>
Reviewed-on: http://git-master/r/1153070
(cherry picked from commit 1c4276a801526e9ea42ae3247d5df57394a023a6)
Reviewed-on: http://git-master/r/1208539
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Spencer Sutterlin <ssutterlin@nvidia.com>
Reviewed-by: Vinayak Pane <vpane@nvidia.com>

3 years agobcmdhd_88: increase timestamp array size
Bibhay Ranjan [Mon, 5 Sep 2016 18:35:35 +0000]
bcmdhd_88: increase timestamp array size

-add timestamp size too while calculating
total buffer size.

Bug 200231581

Reviewed-on: http://git-master/r/1207551
Change-Id: Ia261b20c476107f836f848e695d4f77adc41fa58
Signed-off-by: Bibhay Ranjan <bibhayr@nvidia.com>
Reviewed-on: http://git-master/r/1214965
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>

3 years agoata: ahci_tegra: Fix RTPM issues
Preetham Chandru R [Fri, 12 Aug 2016 12:36:31 +0000]
ata: ahci_tegra: Fix RTPM issues

This bug fixes RTPM issues for few drives where
link does not go to low power modes. If drive
does not go to LPM it should only send standby command
and skip suspending SATA Controller

Bug 200224437

Change-Id: I2ab95796fdc7b1849c45c26fb6773aafc32cbb7d
Signed-off-by: Preetham Chandru R <pchandru@nvidia.com>
Reviewed-on: http://git-master/r/1203574
(cherry picked from commit a3859e7b0046faca452cb5471dfa56d6ec06a1d2)
Reviewed-on: http://git-master/r/1211309
GVS: Gerrit_Virtual_Submit
Reviewed-by: Kerwin Wan <kerwinw@nvidia.com>
Tested-by: Kerwin Wan <kerwinw@nvidia.com>

3 years agobcmdhd: nv_logger: fix memory leak
Bibhay Ranjan [Thu, 25 Aug 2016 06:56:14 +0000]
bcmdhd: nv_logger: fix memory leak

-call kfree for internal structures.
-increase the size of the timestamp
 array to accomodate the complete time
 format.
-add timestamp size too while calculating
 total buffer size.

Bug 200231581

Change-Id: I64bb1ad7f5959f659653469101b2e230f302132f
Signed-off-by: Bibhay Ranjan <bibhayr@nvidia.com>
Reviewed-on: http://git-master/r/1207551
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>

3 years agoRevert "mmc: host: Use SDR104 UHS mode for SDR50 mode"
R Raj Kumar [Wed, 31 Aug 2016 12:28:45 +0000]
Revert "mmc: host: Use SDR104 UHS mode for SDR50 mode"

- This reverts commit 32d6f044342573de290bcf86e55c1f5708eec229,
  since, UHS mode timing selections are already handled
  in sdhci tegra driver and this commit is not required.
- Select SDR104 mode for SDR50 mode by removing the NvQuirk.

Bug 1806889

Change-Id: If4025f206cf2caddb7cc0252b927708c3e21a2df
Signed-off-by: R Raj Kumar <rrajk@nvidia.com>
Reviewed-on: http://git-master/r/1211242
GVS: Gerrit_Virtual_Submit
Reviewed-by: Venu Byravarasu <vbyravarasu@nvidia.com>

3 years agovideo: tegra: hdmi: add check for valid fb
Prafull Suryawanshi [Wed, 24 Aug 2016 10:22:39 +0000]
video: tegra: hdmi: add check for valid fb

bug 200228662

When monitor kept connected while booting, dc can get hpd interrupt
before fb register is complete. This cause kernel panic. This change
checks if fb is valid and also cancel the hdmi state change if fb is
not ready yet.

Change-Id: I0a528ef83c9212a52c35ca62fc3d3d3eb0cca12a
Signed-off-by: Prafull Suryawanshi <prafulls@nvidia.com>
Reviewed-on: http://git-master/r/1206999
GVS: Gerrit_Virtual_Submit
Reviewed-by: Aly Hirani <ahirani@nvidia.com>
Reviewed-by: Santosh Galma <galmar@nvidia.com>
Reviewed-by: Mitch Luban <mluban@nvidia.com>

3 years agotegra-profiler: fix security vulnerability issue
Igor Nabirushkin [Thu, 18 Aug 2016 08:35:20 +0000]
tegra-profiler: fix security vulnerability issue

Tegra Profiler: some fields of structs are not initialized.
So, when they are copied to user space, stack information leaks.

Bug 1797747

Change-Id: I2b00f30fa2e3360c412573d40faf96f45c113346
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/1208892
(cherry picked from commit 08d72717508f180fcf6f5b73557c4413356d76eb)
Reviewed-on: http://git-master/r/1210648
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinayak Pane <vpane@nvidia.com>

3 years agovideo: tegra: dc: fix bit depth of yuv422 mode
Michael Frydrych [Fri, 17 Jun 2016 14:39:30 +0000]
video: tegra: dc: fix bit depth of yuv422 mode

Bit depth of yuv422 mode was set to 10-bits, while it should
have been set to 12-bits. Incorrect bit depth resulted in the
mode not being intercepted when setting yuv422 black.

Bug 200102634
Bug 200182153

Change-Id: I6de42816a9aad92bc2c8bdfad70b1727a49fe94a
Signed-off-by: Michael Frydrych <mfrydrych@nvidia.com>
Reviewed-on: http://git-master/r/1167820
(cherry picked from commit 39aabae1c46710a5dd609690ab12746075640f7f)
Reviewed-on: http://git-master/r/1177570
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ivan Raul Guadarrama <iguadarrama@nvidia.com>
Tested-by: Ivan Raul Guadarrama <iguadarrama@nvidia.com>
Reviewed-by: Tuomas Kulve <tkulve@nvidia.com>
Reviewed-by: Aly Hirani <ahirani@nvidia.com>
Reviewed-by: Mitch Luban <mluban@nvidia.com>

3 years agoxhci-tegra: t210: wait for U3 entry in bus suspend
Henry Lin [Sun, 14 Aug 2016 17:17:11 +0000]
xhci-tegra: t210: wait for U3 entry in bus suspend

In T210, U3 entry delay is expected as LFPS dectector WAR needs to
use two mailbox commands to implement. The two mailbox commands can be
finished among 2 ms most of time. But, in worst case, they may
take up to hundreds of ms. Waiting for U3 entry in bus suspend
for some time can avoid xhci-tegra driver to stop system suspend
for long U3 entry delay frequently.

Bug 200227198

Change-Id: I989e60e829d8bd9b085495d96f70580c6d7981ab
Signed-off-by: Henry Lin <henryl@nvidia.com>
Reviewed-on: http://git-master/r/1202447
(cherry picked from commit 1659d51b9ee211161af1653aef4f84cdad013aef)
Reviewed-on: http://git-master/r/1209494
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: WK Tsai <wtsai@nvidia.com>
Reviewed-by: ChihMin Cheng <ccheng@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>

3 years agoarm64: dts: Updating Wi-Fi country codes for Foster/Darcy
Mahesh Patil [Tue, 30 Aug 2016 05:56:08 +0000]
arm64: dts: Updating Wi-Fi country codes for Foster/Darcy

- Foster: Update EU country code with DFS support
- Foster: Update IN country code with EU w/o DFS
- Foster: Add CN country code
- Foster/Darcy: Add NZ country code, same as AU
- Foster/Darcy: Add HK country code, same as EU
- Foster/Darcy: Add SG country code, same as US

Bug 1792300
Bug 1792302

Change-Id: I3bf493b3d53da2cbe9656c15bcdc5b9732d88c15
Reviewed-on: http://git-master/r/1207549
(cherry picked from commit ef64644362f36f69dc2b7e427f2f6fdfeec8b8c5)
(cherry picked from commit 10192426e19b8711ac3362ef140c5e6d65a22dae)
Signed-off-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-on: http://git-master/r/1209546
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Thadikamalla <mohant@nvidia.com>
Tested-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>

3 years agonvtouch: dta: copy touches to dta ioctl data
Aaron Bartholomew [Wed, 15 Jun 2016 20:54:53 +0000]
nvtouch: dta: copy touches to dta ioctl data

need to add touches to the outgoing data to client
over nvtouch's dta ioctl

bug 1637284

Change-Id: I600aeff52838f97a653e9ad410951e641e816c6c
Signed-off-by: Aaron Bartholomew <abartholomew@nvidia.com>
Reviewed-on: http://git-master/r/1165177
Reviewed-by: Steve Rogers <srogers@nvidia.com>
(cherry picked from commit d486c17f3cd7d2a5dcf40cd4b02a4ab19fe4e10e)
Reviewed-on: http://git-master/r/1172604
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit

3 years agoxt_qtaguid: fix printing kernel pointers
Nitin Kumbhar [Tue, 5 Jul 2016 07:59:14 +0000]
xt_qtaguid: fix printing kernel pointers

Kernel pointers are printed to all users. This could enable
a local malicious application to access data outside of its
permission levels. The fix is designed to not print kernel
pointers to any user.

CVE-2016-3809
Bug 1774591

Change-Id: Ia9d6fedd4a9d0811585586dbbaeb5ed151771c58
Reviewed-on: http://git-master/r/1175528
(cherry picked from commit 32b4fdc1d841f560fc52520a719193048e55a835)
Signed-off-by: Mithun Maragiri <mmaragiri@nvidia.com>
Reviewed-on: http://git-master/r/1205272
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinayak Pane <vpane@nvidia.com>
(cherry picked from commit 7050d35b2fa03ef788741abcc9e05f05ae222efe)
Reviewed-on: http://git-master/r/1209298

3 years agonet: disable capability check for net_bind_service
Xiao Bo Zhao [Wed, 27 Apr 2016 22:26:54 +0000]
net: disable capability check for net_bind_service

If group id matches, then skip capability and selinux check for capability
CAP_NET_BIND_SERVICE

Bug 200227789
Bug 1763043

Change-Id: I5935860c016d0f76b874595e83f2fd918f3fa36d
Signed-off-by: Xiao Bo Zhao <xiaoboz@nvidia.com>
Reviewed-on: http://git-master/r/1133850
Reviewed-by: Toby Butzon <tbutzon@nvidia.com>
Reviewed-by: Nitin Kumbhar <nkumbhar@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Inamdar Sharif <isharif@nvidia.com>
Reviewed-by: Raymond Poudrier <rapoudrier@nvidia.com>
Reviewed-on: http://git-master/r/1177256
Reviewed-by: Vinayak Pane <vpane@nvidia.com>
Reviewed-on: http://git-master/r/1207320
Tested-by: Patrick Horng <phorng@nvidia.com>

3 years agosecurity: tlk_driver: add support for PHYS_LIST handling.
Chris Johnson [Mon, 23 Mar 2015 23:37:35 +0000]
security: tlk_driver: add support for PHYS_LIST handling.

Bug 200091941
Bug 1754253

Change-Id: Ia5b920e6f45280b7a3fb4360b828612225af5761
Signed-off-by: Chris Johnson <cwj@nvidia.com>
Signed-off-by: Mahesh Lagadapati <mlagadapati@nvidia.com>
Reviewed-on: http://git-master/r/1132411
(cherry picked from commit 4c5acba1dbe4439258f4203823cdac5bee24a00b)
Reviewed-on: http://git-master/r/1164583
Reviewed-on: http://git-master/r/1119126
Reviewed-by: Vinayak Pane <vpane@nvidia.com>

3 years agotlk: code cleanup
Mahesh Lagadapati [Mon, 10 Aug 2015 20:11:12 +0000]
tlk: code cleanup

Cleaned up the code to do proper error handling and to remove unused
variables.

Bug 200091941
Bug 1754253

Change-Id: Ia0e84451bbbb29edd35dd3060864c6e60cbc6192
Signed-off-by: Mahesh Lagadapati <mlagadapati@nvidia.com>
Reviewed-on: http://git-master/r/1132416
(cherry picked from commit 6ef9203cec6c77384b0a44c731c7fa050074dea2)
Reviewed-on: http://git-master/r/1164582
Reviewed-on: http://git-master/r/1119125
Reviewed-by: Vinayak Pane <vpane@nvidia.com>

3 years agosecurity: tlk_driver: fix memory leak
Hridya Valsaraju [Tue, 2 Jun 2015 17:21:50 +0000]
security: tlk_driver: fix memory leak

Fix memory leak in te_pin_user_pages().
When get_user_pages() fail, free allocated memory and
release each mapped page from the page cache.

Bug 200091941
Bug 1754253

Change-Id: Ifdd311863916baa42e6e1b38f1692c72382bb44a
(cherry picked from commit 82f26d7cdd8244b498049e2ae49cc6ab87f21908)
Signed-off-by: Hridya Valsaraju <hvalsaraju@nvidia.com>
Signed-off-by: Mahesh Lagadapati <mlagadapati@nvidia.com>
Reviewed-on: http://git-master/r/1132415
Reviewed-on: http://git-master/r/1164581
Reviewed-on: http://git-master/r/1017875
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Vinayak Pane <vpane@nvidia.com>

3 years agoRevert "security: tlk_driver: lock/fault userspace pages"
Mahesh Lagadapati [Thu, 31 Mar 2016 19:59:58 +0000]
Revert "security: tlk_driver: lock/fault userspace pages"

This reverts commit a517ace37e656ea3023b527882d349329a026a84.

mlock is not required if buffers are send with physical address.

Bug 200091941
Bug 1754253

Change-Id: I82b7db24b33d867581d031d79230aa3265f1eb7e
Signed-off-by: Mahesh Lagadapati <mlagadapati@nvidia.com>
Reviewed-on: http://git-master/r/1132414
(cherry picked from commit edbda45bfce9e597ddee6f3b9ec49e3d7394eb36)
Reviewed-on: http://git-master/r/1164580
Reviewed-on: http://git-master/r/1119124
Reviewed-by: Vinayak Pane <vpane@nvidia.com>

3 years agoRevert "security:tlk_driver:fix sys_munlock issue"
Mahesh Lagadapati [Thu, 31 Mar 2016 19:59:03 +0000]
Revert "security:tlk_driver:fix sys_munlock issue"

This reverts commit ddb690950d1402f995d0c73bb00bd5bf865cdda5.

mlock is not required if buffers are send with physical address.

Bug 200091941
Bug 1754253

Change-Id: I5240d41e6659461c0b43df015f6dc44db594174c
Signed-off-by: Mahesh Lagadapati <mlagadapati@nvidia.com>
Reviewed-on: http://git-master/r/1132413
(cherry picked from commit 2ab4f8b7e13e9343e94292778e674e6436b59eca)
Reviewed-on: http://git-master/r/1164579
Reviewed-on: http://git-master/r/1119123
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Vinayak Pane <vpane@nvidia.com>

3 years agot210: tegra-fuse: correct the fuse offsets
Shardar Shariff Md [Tue, 23 Aug 2016 12:17:05 +0000]
t210: tegra-fuse: correct the fuse offsets

Correct the fuse offsets for device_key, device_selection, reserved_sw
and arm_jtag_disable fuses

Bug 200214601

Change-Id: I52cbd48182cd8e3d9b8e76ec65cd43437c9ed05a
Signed-off-by: Shardar Shariff Md <smohammed@nvidia.com>
Reviewed-on: http://git-master/r/1206366
(cherry picked from commit cb417897f5e103bfc4e37ecf4e030883c15d2f72)
Reviewed-on: http://git-master/r/1208300
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Venu Byravarasu <vbyravarasu@nvidia.com>

3 years agobcmdhd_88: save the firmware events in a file
Bibhay Ranjan [Thu, 25 Aug 2016 16:22:54 +0000]
bcmdhd_88: save the firmware events in a file

Bug 200173848
Bug 200231606

Change-Id: Ifd77b012ebc6dcb5a762b4f4a3f054f0a6992b13
Reviewed-on: http://git-master/r/1011951
Signed-off-by: Bibhay Ranjan <bibhayr@nvidia.com>
Reviewed-on: http://git-master/r/1207869
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>

3 years agoarm64: tegra: dts: remove unused codec node for jetson
Kerwin Wan [Wed, 24 Aug 2016 09:56:16 +0000]
arm64: tegra: dts: remove unused codec node for jetson

rt5659 was used as an audio evaluate card in jetson bringup
stage and later is replaced with super module.

Bug 200231270

Change-Id: Ibbb10856e967a29575a2d040ec4d87e1ecee0048
Signed-off-by: Kerwin Wan <kerwinw@nvidia.com>
Reviewed-on: http://git-master/r/1207109
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sameer Pujar <spujar@nvidia.com>

3 years agosched: Make CPU domains share pkg resources
Sai Gurrappadi [Mon, 23 Feb 2015 23:04:24 +0000]
sched: Make CPU domains share pkg resources

This allows for better use of idle CPUs in our SD_SHARE_PKG_RESOURCE
domain (top level sd). Hacking the default CPU sd instead of populating
this via the arch topology for experimentation.

Bug 200055047

Change-Id: I1d5a56fe35dd98b805b19940b4d6fb288c10af1e
Signed-off-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-on: http://git-master/r/724489
GVS: Gerrit_Virtual_Submit
Reviewed-by: Anshul Jain (SW) <anshulj@nvidia.com>
Tested-by: Anshul Jain (SW) <anshulj@nvidia.com>
Reviewed-by: Vinayak Pane <vpane@nvidia.com>
(cherry picked from commit fb221b1b1786abdaec8b30f0563985989acd4125)
Reviewed-on: http://git-master/r/921536
Reviewed-by: David Lock <dlock@nvidia.com>
Tested-by: David Lock <dlock@nvidia.com>
Reviewed-by: Ilan Aelion <iaelion@nvidia.com>