Commit graph android_kernel_sony_sdm845/kernel
Message SHA1
Merge "cpu-hotplug: Always use real time scheduling when hotplugging a CPU" into msm-4.9
Linux Build Service Account   authored and   Gerrit - the friendly Code Review server   commited 2017-04-11 13:52:38 -07:00
023a1495a3
Merge "Merge remote-tracking branch '4.9/tmp-6856581' into msm-4.9" into msm-4.9
Linux Build Service Account   authored and   Gerrit - the friendly Code Review server   commited 2017-04-10 15:02:45 -07:00
a3107ff496
Merge "perf/core: Compile out perf_cpu_hp_init when CONFIG_HOTPLUG is not set" into msm-4.9
Linux Build Service Account   authored and   Gerrit - the friendly Code Review server   commited 2017-04-09 12:35:46 -07:00
4088e8485d
Merge remote-tracking branch '4.9/tmp-6856581' into msm-4.9
* 4.9/tmp-6856581:
  Linux 4.9.21
  nvme/pci: Disable on removal when disconnected
  nvme/core: Fix race kicking freed request_queue
  padata: avoid race in reordering
  blk: Ensure users for current->bio_list can see the full list.
  blk: improve order of bio handling in generic_make_request()
  mm: workingset: fix premature shadow node shrinking with cgroups
  MIPS: Lantiq: Fix cascaded IRQ setup
  ARM: dts: BCM5301X: Correct GIC_PPI interrupt flags
  qla2xxx: Allow vref count to timeout on vport delete.
  ARM: BCM5301X: Add back handler ignoring external imprecise aborts
  mm, hugetlb: use pte_present() instead of pmd_present() in follow_huge_pmd()
  mm: rmap: fix huge file mmap accounting in the memcg stats
  lib/syscall: Clear return values when no stack
  x86/mce: Fix copy/paste error in exception table entries
  x86/mm/KASLR: Exclude EFI region from KASLR VA space randomization
  drm/etnaviv: (re-)protect fence allocation with GPU mutex
  drm/vc4: Allocate the right amount of space for boot-time CRTC state.
  drm/radeon: Override fpfn for all VRAM placements in radeon_evict_flags
  KVM: kvm_io_bus_unregister_dev() should never fail
  KVM: x86: clear bus pointer when destroyed
  serial: mxs-auart: Fix baudrate calculation
  USB: fix linked-list corruption in rh_call_control()
  tty/serial: atmel: fix TX path in atmel_console_write()
  tty/serial: atmel: fix race condition (TX+DMA)
  ACPI: Do not create a platform_device for IOAPIC/IOxAPIC
  ACPI: Fix incompatibility with mcount-based function graph tracing
  parisc: Fix access fault handling in pa_memcpy()
  parisc: Avoid stalled CPU warnings after system shutdown
  parisc: Clean up fixup routines for get_user()/put_user()
  nfsd: map the ENOKEY to nfserr_perm for avoiding warning
  NFSv4.1 fix infinite loop on IO BAD_STATEID error
  mmc: sdhci-of-at91: fix MMC_DDR_52 timing selection
  mmc: sdhci: Disable runtime pm when the sdio_irq is enabled
  HID: wacom: Don't add ghost interface as shared data
  ASoC: Intel: Skylake: fix invalid memory access due to wrong reference of pointer
  ASoC: atmel-classd: fix audio clock rate
  ALSA: hda - fix a problem for lineout on a Dell AIO machine
  ALSA: seq: Fix race during FIFO resize
  PCI: iproc: Save host bridge window resource in struct iproc_pcie
  scsi: scsi_dh_alua: Ensure that alua_activate() calls the completion function
  scsi: scsi_dh_alua: Check scsi_device_get() return value
  scsi: libsas: fix ata xfer length
  scsi: sg: check length passed to SG_NEXT_CMD_LEN
  xfs: try any AG when allocating the first btree block when reflinking
  xfs: use iomap new flag for newly allocated delalloc blocks
  xfs: Use xfs_icluster_size_fsb() to calculate inode alignment mask
  xfs: fix and streamline error handling in xfs_end_io
  xfs: only reclaim unwritten COW extents periodically
  xfs: tune down agno asserts in the bmap code
  xfs: Use xfs_icluster_size_fsb() to calculate inode chunk alignment
  xfs: don't reserve blocks for right shift transactions
  xfs: fix uninitialized variable in _reflink_convert_cow
  xfs: split indlen reservations fairly when under reserved
  xfs: handle indlen shortage on delalloc extent merge
  xfs: don't fail xfs_extent_busy allocation
  xfs: reject all unaligned direct writes to reflinked files
  xfs: update ctime and mtime on clone destinatation inodes
  xfs: reset b_first_retry_time when clear the retry status of xfs_buf_t
  xfs: mark speculative prealloc CoW fork extents unwritten
  xfs: allow unwritten extents in the CoW fork
  xfs: verify free block header fields
  xfs: check for obviously bad level values in the bmbt root
  xfs: filter out obviously bad btree pointers
  xfs: fail _dir_open when readahead fails
  xfs: fix toctou race when locking an inode to access the data map
  xfs: fix eofblocks race with file extending async dio writes
  xfs: sync eofblocks scans under iolock are livelock prone
  xfs: pull up iolock from xfs_free_eofblocks()
  xfs: use per-AG reservations for the finobt
  xfs: only update mount/resv fields on success in __xfs_ag_resv_init
  xen/setup: Don't relocate p2m over existing one
  libceph: force GFP_NOIO for socket allocations
  ANDROID: sdcardfs: update module info
  ANDROID: sdcardfs: use d_splice_alias
  ANDROID: sdcardfs: add read_iter/write_iter opeations
  ANDROID: sdcardfs: fix ->llseek to update upper and lower offset
  ANDROID: sdcardfs: copy lower inode attributes in ->ioctl
  ANDROID: sdcardfs: remove unnecessary call to do_munmap
  android: base-cfg: enable CONFIG_INET_DIAG_DESTROY
  ANDROID: android-base.cfg: add CONFIG_MODULES option
  ANDROID: android-base.cfg: add CONFIG_IKCONFIG option
  ANDROID: android-base.cfg: properly sort the file
  ANDROID: binder: add hwbinder,vndbinder to BINDER_DEVICES.
  ANDROID: android-recommended.cfg: CONFIG_CPU_SW_DOMAIN_PAN=y
  ANDROID: fix up missing android-base.cfg option
  ANDROID: remove base config rule for UID_CPUTIME
  config: disable CONFIG_USELIB and CONFIG_FHANDLE

Change-Id: I66f8705e6738dd6b6f5057ab1ba3734490a8cd69
Signed-off-by: Kyle Yan <kyan@codeaurora.org>

Kyle Yan   commited 2017-04-08 05:02:24 -07:00
1450d4db82
This is the 4.9.21 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAljokdQACgkQONu9yGCS
 aT4NrQ/+N8CddWxuvSqzOqlEn7iUlTQyyWL0SK/4/PKx8dGn/a1vO8utLmRALo5I
 HN/FlZ/zLv2tYXNCmyPMAFPxhe8blTxplWdxx+JorQy3pMHzOmWa0zmpgmY58HuJ
 IheADTH/3VEp3aZzuHzqkjnMMdyCLj0qJPZyhkMKMj/TBzukiJ/MVTsuWOfQZZGc
 SVJ4C7I2NOTZvgomfeizoe4CU2qEDch3qVpKUnAIPeS4vFsd+hmxIiXkZGgnRLqc
 90dg1DiziKaojK/zATY36luTlTiGeyfkChuL1M6wUeSfZGzVtTmRf5xXiMEildQM
 9YujX7KCnY/DpLGIStPlaqurzMW7NZI1hwoGaRuxw0ANUyxPwVIwMwJnrByDaVKN
 NY2qxITnfvRp8YjtrIhmzbueiKzWqaT6QpG78TfcHw1SrJGI0D+JlmzwOVBcrB9V
 X/UFeagT5XqTh3DIVL6lTnTbz/NULR0kBPkuJEQCCs3rt2NUsZSuQAgXRP1RDRLF
 SIIYyg4gCOhZ6LSZMQKnUb18ldzzIWrx0Lyh9Lcz64U6Q5hgqyb5ngixZgItqWje
 wWV+k7sZ6XMa+PMkda+tEUJrkxjRSaHMu97ot6Laww3PudJRlyfjAHGFtlgE+hev
 SQAafDXrYLUVULhoftiAn3tm9MTYKeWWDKp5oeEy3Zm9DzQS9jQ=
 =pfbp
 -----END PGP SIGNATURE-----

Merge 4.9.21 into android-4.9

Changes in 4.9.21:
	libceph: force GFP_NOIO for socket allocations
	xen/setup: Don't relocate p2m over existing one
	xfs: only update mount/resv fields on success in __xfs_ag_resv_init
	xfs: use per-AG reservations for the finobt
	xfs: pull up iolock from xfs_free_eofblocks()
	xfs: sync eofblocks scans under iolock are livelock prone
	xfs: fix eofblocks race with file extending async dio writes
	xfs: fix toctou race when locking an inode to access the data map
	xfs: fail _dir_open when readahead fails
	xfs: filter out obviously bad btree pointers
	xfs: check for obviously bad level values in the bmbt root
	xfs: verify free block header fields
	xfs: allow unwritten extents in the CoW fork
	xfs: mark speculative prealloc CoW fork extents unwritten
	xfs: reset b_first_retry_time when clear the retry status of xfs_buf_t
	xfs: update ctime and mtime on clone destinatation inodes
	xfs: reject all unaligned direct writes to reflinked files
	xfs: don't fail xfs_extent_busy allocation
	xfs: handle indlen shortage on delalloc extent merge
	xfs: split indlen reservations fairly when under reserved
	xfs: fix uninitialized variable in _reflink_convert_cow
	xfs: don't reserve blocks for right shift transactions
	xfs: Use xfs_icluster_size_fsb() to calculate inode chunk alignment
	xfs: tune down agno asserts in the bmap code
	xfs: only reclaim unwritten COW extents periodically
	xfs: fix and streamline error handling in xfs_end_io
	xfs: Use xfs_icluster_size_fsb() to calculate inode alignment mask
	xfs: use iomap new flag for newly allocated delalloc blocks
	xfs: try any AG when allocating the first btree block when reflinking
	scsi: sg: check length passed to SG_NEXT_CMD_LEN
	scsi: libsas: fix ata xfer length
	scsi: scsi_dh_alua: Check scsi_device_get() return value
	scsi: scsi_dh_alua: Ensure that alua_activate() calls the completion function
	PCI: iproc: Save host bridge window resource in struct iproc_pcie
	ALSA: seq: Fix race during FIFO resize
	ALSA: hda - fix a problem for lineout on a Dell AIO machine
	ASoC: atmel-classd: fix audio clock rate
	ASoC: Intel: Skylake: fix invalid memory access due to wrong reference of pointer
	HID: wacom: Don't add ghost interface as shared data
	mmc: sdhci: Disable runtime pm when the sdio_irq is enabled
	mmc: sdhci-of-at91: fix MMC_DDR_52 timing selection
	NFSv4.1 fix infinite loop on IO BAD_STATEID error
	nfsd: map the ENOKEY to nfserr_perm for avoiding warning
	parisc: Clean up fixup routines for get_user()/put_user()
	parisc: Avoid stalled CPU warnings after system shutdown
	parisc: Fix access fault handling in pa_memcpy()
	ACPI: Fix incompatibility with mcount-based function graph tracing
	ACPI: Do not create a platform_device for IOAPIC/IOxAPIC
	tty/serial: atmel: fix race condition (TX+DMA)
	tty/serial: atmel: fix TX path in atmel_console_write()
	USB: fix linked-list corruption in rh_call_control()
	serial: mxs-auart: Fix baudrate calculation
	KVM: x86: clear bus pointer when destroyed
	KVM: kvm_io_bus_unregister_dev() should never fail
	drm/radeon: Override fpfn for all VRAM placements in radeon_evict_flags
	drm/vc4: Allocate the right amount of space for boot-time CRTC state.
	drm/etnaviv: (re-)protect fence allocation with GPU mutex
	x86/mm/KASLR: Exclude EFI region from KASLR VA space randomization
	x86/mce: Fix copy/paste error in exception table entries
	lib/syscall: Clear return values when no stack
	mm: rmap: fix huge file mmap accounting in the memcg stats
	mm, hugetlb: use pte_present() instead of pmd_present() in follow_huge_pmd()
	ARM: BCM5301X: Add back handler ignoring external imprecise aborts
	qla2xxx: Allow vref count to timeout on vport delete.
	ARM: dts: BCM5301X: Correct GIC_PPI interrupt flags
	MIPS: Lantiq: Fix cascaded IRQ setup
	mm: workingset: fix premature shadow node shrinking with cgroups
	blk: improve order of bio handling in generic_make_request()
	blk: Ensure users for current->bio_list can see the full list.
	padata: avoid race in reordering
	nvme/core: Fix race kicking freed request_queue
	nvme/pci: Disable on removal when disconnected
	Linux 4.9.21

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>

Greg Kroah-Hartman   commited 2017-04-08 09:38:27 +02:00
68565811fe
padata: avoid race in reordering
commit de5540d088fe97ad583cc7d396586437b32149a5 upstream.

Under extremely heavy uses of padata, crashes occur, and with list
debugging turned on, this happens instead:

[87487.298728] WARNING: CPU: 1 PID: 882 at lib/list_debug.c:33
__list_add+0xae/0x130
[87487.301868] list_add corruption. prev->next should be next
(ffffb17abfc043d0), but was ffff8dba70872c80. (prev=ffff8dba70872b00).
[87487.339011]  [<ffffffff9a53d075>] dump_stack+0x68/0xa3
[87487.342198]  [<ffffffff99e119a1>] ? console_unlock+0x281/0x6d0
[87487.345364]  [<ffffffff99d6b91f>] __warn+0xff/0x140
[87487.348513]  [<ffffffff99d6b9aa>] warn_slowpath_fmt+0x4a/0x50
[87487.351659]  [<ffffffff9a58b5de>] __list_add+0xae/0x130
[87487.354772]  [<ffffffff9add5094>] ? _raw_spin_lock+0x64/0x70
[87487.357915]  [<ffffffff99eefd66>] padata_reorder+0x1e6/0x420
[87487.361084]  [<ffffffff99ef0055>] padata_do_serial+0xa5/0x120

padata_reorder calls list_add_tail with the list to which its adding
locked, which seems correct:

spin_lock(&squeue->serial.lock);
list_add_tail(&padata->list, &squeue->serial.list);
spin_unlock(&squeue->serial.lock);

This therefore leaves only place where such inconsistency could occur:
if padata->list is added at the same time on two different threads.
This pdata pointer comes from the function call to
padata_get_next(pd), which has in it the following block:

next_queue = per_cpu_ptr(pd->pqueue, cpu);
padata = NULL;
reorder = &next_queue->reorder;
if (!list_empty(&reorder->list)) {
       padata = list_entry(reorder->list.next,
                           struct padata_priv, list);
       spin_lock(&reorder->lock);
       list_del_init(&padata->list);
       atomic_dec(&pd->reorder_objects);
       spin_unlock(&reorder->lock);

       pd->processed++;

       goto out;
}
out:
return padata;

I strongly suspect that the problem here is that two threads can race
on reorder list. Even though the deletion is locked, call to
list_entry is not locked, which means it's feasible that two threads
pick up the same padata object and subsequently call list_add_tail on
them at the same time. The fix is thus be hoist that lock outside of
that block.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Jason A. Donenfeld   authored and   Greg Kroah-Hartman   commited 2017-04-08 09:30:36 +02:00
eb8c62a384
Merge "trace: ipc_logging: Avoid buffer overflow in ipc_log_string()" into msm-4.9
Linux Build Service Account   authored and   Gerrit - the friendly Code Review server   commited 2017-04-06 11:55:03 -07:00
9453ed4d18
cpu-hotplug: Always use real time scheduling when hotplugging a CPU
CPU hotplug operations take place in preemptible context. This leaves
the hotplugging thread at the mercy of overall system load and CPU
availability. If the hotplugging thread does not get an opportunity
to execute after it has already begun a hotplug operation, CPUs can
end up being stuck in a quasi online state. In the worst case a CPU
can be stuck in a state where the migration thread is parked while
another task is executing and changing affinity in a loop. This
combination can result in unbounded execution time for the running
task until the hotplugging thread gets the chance to run to complete
the hotplug operation.

Fix the said problem by ensuring that hotplug can only occur from
threads belonging to the RT sched class. This allows the hotplugging
thread priority on the CPU no matter what the system load or the
number of available CPUs are. If a SCHED_NORMAL task attempts to
hotplug a CPU, we temporarily elevate it's scheduling policy to RT.
Furthermore, we disallow hotplugging operations to begin if the
calling task belongs to the idle and deadline classes or those that
use the SCHED_BATCH policy.

Change-Id: Idbb1384626e6ddff46c0d2ce752eee68396c78af
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>

Syed Rameez Mustafa   commited 2017-04-06 11:46:26 -07:00
b3058808f3
perf/core: Compile out perf_cpu_hp_init when CONFIG_HOTPLUG is not set
Fix the compliation error when CONFIG_HOTPLUG is not defined.

Change-Id: I0df48971429932f68181d615cabe16d68892ded2
Signed-off-by: Runmin Wang <runminw@codeaurora.org>

Runmin Wang   commited 2017-04-06 11:40:15 -07:00
b23f6d0662
perf: Add support for exclude_idle attribute
Enable the perf exclude_idle event attribute to avoid waking
possilby sleeping CPUS. The counter values are updated when CPU
enters idle. If the CPU is idle when perf reads the current
event value (of an exclude idle event) then the value from
when the CPU went idle is returned.
This commit supercedes the commits below. The context for the
commits below changed too much to enable cherry-picking.
commit 573979dee2a7 ("perf: Add support for exclude_idle attribute")
commit 54f6e4ae87be ("perf: Enable updating exclude_idle events
at idle")
commit 960dbb1751f3 ("perf: Skip permission checks on kernel owned
perf events")

Change-Id: Ib554c9fe106963ec1b42e72aeaf84fc73201bbb7
Signed-off-by: Patrick Fay <pfay@codeaurora.org>

Patrick Fay   commited 2017-04-05 10:47:28 -07:00
5b65b16f3b
Merge "qos: Disable irq notifier when qos request is removed" into msm-4.9
Linux Build Service Account   authored and   Gerrit - the friendly Code Review server   commited 2017-04-04 12:13:21 -07:00
9519093176
Merge "kernel/lib: add additional debug capabilities for data corruption" into msm-4.9
Linux Build Service Account   authored and   Gerrit - the friendly Code Review server   commited 2017-04-04 12:12:46 -07:00
5dae46224b
android: base-cfg: enable CONFIG_INET_DIAG_DESTROY
As of Android N, this is required to close sockets when a
network disconnects.

Change-Id: I9fe81c5fc5224c17bfd8d9e236ea9e436b5971cb
(cherry picked from commit 4a15cee4bdaf764756e98cd8f03784f330459ab1)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>

Lorenzo Colitti   authored and   Greg Kroah-Hartman   commited 2017-04-04 20:57:56 +02:00
610f179d74
ANDROID: android-base.cfg: add CONFIG_MODULES option
This adds CONFIG_MODULES, CONFIG_MODULE_UNLOAD, and CONFIG_MODVERSIONS
which are required by the O release.

Bug: 35803310
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
(cherry picked from commit 56f22e654a311f3c2492b8b3609916265fe34e20)

Greg Kroah-Hartman   commited 2017-04-04 19:59:59 +02:00
755f1ee1da
ANDROID: android-base.cfg: add CONFIG_IKCONFIG option
This adds CONFIG_IKCONFIG and CONFIG_IKCONFIG_PROC options, which are a
requirement for the O release.

Bug: 35803310
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
(cherry picked from commit 7d9280f579ff0731facb1e10f32e4a88a07f33f8)

Greg Kroah-Hartman   commited 2017-04-04 19:58:52 +02:00
286cc3d714
ANDROID: android-base.cfg: properly sort the file
It somehow got out of alphabetical order, fix it to make merges and
testing easier.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
(cherry picked from commit 21afcf6ff8c745ab9c551f113eeaacff3f41b515)

Greg Kroah-Hartman   commited 2017-04-04 19:57:45 +02:00
b27c43ca7a
trace: ipc_logging: Avoid buffer overflow in ipc_log_string()
In ipc_log_string() the return value from vsnprintf(), data_size,
is used to increment ectxt.offset. However, this length could
actually be much larger than that of ectxt.buff itself. This is a
typical mistake of [v]snprintf() usage [1], in that it returns
not the number of characters written but how many characters
*would* have been written regardless of whether it was truncated.
The result is that even though ectxt.buff itself is not overrun,
the incorrect size in ectxt.offset will be later used as the length
parameter when memcpy()'ing to the ipc_log_page's data, overflowing
that memory and beyond. The write_page's write_offset would also
indicate an out-of-bounds (greater than PAGE_SIZE) length.

The fix is simple: use vscnprintf() instead of vsnprintf().

[1] https://lwn.net/Articles/69419/

Change-Id: I2e9d44e74f5f30a009732e31a554d82e31946999
Signed-off-by: Jack Pham <jackp@codeaurora.org>

Jack Pham   commited 2017-04-04 10:19:24 -07:00
f123c9aada
perf: enable perf to continue across hotplug
Currently perf hardware, software and tracepoint events are
deleted when a cpu is hotplugged out. This change restarts
the events after hotplug. In arm_pmu.c most of the code
for handline power collapse is reused for hotplug.
This change supercedes commit 1f0f95c5fe9e ("perf: add hotplug
support so that perf continues after hotplug") and uses the
new hotplug notification method.

Change-Id: Ia9de1c150558125e2da5f2c4354c268ce4b1154a
Signed-off-by: Patrick Fay <pfay@codeaurora.org>

Patrick Fay   commited 2017-04-03 19:20:57 -07:00
b02d7648fb
Merge "sched: hmp: Reduce number of load reports in a window" into msm-4.9
Linux Build Service Account   authored and   Gerrit - the friendly Code Review server   commited 2017-04-03 18:13:33 -07:00
e15713be0b
ANDROID: binder: add hwbinder,vndbinder to BINDER_DEVICES.
These will be required going forward.

Change-Id: Idf0593461cef88051564ae0df495c156e31048c4
Signed-off-by: Martijn Coenen <maco@google.com>

Martijn Coenen   commited 2017-04-03 22:59:23 +00:00
b3bf53b117
Merge remote-tracking branch '4.9/tmp-c96f651' into msm-4.9
* 4.9/tmp-c96f651:
  Linux 4.9.20
  usb: musb: fix possible spinlock deadlock
  sched/rt: Add a missing rescheduling point
  fscrypt: remove broken support for detecting keyring key revocation
  metag/ptrace: Reject partial NT_METAG_RPIPE writes
  metag/ptrace: Provide default TXSTATUS for short NT_PRSTATUS
  metag/ptrace: Preserve previous registers for short regset write
  sparc/ptrace: Preserve previous registers for short regset write
  mips/ptrace: Preserve previous registers for short regset write
  h8300/ptrace: Fix incorrect register transfer count
  c6x/ptrace: Remove useless PTRACE_SETREGSET implementation
  pinctrl: qcom: Don't clear status bit on irq_unmask
  virtio_balloon: init 1st buffer in stats vq
  KVM: x86: cleanup the page tracking SRCU instance
  xfrm_user: validate XFRM_MSG_NEWAE incoming ESN size harder
  xfrm_user: validate XFRM_MSG_NEWAE XFRMA_REPLAY_ESN_VAL replay_window
  xfrm: policy: init locks early
  ANDROID: ARM64: Allow to choose appended kernel image
  Linux 4.9.19
  crypto: algif_hash - avoid zero-sized array
  fbcon: Fix vc attr at deinit
  drm: reference count event->completion
  nl80211: fix dumpit error path RTNL deadlocks
  drm/bridge: analogix dp: Fix runtime PM state on driver bind
  device-dax: fix pmd/pte fault fallback handling
  libceph: don't set weight to IN when OSD is destroyed
  Drivers: hv: vmbus: Don't leak memory when a channel is rescinded
  Drivers: hv: vmbus: Don't leak channel ids
  intel_th: Don't leak module refcount on failure to activate
  jbd2: don't leak memory if setting up journal fails
  auxdisplay: img-ascii-lcd: add missing sentinel entry in img_ascii_lcd_matches
  drm/amdgpu: reinstate oland workaround for sclk
  blk-mq: don't complete un-started request in timeout handler
  cgroup, net_cls: iterate the fds of only the tasks which are being migrated
  cpufreq: Restore policy min/max limits on CPU online
  arm64: kaslr: Fix up the kernel image alignment
  ARM: at91: pm: cpu_idle: switch DDR to power-down mode
  Revert "ARM: at91/dt: sama5d2: Use new compatible for ohci node"
  iommu/vt-d: Fix NULL pointer dereference in device_to_iommu
  xen/acpi: upload PM state from init-domain to Xen
  crypto: ccp - Assign DMA commands to the channel's CCP
  mwifiex: pcie: don't leak DMA buffers when removing
  clk: sunxi-ng: mp: Adjust parent rate for pre-dividers
  clk: sunxi-ng: sun6i: Fix enable bit offset for hdmi-ddc module clock
  hwrng: geode - Revert managed API changes
  hwrng: amd - Revert managed API changes
  mmc: sdhci-pci: Do not disable interrupts in sdhci_intel_set_power
  mmc: sdhci: Do not disable interrupts while waiting for clock
  mmc: sdhci-of-arasan: fix incorrect timeout clock
  mmc: sdhci-of-at91: Support external regulators
  powerpc/64s: Fix idle wakeup potential to clobber registers
  ext4: lock the xattr block before checksuming it
  ext4: mark inode dirty after converting inline directory
  parport: fix attempt to write duplicate procfiles
  iio: magnetometer: ak8974: remove incorrect __exit markups
  iio: hid-sensor-trigger: Change get poll value function order to avoid sensor properties losing after resume from S3
  iio: sw-device: Fix config group initialization
  iio: adc: ti_am335x_adc: fix fifo overrun recovery
  mmc: ushc: fix NULL-deref at probe
  uwb: hwa-rc: fix NULL-deref at probe
  uwb: i1480-dfu: fix NULL-deref at probe
  USB: usbtmc: fix probe error path
  USB: usbtmc: add missing endpoint sanity check
  usb: hub: Fix crash after failure to read BOS descriptor
  usb: musb: cppi41: don't check early-TX-interrupt for Isoch transfer
  USB: wusbcore: fix NULL-deref at probe
  USB: idmouse: fix NULL-deref at probe
  USB: lvtest: fix NULL-deref at probe
  USB: uss720: fix NULL-deref at probe
  usb-core: Add LINEAR_FRAME_INTR_BINTERVAL USB quirk
  usb: gadget: f_uvc: Fix SuperSpeed companion descriptor's wBytesPerInterval
  ACM gadget: fix endianness in notifications
  USB: serial: qcserial: add Dell DW5811e
  USB: serial: option: add Quectel UC15, UC20, EC21, and EC25 modems
  ALSA: hda - Adding a group of pin definition to fix headset problem
  ALSA: ctxfi: Fix the incorrect check of dma_set_mask() call
  ALSA: seq: Fix racy cell insertions during snd_seq_pool_done()
  Input: sur40 - validate number of endpoints before using them
  Input: kbtab - validate number of endpoints before using them
  Input: cm109 - validate number of endpoints before using them
  Input: yealink - validate number of endpoints before using them
  Input: hanwang - validate number of endpoints before using them
  Input: ims-pcu - validate number of endpoints before using them
  Input: iforce - validate number of endpoints before using them
  Input: i8042 - add noloop quirk for Dell Embedded Box PC 3000
  Input: elan_i2c - add ASUS EeeBook X205TA special touchpad fw
  Input: ALPS - fix trackstick button handling on V8 devices
  Input: ALPS - fix V8+ protocol handling (73 03 28)
  tcp: initialize icsk_ack.lrcvtime at session start time
  socket, bpf: fix sk_filter use after free in sk_clone_lock
  ipv4: provide stronger user input validation in nl_fib_input()
  net: bcmgenet: remove bcmgenet_internal_phy_setup()
  ipv6: make sure to initialize sockc.tsflags before first use
  net/mlx5e: Count LRO packets correctly
  net/mlx5e: Count GSO packets correctly
  net/mlx5: Increase number of max QPs in default profile
  net/mlx5e: Use the proper UAPI values when offloading TC vlan actions
  net/mlx5: Add missing entries for set/query rate limit commands
  net: vrf: Reset rt6i_idev in local dst after put
  qmi_wwan: add Dell DW5811e
  net: unix: properly re-increment inflight counter of GC discarded candidates
  openvswitch: Add missing case OVS_TUNNEL_KEY_ATTR_PAD
  amd-xgbe: Fix jumbo MTU processing on newer hardware
  net: properly release sk_frag.page
  net: bcmgenet: Do not suspend PHY if Wake-on-LAN is enabled
  net/openvswitch: Set the ipv6 source tunnel key address attribute correctly

Change-Id: I83a11caf9ef417ddfc78b8ed688d10d8e3c9cb1a
Signed-off-by: Kyle Yan <kyan@codeaurora.org>

Kyle Yan   commited 2017-04-03 10:20:10 -07:00
0078bd9a60
ANDROID: android-recommended.cfg: CONFIG_CPU_SW_DOMAIN_PAN=y
Bug: 31374660
Change-Id: Id2710a5fa2694da66d3f34cbcc0c2a58a006cec5
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
(cherry picked from commit d50112645714fc60c8f144710cfb595181494a8d)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>

Sami Tolvanen   authored and   Greg Kroah-Hartman   commited 2017-04-01 19:10:30 +02:00
c684441b00
ANDROID: fix up missing android-base.cfg option
This ports 6a61b529b4a92817adfb1d1393c6b914419a4555 to 4.9-common, where
the the cfg option was missed.

Cc: Jin Qian <jinqian@google.com>
Bug: 34198239
(cherry picked from commit 6a61b529b4a92817adfb1d1393c6b914419a4555)
[the config option was missed in 4.9, this syncs it back up - gregkh]
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>

Jin Qian   authored and   Greg Kroah-Hartman   commited 2017-04-01 19:02:01 +02:00
24fac41ad5
ANDROID: remove base config rule for UID_CPUTIME
There is no such option in the 4.9 kernel, so it's a bit impossible to
require to have it be set.  Because of this, it must be removed.

This is a partial revert of 611ef60db3

Cc: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>

Greg Kroah-Hartman   commited 2017-04-01 18:50:17 +02:00
d1bafe51ce
sched: hmp: Reduce number of load reports in a window
There's no use reporting load more than once in a window
via the cpufreq_update_util path (unless there's a migration).
Set the load_reported_window flag in sched_get_cpus_busy
to remove these redundant updates.

Change-Id: If43dd5abc7e0e52a8e0f0df3a20ca99ed92f5361
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>

Vikram Mulukutla   commited 2017-03-31 17:10:18 -07:00
2a6993612b
config: disable CONFIG_USELIB and CONFIG_FHANDLE
turn off the two kernel configs to disable related system ABI.

Bug: 30903194
Change-Id: I32e2ff3323135ce4b67a86f106fa9327a71fe309
Signed-off-by: Max Shi <meixuanshi@google.com>
(cherry picked from commit 2474d8bad0034d4c1143e10947c44a0d6b37dc92)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>

Max Shi   authored and   Greg Kroah-Hartman   commited 2017-03-31 17:16:02 +02:00
5efd3843a8
This is the 4.9.20 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAljeFAkACgkQONu9yGCS
 aT5MGRAAhBw+wSgkRvHRc0+kecrqGgBsNli47FNH4yRsMCNNgxbDEg8+xDDj8MBH
 lHOAFq2eXxyej5S0yZso8c1uB5Q6imILElBFZEuoxuyFQg+rQ9q8sBp726/PH0MO
 TUlg8OAOcdzLNibCbTKT/sPfBFU+d5Jb2qErEFfssUO5h/GpJhjHYJBXC5q+TBLZ
 Fx1Laajx9GyOCwriYizju/NizVlEX51jiqMpetX/nkHTJWyq8VfKnCg69kNnBzbe
 XFJ1nSsfHbckiP15jrHtsNCIq4vX+2W6WRu05+YK2irwunEADb6Ak5pF1N75LfGV
 ssP+EZU9P/i9gl8DL/8Um7OY2x7N7/Hew/qyHOCly0mo67PL4Nj+byoq/k0Oe7+m
 KaAjnHhMjJGBJLiU+Xy5cPzkJb9dxFPPTu3PqwKiUrfqIaTPUQjHv7d2z3HzSl1t
 6s6S1y65MTOiTLbcRMAdJvF//PhyQar/91KE2sszVyoPqgT1hP+aUhjD+bf52ex9
 LnwMMBcMHObm8B8z/WzStho/1bxWD9wTC7MA8JtuCg8tWrEx9cnRtHsFh9IKwbQp
 00mk9kHBaDgxDaeCe1zz9GHcicP8rsLD/0HOjJCLmiWIIel50XRQZG2DjvYSCjss
 FyFbQ3SoACzyFPUPOQSLbw5ejrSRNL3emQcGxvyXz9U4P8rGJ3I=
 =8qjI
 -----END PGP SIGNATURE-----

Merge 4.9.20 into android-4.9

Changes in 4.9.20:
	xfrm: policy: init locks early
	xfrm_user: validate XFRM_MSG_NEWAE XFRMA_REPLAY_ESN_VAL replay_window
	xfrm_user: validate XFRM_MSG_NEWAE incoming ESN size harder
	KVM: x86: cleanup the page tracking SRCU instance
	virtio_balloon: init 1st buffer in stats vq
	pinctrl: qcom: Don't clear status bit on irq_unmask
	c6x/ptrace: Remove useless PTRACE_SETREGSET implementation
	h8300/ptrace: Fix incorrect register transfer count
	mips/ptrace: Preserve previous registers for short regset write
	sparc/ptrace: Preserve previous registers for short regset write
	metag/ptrace: Preserve previous registers for short regset write
	metag/ptrace: Provide default TXSTATUS for short NT_PRSTATUS
	metag/ptrace: Reject partial NT_METAG_RPIPE writes
	fscrypt: remove broken support for detecting keyring key revocation
	sched/rt: Add a missing rescheduling point
	usb: musb: fix possible spinlock deadlock
	Linux 4.9.20

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>

Greg Kroah-Hartman   commited 2017-03-31 11:07:16 +02:00
c96f651270
sched/rt: Add a missing rescheduling point
commit 619bd4a71874a8fd78eb6ccf9f272c5e98bcc7b7 upstream.

Since the change in commit:

  fd7a4bed18 ("sched, rt: Convert switched_{from, to}_rt() / prio_changed_rt() to balance callbacks")

... we don't reschedule a task under certain circumstances:

Lets say task-A, SCHED_OTHER, is running on CPU0 (and it may run only on
CPU0) and holds a PI lock. This task is removed from the CPU because it
used up its time slice and another SCHED_OTHER task is running. Task-B on
CPU1 runs at RT priority and asks for the lock owned by task-A. This
results in a priority boost for task-A. Task-B goes to sleep until the
lock has been made available. Task-A is already runnable (but not active),
so it receives no wake up.

The reality now is that task-A gets on the CPU once the scheduler decides
to remove the current task despite the fact that a high priority task is
enqueued and waiting. This may take a long time.

The desired behaviour is that CPU0 immediately reschedules after the
priority boost which made task-A the task with the lowest priority.

Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: fd7a4bed18 ("sched, rt: Convert switched_{from, to}_rt() prio_changed_rt() to balance callbacks")
Link: http://lkml.kernel.org/r/20170124144006.29821-1-bigeasy@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Sebastian Andrzej Siewior   authored and   Greg Kroah-Hartman   commited 2017-03-31 10:31:46 +02:00
916c5cfeab
sched: cpufreq: HMP load reporting changes
Since HMP uses WALT, ensure that load is reported just once per window,
with the exception of intercluster migrations. Further, try to report load
whenever WALT stats are updated.

Change-Id: I6539f8c916f6f271cf26f03249de7f953d5b12c2
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>

Vikram Mulukutla   authored and   Rohit Gupta   commited 2017-03-29 17:20:06 -07:00
4b54aae63a
kernel/lib: add additional debug capabilities for data corruption
Data corruptions in the kernel often end up in system crashes that
are easier to debug closer to the time of detection. Specifically,
if we do not panic immediately after lock or list corruptions have been
detected, the problem context is lost in the ensuing system mayhem.
Add support for allowing system crash immediately after such corruptions
are detected. The CONFIG option controls the enabling/disabling of the
feature.

Change-Id: I9b2eb62da506a13007acff63e85e9515145909ff
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>

Syed Rameez Mustafa   authored and   Patrick Daly   commited 2017-03-29 13:02:14 -07:00
cf9c1e45e7
Merge remote-tracking branch '4.9/tmp-6bf53d4' into msm-4.9
* 4.9/tmp-6bf53d4:
  FROMLIST: net: ipv6: Add sysctl for minimum prefix len acceptable in RIOs
  Linux 4.9.18
  ext4: fix fencepost in s_first_meta_bg validation
  drm/amdgpu/si: add dpm quirk for Oland
  cgroup/pids: remove spurious suspicious RCU usage warning
  percpu: acquire pcpu_lock when updating pcpu_nr_empty_pop_pages
  gfs2: Avoid alignment hole in struct lm_lockname
  isdn/gigaset: fix NULL-deref at probe
  target: Fix VERIFY_16 handling in sbc_parse_cdb
  scsi: libiscsi: add lock around task lists to fix list corruption regression
  scsi: lpfc: Add shutdown method for kexec
  target/pscsi: Fix TYPE_TAPE + TYPE_MEDIMUM_CHANGER export
  md/raid1/10: fix potential deadlock
  powerpc/boot: Fix zImage TOC alignment
  cpufreq: Fix and clean up show_cpuinfo_cur_freq()
  NFS prevent double free in async nfs4_exchange_id
  xprtrdma: Squelch kbuild sparse complaint
  perf/core: Fix event inheritance on fork()
  perf/core: Fix use-after-free in perf_release()
  parisc: Fix system shutdown halt
  parisc: Optimize flush_kernel_vmap_range and invalidate_kernel_vmap_range
  qla2xxx: Fix request queue corruption.
  qla2xxx: Fix memory leak for abts processing
  give up on gcc ilog2() constant optimizations
  drm/vc4: Use runtime autosuspend to avoid thrashing V3D power state.
  drm/vc4: Fix termination of the initial scan for branch targets.
  ANDROID: sdcardfs: Fix style issues in macros
  ANDROID: sdcardfs: Use seq_puts over seq_printf
  ANDROID: sdcardfs: Use to kstrout
  ANDROID: sdcardfs: Use pr_[...] instead of printk
  ANDROID: sdcardfs: remove unneeded null check
  ANDROID: sdcardfs: Fix style issues with comments
  ANDROID: sdcardfs: Fix formatting
  ANDROID: sdcardfs: correct order of descriptors
  ANDROID: fix the deadlock in xt_qtaguid when enable DDEBUG

Change-Id: Iab1dd539faba7429e4cb76cc6bf9c325479b5f47
Signed-off-by: Kyle Yan <kyan@codeaurora.org>

Kyle Yan   commited 2017-03-29 05:03:45 -07:00
4891f6a567
This is the 4.9.18 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAljXoLQACgkQONu9yGCS
 aT7F0xAA18J3AhCcqlYhj7OXAgLCtgop4ftDb+tYbUEirbiU3q+M5GtkDTFiI2m/
 z/KUyCbteeYBSzUg3TlFjupbCFlBOs9uVKStDoQoqmMD2gwUmljEpzRqcXHe0vWx
 4YCqwDzizHFzS2LSwWtXDPauP3YqVvuif05x2pz9kPzmYoXSytR+YTtMDHI2sNH4
 1IlXWvJJfYiWhHxhsvQOAuNwZyDfYDNxF1gdLdcNQ8A880VA8DtdZRFypwq6loBW
 r1E3KHPHhpLLJ447rpxJ+ns7gRoCDoj5eDGtvkLTHKIY3Nkf+hfxeTEW7ZmcyJ+f
 4KvxakQnITjY3RkuKA1kU34gl+IWNMHn0a+ETOLGksUqlQUtpkaNe3Br6o2IY8JK
 UaCFCIaOCv0N3t1sCxkisWiLq1y/nSff+dJ2biD4cue9rZZZEi5B0BgrikVx5Ft9
 jvZEO6S8fQUOHLRgb3+ubWQpF8h5ETEXyIsAzg2lcmx5+/c+ql63026fibOamjAQ
 r3ZYI60Uin/SDfDyZ7rxuthgZQnLLJ3xBunja3ccBKscoiffDlF/fFFgNDpKoFu0
 CcqGbiuGi0veocXnTSFj9sehocli8Aor7cbNmTWvkXpZzcd9kyzEl2gW05CGaK2I
 CEcQWde4cRmKrONNSIfyQngeaC84OoyRGECoIcRCvzbkfxRrVSI=
 =s1Fv
 -----END PGP SIGNATURE-----

Merge 4.9.18 into android-4.9

Changes in 4.9.18:
	drm/vc4: Fix termination of the initial scan for branch targets.
	drm/vc4: Use runtime autosuspend to avoid thrashing V3D power state.
	give up on gcc ilog2() constant optimizations
	qla2xxx: Fix memory leak for abts processing
	qla2xxx: Fix request queue corruption.
	parisc: Optimize flush_kernel_vmap_range and invalidate_kernel_vmap_range
	parisc: Fix system shutdown halt
	perf/core: Fix use-after-free in perf_release()
	perf/core: Fix event inheritance on fork()
	xprtrdma: Squelch kbuild sparse complaint
	NFS prevent double free in async nfs4_exchange_id
	cpufreq: Fix and clean up show_cpuinfo_cur_freq()
	powerpc/boot: Fix zImage TOC alignment
	md/raid1/10: fix potential deadlock
	target/pscsi: Fix TYPE_TAPE + TYPE_MEDIMUM_CHANGER export
	scsi: lpfc: Add shutdown method for kexec
	scsi: libiscsi: add lock around task lists to fix list corruption regression
	target: Fix VERIFY_16 handling in sbc_parse_cdb
	isdn/gigaset: fix NULL-deref at probe
	gfs2: Avoid alignment hole in struct lm_lockname
	percpu: acquire pcpu_lock when updating pcpu_nr_empty_pop_pages
	cgroup/pids: remove spurious suspicious RCU usage warning
	drm/amdgpu/si: add dpm quirk for Oland
	ext4: fix fencepost in s_first_meta_bg validation
	Linux 4.9.18

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>

Greg Kroah-Hartman   commited 2017-03-29 13:56:47 +02:00
6bf53d4143
Merge "Merge remote-tracking branch '4.9/tmp-82ab074' into 4.9" into msm-4.9
Channagoud Kadabi   authored and   Gerrit - the friendly Code Review server   commited 2017-03-28 10:59:22 -07:00
577379aa74
Merge "sched/core_ctl: Fix state_lock spinlock contention" into msm-4.9
Kyle Yan   authored and   Gerrit - the friendly Code Review server   commited 2017-03-28 04:00:23 -07:00
20e0464bf0
Merge remote-tracking branch '4.9/tmp-82ab074' into 4.9
* 4.9/tmp-82ab074:
  Linux 4.9.17
  crypto: powerpc - Fix initialisation of crc32c context
  locking/rwsem: Fix down_write_killable() for CONFIG_RWSEM_GENERIC_SPINLOCK=y
  futex: Add missing error handling to FUTEX_REQUEUE_PI
  futex: Fix potential use-after-free in FUTEX_REQUEUE_PI
  x86/perf: Fix CR4.PCE propagation to use active_mm instead of mm
  x86/kasan: Fix boot with KASAN=y and PROFILE_ANNOTATED_BRANCHES=y
  x86/tsc: Fix ART for TSC_KNOWN_FREQ
  irqchip/gicv3-its: Add workaround for QDF2400 ITS erratum 0065
  arm64: KVM: VHE: Clear HCR_TGE when invalidating guest TLBs
  drm/vc4: Fix ->clock_select setting for the VEC encoder
  drm/vc4: Fix race between page flip completion event and clean-up
  clk: bcm2835: Fix ->fixed_divider of pllh_aux
  powerpc/mm: Fix build break when CMA=n && SPAPR_TCE_IOMMU=y
  usb: gadget: udc: atmel: remove memory leak
  serial: 8250_pci: Detach low-level driver during PCI error recovery
  ACPI / blacklist: Make Dell Latitude 3350 ethernet work
  ACPI / blacklist: add _REV quirks for Dell Precision 5520 and 3520
  slub: move synchronize_sched out of slab_mutex on shrink
  uvcvideo: uvc_scan_fallback() for webcams with broken chain
  s390/zcrypt: Introduce CEX6 toleration
  block: allow WRITE_SAME commands with the SG_IO ioctl
  drm/nouveau/disp/nv50-: specify ctrl/user separately when constructing classes
  drm/nouveau/disp/nv50-: split chid into chid.ctrl and chid.user
  drm/nouveau/disp/gp102: fix cursor/overlay immediate channel indices
  vfio/spapr: Postpone default window creation
  vfio/spapr: Add a helper to create default DMA window
  powerpc/mm/iommu, vfio/spapr: Put pages on VFIO container shutdown
  vfio/spapr: Reference mm in tce_container
  powerpc/iommu: Stop using @current in mm_iommu_xxx
  powerpc/iommu: Pass mm_struct to init/cleanup helpers
  vfio/spapr: Postpone allocation of userspace version of TCE table
  Drivers: hv: ring_buffer: count on wrap around mappings in get_next_pkt_raw() (v2)
  ibmveth: calculate gso_segs for large packets
  PCI: Do any VF BAR updates before enabling the BARs
  PCI: Ignore BAR updates on virtual functions
  PCI: Update BARs using property bits appropriate for type
  PCI: Don't update VF BARs while VF memory space is enabled
  PCI: Decouple IORESOURCE_ROM_ENABLE and PCI_ROM_ADDRESS_ENABLE
  PCI: Add comments about ROM BAR updating
  PCI: Remove pci_resource_bar() and pci_iov_resource_bar()
  PCI: Separate VF BAR updates from standard BAR updates
  x86/hyperv: Handle unknown NMIs on one CPU when unknown_nmi_panic
  scsi: ibmvscsis: Synchronize cmds at remove time
  scsi: ibmvscsis: Synchronize cmds at tpg_enable_store time
  scsi: ibmvscsis: Rearrange functions for future patches
  scsi: ibmvscsis: Clean up properly if target_submit_cmd/tmr fails
  scsi: ibmvscsis: Return correct partition name/# to client
  scsi: ibmvscsis: Issues from Dan Carpenter/Smatch
  igb: add i211 to i210 PHY workaround
  igb: Workaround for igb i210 firmware issue
  xen: do not re-use pirq number cached in pci device msi msg data
  dmaengine: iota: ioat_alloc_chan_resources should not perform sleeping allocations.
  bpf: fix mark_reg_unknown_value for spilled regs on map value marking
  bpf: fix regression on verifier pruning wrt map lookups
  bpf: fix state equivalence
  bpf: Detect identical PTR_TO_MAP_VALUE_OR_NULL registers
  dccp: fix memory leak during tear-down of unsuccessful connection request
  tun: fix premature POLLOUT notification on tun devices
  dccp/tcp: fix routing redirect race
  bridge: drop netfilter fake rtable unconditionally
  ipv6: avoid write to a possibly cloned skb
  ipv6: make ECMP route replacement less greedy
  mpls: Do not decrement alive counter for unregister events
  mpls: Send route delete notifications when router module is unloaded
  act_connmark: avoid crashing on malformed nlattrs with null parms
  uapi: fix linux/packet_diag.h userspace compilation error
  net/tunnel: set inner protocol in network gro hooks
  vrf: Fix use-after-free in vrf_xmit
  dccp: fix use-after-free in dccp_feat_activate_values
  net/sched: act_skbmod: remove unneeded rcu_read_unlock in tcf_skbmod_dump
  net: fix socket refcounting in skb_complete_tx_timestamp()
  net: fix socket refcounting in skb_complete_wifi_ack()
  tcp: fix various issues for sockets morphing to listen state
  strparser: destroy workqueue on module exit
  dccp: Unlock sock before calling sk_free()
  ipv6: orphan skbs in reassembly unit
  net: net_enable_timestamp() can be called from irq contexts
  net: don't call strlen() on the user buffer in packet_bind_spkt()
  net: bridge: allow IPv6 when multicast flood is disabled
  tcp/dccp: block BH for SYN processing
  mlxsw: spectrum_router: Avoid potential packets loss
  geneve: lock RCU on TX path
  vxlan: lock RCU on TX path
  net: phy: Avoid deadlock during phy_error()
  l2tp: avoid use-after-free caused by l2tp_ip_backlog_recv
  net sched actions: decrement module reference count after table flush.
  ipv4: mask tos for input route
  vxlan: don't allow overwrite of config src addr
  vti6: return GRE_KEY for vti6
  vxlan: correctly validate VXLAN ID against VXLAN_N_VID
  net/mlx5e: Fix wrong CQE decompression
  net/mlx5e: Do not reduce LRO WQE size when not using build_skb
  net/mlx5e: Register/unregister vport representors on interface attach/detach
  ANDROID: mmc: core: export emmc revision
  ANDROID: sdcardfs: Fix gid issue
  ANDROID: sdcardfs: Remove uninformative prints
  ANDROID: sdcardfs: move path_put outside of spinlock
  ANDROID: sdcardfs: Use case insensitive hash function
  ANDROID: sdcardfs: declare MODULE_ALIAS_FS
  ANDROID: sdcardfs: Get the blocksize from the lower fs
  ANDROID: sdcardfs: Use d_invalidate instead of drop_recurisve
  ANDROID: sdcardfs: Switch to internal case insensitive compare
  ANDROID: sdcardfs: Use spin_lock_nested
  ANDROID: sdcardfs: Replace get/put with d_lock
  ANDROID: sdcardfs: rate limit warning print
  ANDROID: sdcardfs: Fix case insensitive lookup
  ANDROID: sdcardfs: support direct-IO (DIO) operations
  ANDROID: sdcardfs: implement vm_ops->page_mkwrite
  ANDROID: sdcardfs: Don't bother deleting freelist
  ANDROID: sdcardfs: Add missing path_put
  ANDROID: sdcardfs: Fix incorrect hash
  ANDROID: export security_path_chown
  ANDROID: sdcardfs: Switch strcasecmp for internal call
  ANDROID: sdcardfs: switch to full_name_hash and qstr
  ANDROID: sdcardfs: Add GID Derivation to sdcardfs
  ANDROID: sdcardfs: Remove redundant operation
  ANDROID: sdcardfs: add support for user permission isolation
  ANDROID: sdcardfs: Refactor configfs interface
  ANDROID: sdcardfs: Allow non-owners to touch
  ANDROID: binder: add padding to binder_fd_array_object.
  ANDROID: binder: use group leader instead of open thread
  BACKPORT: mmc: core: Export device lifetime information through sysfs
  ANDROID: android-verity: do not compile as independent module

Change-Id: I7d409ec3e84eaa7f499c951d38f4cba2614415f7
Signed-off-by: Kyle Yan <kyan@codeaurora.org>

Kyle Yan   commited 2017-03-27 13:25:25 -07:00
110cce4ad4
core_ctl: Bail out early from the boost API when core_ctl is disabled
core_ctl can be completely disabled from a kernel parameter now.
Add a check to bail out early from the boost API.

Change-Id: Ib825500b0cb2c06af2cfcb82e5d79f91e9dd7b3b
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>

Pavankumar Kondeti   commited 2017-03-27 09:59:11 +05:30
d198dde643
core_ctl: Add a kernel parameter to disable core_ctl
Add a kernel parameter called "core_ctl_disable_cpumask" to
specify the CPUs for which core_ctl is not needed. As
core_ctl operates on a cluster basis, all of the CPUs in a
given cluster must be specified to disable core_ctl on that
cluster.

Change-Id: Idfdc5b3aa9f54bafe20489e5ded9d96da6eff21c
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>

Pavankumar Kondeti   commited 2017-03-27 09:59:04 +05:30
1e951a7ff0
sched/core_ctl: Fix state_lock spinlock contention
There is no need to call core_ctl_check() from scheduler tick path
on all CPUs. This results in core_ctl's state_lock spin lock
contention. Assign this job to the CPU which is responsible
for updating the ticks.

Change-Id: I9664037cc25c204d532bdd0f006c7e27ef143497
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>

Pavankumar Kondeti   commited 2017-03-27 09:54:18 +05:30
e9afb1aa77
cgroup/pids: remove spurious suspicious RCU usage warning
commit 1d18c2747f937f1b5ec65ce6bf4ccb9ca1aea9e8 upstream.

pids_can_fork() is special in that the css association is guaranteed
to be stable throughout the function and thus doesn't need RCU
protection around task_css access.  When determining the css to charge
the pid, task_css_check() is used to override the RCU sanity check.

While adding a warning message on fork rejection from pids limit,
135b8b37bd ("cgroup: Add pids controller event when fork fails
because of pid limit") incorrectly added a task_css access which is
neither RCU protected or explicitly annotated.  This triggers the
following suspicious RCU usage warning when RCU debugging is enabled.

  cgroup: fork rejected by pids controller in

  ===============================
  [ ERR: suspicious RCU usage.  ]
  4.10.0-work+ #1 Not tainted
  -------------------------------
  ./include/linux/cgroup.h:435 suspicious rcu_dereference_check() usage!

  other info that might help us debug this:

  rcu_scheduler_active = 2, debug_locks = 0
  1 lock held by bash/1748:
   #0:  (&cgroup_threadgroup_rwsem){+++++.}, at: [<ffffffff81052c96>] _do_fork+0xe6/0x6e0

  stack backtrace:
  CPU: 3 PID: 1748 Comm: bash Not tainted 4.10.0-work+ #1
  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.9.3-1.fc25 04/01/2014
  Call Trace:
   dump_stack+0x68/0x93
   lockdep_rcu_suspicious+0xd7/0x110
   pids_can_fork+0x1c7/0x1d0
   cgroup_can_fork+0x67/0xc0
   copy_process.part.58+0x1709/0x1e90
   _do_fork+0xe6/0x6e0
   SyS_clone+0x19/0x20
   do_syscall_64+0x5c/0x140
   entry_SYSCALL64_slow_path+0x25/0x25
  RIP: 0033:0x7f7853fab93a
  RSP: 002b:00007ffc12d05c90 EFLAGS: 00000246 ORIG_RAX: 0000000000000038
  RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f7853fab93a
  RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000001200011
  RBP: 00007ffc12d05cc0 R08: 0000000000000000 R09: 00007f78548db700
  R10: 00007f78548db9d0 R11: 0000000000000246 R12: 00000000000006d4
  R13: 0000000000000001 R14: 0000000000000000 R15: 000055e3ebe2c04d
  /asdf

There's no reason to dereference task_css again here when the
associated css is already available.  Fix it by replacing the
task_cgroup() call with css->cgroup.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Mike Galbraith <efault@gmx.de>
Fixes: 135b8b37bd ("cgroup: Add pids controller event when fork fails because of pid limit")
Cc: Kenny Yu <kennyyu@fb.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Tejun Heo   authored and   Greg Kroah-Hartman   commited 2017-03-26 13:05:58 +02:00
228514bf24
perf/core: Fix event inheritance on fork()
commit e7cc4865f0f31698ef2f7aac01a50e78968985b7 upstream.

While hunting for clues to a use-after-free, Oleg spotted that
perf_event_init_context() can loose an error value with the result
that fork() can succeed even though we did not fully inherit the perf
event context.

Spotted-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: oleg@redhat.com
Fixes: 889ff01506 ("perf/core: Split context's event group list into pinned and non-pinned lists")
Link: http://lkml.kernel.org/r/20170316125823.190342547@infradead.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Peter Zijlstra   authored and   Greg Kroah-Hartman   commited 2017-03-26 13:05:57 +02:00
69efd8e212
perf/core: Fix use-after-free in perf_release()
commit e552a8389aa409e257b7dcba74f67f128f979ccc upstream.

Dmitry reported syzcaller tripped a use-after-free in perf_release().

After much puzzlement Oleg spotted the below scenario:

  Task1                           Task2

  fork()
    perf_event_init_task()
    /* ... */
    goto bad_fork_$foo;
    /* ... */
    perf_event_free_task()
      mutex_lock(ctx->lock)
      perf_free_event(B)

                                  perf_event_release_kernel(A)
                                    mutex_lock(A->child_mutex)
                                    list_for_each_entry(child, ...) {
                                      /* child == B */
                                      ctx = B->ctx;
                                      get_ctx(ctx);
                                      mutex_unlock(A->child_mutex);

        mutex_lock(A->child_mutex)
        list_del_init(B->child_list)
        mutex_unlock(A->child_mutex)

        /* ... */

      mutex_unlock(ctx->lock);
      put_ctx() /* >0 */
    free_task();
                                      mutex_lock(ctx->lock);
                                      mutex_lock(A->child_mutex);
                                      /* ... */
                                      mutex_unlock(A->child_mutex);
                                      mutex_unlock(ctx->lock)
                                      put_ctx() /* 0 */
                                        ctx->task && !TOMBSTONE
                                          put_task_struct() /* UAF */

This patch closes the hole by making perf_event_free_task() destroy the
task <-> ctx relation such that perf_event_release_kernel() will no longer
observe the now dead task.

Spotted-by: Oleg Nesterov <oleg@redhat.com>
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: fweisbec@gmail.com
Cc: oleg@redhat.com
Fixes: c6e5b73242 ("perf: Synchronously clean up child events")
Link: http://lkml.kernel.org/r/20170314155949.GE32474@worktop
Link: http://lkml.kernel.org/r/20170316125823.140295131@infradead.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Peter Zijlstra   authored and   Greg Kroah-Hartman   commited 2017-03-26 13:05:57 +02:00
c04a938229
Merge "sched: Call sched_exit() when a task is exiting" into msm-4.9
Kyle Yan   authored and   Gerrit - the friendly Code Review server   commited 2017-03-25 04:00:34 -07:00
9767aee57b
Merge "trace: cpu_freq_switch: Add profiler for CPU frequency switch times" into msm-4.9
Kyle Yan   authored and   Gerrit - the friendly Code Review server   commited 2017-03-25 04:00:22 -07:00
239ad2dcc2
sched: Call sched_exit() when a task is exiting
The scheduler needs to do some book-keeping when a task exits.
Call the scheduler hook sched_exit() that takes care of all of
that necessary book-keeping.

Change-Id: I551aead70248b06f9d918e6d032075d6ecaa7fed
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>

Syed Rameez Mustafa   commited 2017-03-24 15:57:31 -07:00
d5b9f97f3c
sched: don't assume higher capacity means higher power in tick migration
When an upmigrate ineligible task running on the maximum capacity CPU,
we check if it can be migrated to a lower capacity CPU in tick path.
Add a power cost based check there to prevent the task migration
from a power efficient CPU.

Change-Id: I291c62d7dbf169d5123faba5f5246ad44a7a40dd
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>

Pavankumar Kondeti   authored and   Gerrit - the friendly Code Review server   commited 2017-03-24 10:55:25 -07:00
4fed24d120
sched: optimize cpumask operations during task placement
Compute the CPU search mask once by taking task affinity,
cpu_active_mask and cpu_isolated_mask into account and cache
it in cpu_selection_env. This prevents doing the same cpumask
operations multiple times.

Change-Id: I78f35c59e6ee9437b3a522ac7ad856c0251f81ec
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>

Pavankumar Kondeti   authored and   Gerrit - the friendly Code Review server   commited 2017-03-24 10:55:16 -07:00
52296641a3
sched: don't select an inactive/isolated CPU in sbc()
In select_best_cpu(), if no CPU is selected from the candidate
cluster, the search is expanded to the backup cluster. The
current code may select an inactive/isolated CPU in the
backup cluster. Fix this.

Change-Id: Id1e8a2b2f84ea274cdeda408957490ca05ef5fdb
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>

Pavankumar Kondeti   authored and   Gerrit - the friendly Code Review server   commited 2017-03-24 10:55:10 -07:00
068743c10e
sched: Fix load tracking bug to avoid adding phantom task demand
When update_task_ravg() is called with the TASK_UPDATE event on a task
that is not on the runqueue, task demand accounting incorrectly treats
the time delta as execution time. This can happen when a sleeping
task is moved to/from colocation groups. This phantom execution time can
cause unpredictable changes to demand that in turn can result in
incorrect task placement. Fix the issue by adding special handling of
TASK_UPDATE in task demand accounting. CPU busy time accounting already
has all the necessary checks.

Change-Id: Ibb42d83ac353bf2e849055fa3cb5c22e7acd56de
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>

Syed Rameez Mustafa   authored and   Gerrit - the friendly Code Review server   commited 2017-03-24 10:54:02 -07:00
b1bfa78b62
Merge "sched: fix bug in auto adjustment of group upmigrate/downmigrate" into msm-4.9
Kyle Yan   authored and   Gerrit - the friendly Code Review server   commited 2017-03-24 10:42:45 -07:00
82175be6ea
qos: Disable irq notifier when qos request is removed
When a qos request is added with IRQ affinity, irq notifier
for that irq is added and with out disabling the irq
notifier if the irq is free it is through a warning.
So disable irq notifier when the qos request is removed.

Change-Id: I50faa4ecbe1b632c0f0f203ca52faf18753c33d4
Signed-off-by: Srinivas Rao L <lsrao@codeaurora.org>

Srinivas Rao L   authored and   Gerrit - the friendly Code Review server   commited 2017-03-23 13:48:24 -07:00
8bcb8eac5d