~kleber-souza/ubuntu/+source/linux/+git/xenial:update-to-4.4.179

Last commit made on 2019-05-13
Get this branch:
git clone -b update-to-4.4.179 https://git.launchpad.net/~kleber-souza/ubuntu/+source/linux/+git/xenial
Only Kleber Sacilotto de Souza can upload to this branch. If you are Kleber Sacilotto de Souza please log in for upload directions.

Branch merges

Branch information

Name:
update-to-4.4.179
Repository:
lp:~kleber-souza/ubuntu/+source/linux/+git/xenial

Recent commits

bc335d4... by Greg Kroah-Hartman <email address hidden>

Linux 4.4.179

BugLink: https://bugs.launchpad.net/bugs/1828420

Signed-off-by: Kleber Sacilotto de Souza <email address hidden>

92fdf86... by Will Deacon

kernel/sysctl.c: fix out-of-bounds access when setting file-max

BugLink: https://bugs.launchpad.net/bugs/1828420

commit 9002b21465fa4d829edfc94a5a441005cffaa972 upstream.

Commit 32a5ad9c2285 ("sysctl: handle overflow for file-max") hooked up
min/max values for the file-max sysctl parameter via the .extra1 and
.extra2 fields in the corresponding struct ctl_table entry.

Unfortunately, the minimum value points at the global 'zero' variable,
which is an int. This results in a KASAN splat when accessed as a long
by proc_doulongvec_minmax on 64-bit architectures:

  | BUG: KASAN: global-out-of-bounds in __do_proc_doulongvec_minmax+0x5d8/0x6a0
  | Read of size 8 at addr ffff2000133d1c20 by task systemd/1
  |
  | CPU: 0 PID: 1 Comm: systemd Not tainted 5.1.0-rc3-00012-g40b114779944 #2
  | Hardware name: linux,dummy-virt (DT)
  | Call trace:
  | dump_backtrace+0x0/0x228
  | show_stack+0x14/0x20
  | dump_stack+0xe8/0x124
  | print_address_description+0x60/0x258
  | kasan_report+0x140/0x1a0
  | __asan_report_load8_noabort+0x18/0x20
  | __do_proc_doulongvec_minmax+0x5d8/0x6a0
  | proc_doulongvec_minmax+0x4c/0x78
  | proc_sys_call_handler.isra.19+0x144/0x1d8
  | proc_sys_write+0x34/0x58
  | __vfs_write+0x54/0xe8
  | vfs_write+0x124/0x3c0
  | ksys_write+0xbc/0x168
  | __arm64_sys_write+0x68/0x98
  | el0_svc_common+0x100/0x258
  | el0_svc_handler+0x48/0xc0
  | el0_svc+0x8/0xc
  |
  | The buggy address belongs to the variable:
  | zero+0x0/0x40
  |
  | Memory state around the buggy address:
  | ffff2000133d1b00: 00 00 00 00 00 00 00 00 fa fa fa fa 04 fa fa fa
  | ffff2000133d1b80: fa fa fa fa 04 fa fa fa fa fa fa fa 04 fa fa fa
  | >ffff2000133d1c00: fa fa fa fa 04 fa fa fa fa fa fa fa 00 00 00 00
  | ^
  | ffff2000133d1c80: fa fa fa fa 00 fa fa fa fa fa fa fa 00 00 00 00
  | ffff2000133d1d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Fix the splat by introducing a unsigned long 'zero_ul' and using that
instead.

Link: http://<email address hidden>
Fixes: 32a5ad9c2285 ("sysctl: handle overflow for file-max")
Signed-off-by: Will Deacon <email address hidden>
Acked-by: Christian Brauner <email address hidden>
Cc: Kees Cook <email address hidden>
Cc: Alexey Dobriyan <email address hidden>
Cc: Matteo Croce <email address hidden>
Signed-off-by: Andrew Morton <email address hidden>
Signed-off-by: Linus Torvalds <email address hidden>
Signed-off-by: Greg Kroah-Hartman <email address hidden>
Signed-off-by: Kleber Sacilotto de Souza <email address hidden>

84ae30d... by Greg Kroah-Hartman <email address hidden>

Revert "locking/lockdep: Add debug_locks check in __lock_downgrade()"

BugLink: https://bugs.launchpad.net/bugs/1828420

This reverts commit 4aada79c6793c59e484b69fd4ed591396e2d4b39 which was
commit 71492580571467fb7177aade19c18ce7486267f5 upstream.

Tetsuo rightly points out that the backport here is incorrect, as it
touches the __lock_set_class function instead of the intended
__lock_downgrade function.

Reported-by: Tetsuo Handa <email address hidden>
Cc: Waiman Long <email address hidden>
Cc: Peter Zijlstra (Intel) <email address hidden>
Cc: Andrew Morton <email address hidden>
Cc: Linus Torvalds <email address hidden>
Cc: Paul E. McKenney <email address hidden>
Cc: Peter Zijlstra <email address hidden>
Cc: Thomas Gleixner <email address hidden>
Cc: Will Deacon <email address hidden>
Cc: Ingo Molnar <email address hidden>
Cc: Sasha Levin <email address hidden>
Signed-off-by: Greg Kroah-Hartman <email address hidden>
Signed-off-by: Kleber Sacilotto de Souza <email address hidden>

7298006... by Takashi Iwai

ALSA: info: Fix racy addition/deletion of nodes

BugLink: https://bugs.launchpad.net/bugs/1828420

commit 8c2f870890fd28e023b0fcf49dcee333f2c8bad7 upstream.

The ALSA proc helper manages the child nodes in a linked list, but its
addition and deletion is done without any lock. This leads to a
corruption if they are operated concurrently. Usually this isn't a
problem because the proc entries are added sequentially in the driver
probe procedure itself. But the card registrations are done often
asynchronously, and the crash could be actually reproduced with
syzkaller.

This patch papers over it by protecting the link addition and deletion
with the parent's mutex. There is "access" mutex that is used for the
file access, and this can be reused for this purpose as well.

Reported-by: <email address hidden>
Cc: <email address hidden>
Signed-off-by: Takashi Iwai <email address hidden>
Signed-off-by: Greg Kroah-Hartman <email address hidden>
Signed-off-by: Kleber Sacilotto de Souza <email address hidden>

ede56a4... by Konstantin Khlebnikov <email address hidden>

mm/vmstat.c: fix /proc/vmstat format for CONFIG_DEBUG_TLBFLUSH=y CONFIG_SMP=n

BugLink: https://bugs.launchpad.net/bugs/1828420

commit e8277b3b52240ec1caad8e6df278863e4bf42eac upstream.

Commit 58bc4c34d249 ("mm/vmstat.c: skip NR_TLB_REMOTE_FLUSH* properly")
depends on skipping vmstat entries with empty name introduced in
7aaf77272358 ("mm: don't show nr_indirectly_reclaimable in
/proc/vmstat") but reverted in b29940c1abd7 ("mm: rename and change
semantics of nr_indirectly_reclaimable_bytes").

So skipping no longer works and /proc/vmstat has misformatted lines " 0".

This patch simply shows debug counters "nr_tlb_remote_*" for UP.

Link: http://lkml.kernel.org/r/155481488468.467.4295519102880913454.stgit@buzz
Fixes: 58bc4c34d249 ("mm/vmstat.c: skip NR_TLB_REMOTE_FLUSH* properly")
Signed-off-by: Konstantin Khlebnikov <email address hidden>
Acked-by: Vlastimil Babka <email address hidden>
Cc: Roman Gushchin <email address hidden>
Cc: Jann Horn <email address hidden>
Cc: <email address hidden>
Signed-off-by: Andrew Morton <email address hidden>
Signed-off-by: Linus Torvalds <email address hidden>
Signed-off-by: Greg Kroah-Hartman <email address hidden>
Signed-off-by: Kleber Sacilotto de Souza <email address hidden>

072eb85... by Jann Horn (corp account)

device_cgroup: fix RCU imbalance in error case

BugLink: https://bugs.launchpad.net/bugs/1828420

commit 0fcc4c8c044e117ac126ab6df4138ea9a67fa2a9 upstream.

When dev_exception_add() returns an error (due to a failed memory
allocation), make sure that we move the RCU preemption count back to where
it was before we were called. We dropped the RCU read lock inside the loop
body, so we can't just "break".

sparse complains about this, too:

$ make -s C=2 security/device_cgroup.o
./include/linux/rcupdate.h:647:9: warning: context imbalance in
'propagate_exception' - unexpected unlock

Fixes: d591fb56618f ("device_cgroup: simplify cgroup tree walk in propagate_exception()")
Cc: <email address hidden>
Signed-off-by: Jann Horn <email address hidden>
Acked-by: Michal Hocko <email address hidden>
Signed-off-by: Tejun Heo <email address hidden>
Signed-off-by: Greg Kroah-Hartman <email address hidden>
Signed-off-by: Kleber Sacilotto de Souza <email address hidden>

650e620... by Phil Auld <email address hidden>

sched/fair: Limit sched_cfs_period_timer() loop to avoid hard lockup

BugLink: https://bugs.launchpad.net/bugs/1828420

[ Upstream commit 2e8e19226398db8265a8e675fcc0118b9e80c9e8 ]

With extremely short cfs_period_us setting on a parent task group with a large
number of children the for loop in sched_cfs_period_timer() can run until the
watchdog fires. There is no guarantee that the call to hrtimer_forward_now()
will ever return 0. The large number of children can make
do_sched_cfs_period_timer() take longer than the period.

 NMI watchdog: Watchdog detected hard LOCKUP on cpu 24
 RIP: 0010:tg_nop+0x0/0x10
  <IRQ>
  walk_tg_tree_from+0x29/0xb0
  unthrottle_cfs_rq+0xe0/0x1a0
  distribute_cfs_runtime+0xd3/0xf0
  sched_cfs_period_timer+0xcb/0x160
  ? sched_cfs_slack_timer+0xd0/0xd0
  __hrtimer_run_queues+0xfb/0x270
  hrtimer_interrupt+0x122/0x270
  smp_apic_timer_interrupt+0x6a/0x140
  apic_timer_interrupt+0xf/0x20
  </IRQ>

To prevent this we add protection to the loop that detects when the loop has run
too many times and scales the period and quota up, proportionally, so that the timer
can complete before then next period expires. This preserves the relative runtime
quota while preventing the hard lockup.

A warning is issued reporting this state and the new values.

Signed-off-by: Phil Auld <email address hidden>
Signed-off-by: Peter Zijlstra (Intel) <email address hidden>
Cc: <email address hidden>
Cc: Anton Blanchard <email address hidden>
Cc: Ben Segall <email address hidden>
Cc: Linus Torvalds <email address hidden>
Cc: Peter Zijlstra <email address hidden>
Cc: Thomas Gleixner <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Ingo Molnar <email address hidden>
Signed-off-by: Sasha Levin <email address hidden>
Signed-off-by: Kleber Sacilotto de Souza <email address hidden>

8b12e62... by Matthias Kaehlcke <email address hidden>

Revert "kbuild: use -Oz instead of -Os when using clang"

BugLink: https://bugs.launchpad.net/bugs/1828420

commit a75bb4eb9e565b9f5115e2e8c07377ce32cbe69a upstream.

The clang option -Oz enables *aggressive* optimization for size,
which doesn't necessarily result in smaller images, but can have
negative impact on performance. Switch back to the less aggressive
-Os.

This reverts commit 6748cb3c299de1ffbe56733647b01dbcc398c419.

Suggested-by: Peter Zijlstra <email address hidden>
Signed-off-by: Matthias Kaehlcke <email address hidden>
Reviewed-by: Nick Desaulniers <email address hidden>
Signed-off-by: Masahiro Yamada <email address hidden>
Signed-off-by: Nathan Chancellor <email address hidden>
Signed-off-by: Sasha Levin <email address hidden>
Signed-off-by: Kleber Sacilotto de Souza <email address hidden>

0ccf7c0... by Felix Fietkau <email address hidden>

mac80211: do not call driver wake_tx_queue op during reconfig

BugLink: https://bugs.launchpad.net/bugs/1828420

commit 4856bfd230985e43e84c26473c91028ff0a533bd upstream.

There are several scenarios in which mac80211 can call drv_wake_tx_queue
after ieee80211_restart_hw has been called and has not yet completed.
Driver private structs are considered uninitialized until mac80211 has
uploaded the vifs, stations and keys again, so using private tx queue
data during that time is not safe.

The driver can also not rely on drv_reconfig_complete to figure out when
it is safe to accept drv_wake_tx_queue calls again, because it is only
called after all tx queues are woken again.

To fix this, bail out early in drv_wake_tx_queue if local->in_reconfig
is set.

Cc: <email address hidden>
Signed-off-by: Felix Fietkau <email address hidden>
Signed-off-by: Johannes Berg <email address hidden>
Signed-off-by: Greg Kroah-Hartman <email address hidden>
Signed-off-by: Kleber Sacilotto de Souza <email address hidden>

1e821a4... by Masami Hiramatsu <email address hidden>

kprobes: Fix error check when reusing optimized probes

BugLink: https://bugs.launchpad.net/bugs/1828420

commit 5f843ed415581cfad4ef8fefe31c138a8346ca8a upstream.

The following commit introduced a bug in one of our error paths:

  819319fc9346 ("kprobes: Return error if we fail to reuse kprobe instead of BUG_ON()")

it missed to handle the return value of kprobe_optready() as
error-value. In reality, the kprobe_optready() returns a bool
result, so "true" case must be passed instead of 0.

This causes some errors on kprobe boot-time selftests on ARM:

 [ ] Beginning kprobe tests...
 [ ] Probe ARM code
 [ ] kprobe
 [ ] kretprobe
 [ ] ARM instruction simulation
 [ ] Check decoding tables
 [ ] Run test cases
 [ ] FAIL: test_case_handler not run
 [ ] FAIL: Test andge r10, r11, r14, asr r7
 [ ] FAIL: Scenario 11
 ...
 [ ] FAIL: Scenario 7
 [ ] Total instruction simulation tests=1631, pass=1433 fail=198
 [ ] kprobe tests failed

This can happen if an optimized probe is unregistered and next
kprobe is registered on same address until the previous probe
is not reclaimed.

If this happens, a hidden aggregated probe may be kept in memory,
and no new kprobe can probe same address. Also, in that case
register_kprobe() will return "1" instead of minus error value,
which can mislead caller logic.

Signed-off-by: Masami Hiramatsu <email address hidden>
Cc: Anil S Keshavamurthy <email address hidden>
Cc: David S . Miller <email address hidden>
Cc: Linus Torvalds <email address hidden>
Cc: Naveen N . Rao <email address hidden>
Cc: Peter Zijlstra <email address hidden>
Cc: Thomas Gleixner <email address hidden>
Cc: <email address hidden> # v5.0+
Fixes: 819319fc9346 ("kprobes: Return error if we fail to reuse kprobe instead of BUG_ON()")
Link: http://lkml.kernel.org/r/155530808559.32517.539898325433642204.stgit@devnote2
Signed-off-by: Ingo Molnar <email address hidden>
Signed-off-by: Greg Kroah-Hartman <email address hidden>
Signed-off-by: Kleber Sacilotto de Souza <email address hidden>