27 May, 2019

1 commit


26 May, 2019

2 commits

  • Starting with GCC 9, -Warray-bounds detects cases when memset is called
    starting on a member of a struct but the size to be cleared ends up
    writing over further members.

    Such a call happens in the trace code to clear, at once, all members
    after and including `seq` on struct trace_iterator:

    In function 'memset',
    inlined from 'ftrace_dump' at kernel/trace/trace.c:8914:3:
    ./include/linux/string.h:344:9: warning: '__builtin_memset' offset
    [8505, 8560] from the object at 'iter' is out of the bounds of
    referenced subobject 'seq' with type 'struct trace_seq' at offset
    4368 [-Warray-bounds]
    344 | return __builtin_memset(p, c, size);
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

    In order to avoid GCC complaining about it, we compute the address
    ourselves by adding the offsetof distance instead of referring
    directly to the member.

    Since there are two places doing this clear (trace.c and trace_kdb.c),
    take the chance to move the workaround into a single place in
    the internal header.

    Link: http://lkml.kernel.org/r/20190523124535.GA12931@gmail.com

    Signed-off-by: Miguel Ojeda
    [ Removed unnecessary parenthesis around "iter" ]
    Signed-off-by: Steven Rostedt (VMware)

    Miguel Ojeda
     
  • Pull tracing fixes from Steven Rostedt:
    "Tom Zanussi sent me some small fixes and cleanups to the histogram
    code and I forgot to incorporate them.

    I also added a small clean up patch that was sent to me a while ago
    and I just noticed it"

    * tag 'trace-v5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
    kernel/trace/trace.h: Remove duplicate header of trace_seq.h
    tracing: Add a check_val() check before updating cond_snapshot() track_val
    tracing: Check keys for variable references in expressions too
    tracing: Prevent hist_field_var_ref() from accessing NULL tracing_map_elts

    Linus Torvalds
     

25 May, 2019

2 commits

  • Pule more SPDX updates from Greg KH:
    "Here is another set of reviewed patches that adds SPDX tags to
    different kernel files, based on a set of rules that are being used to
    parse the comments to try to determine that the license of the file is
    "GPL-2.0-or-later".

    Only the "obvious" versions of these matches are included here, a
    number of "non-obvious" variants of text have been found but those
    have been postponed for later review and analysis.

    These patches have been out for review on the linux-spdx@vger mailing
    list, and while they were created by automatic tools, they were
    hand-verified by a bunch of different people, all whom names are on
    the patches are reviewers"

    * tag 'spdx-5.2-rc2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (85 commits)
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 125
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 123
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 122
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 121
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 120
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 119
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 118
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 116
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 114
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 113
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 112
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 111
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 110
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 106
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 105
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 104
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 103
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 102
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 101
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 98
    ...

    Linus Torvalds
     
  • The kernel test robot has reported that the use of __this_cpu_add()
    causes bug messages like:

    BUG: using __this_cpu_add() in preemptible [00000000] code: ...

    Given the imprecise nature of the count and the possibility of resetting
    the count and doing the measurement again, this is not really a big
    problem to use the unprotected __this_cpu_*() functions.

    To make the preemption checking code happy, the this_cpu_*() functions
    will be used if CONFIG_DEBUG_PREEMPT is defined.

    The imprecise nature of the locking counts are also documented with
    the suggestion that we should run the measurement a few times with the
    counts reset in between to get a better picture of what is going on
    under the hood.

    Fixes: a8654596f0371 ("locking/rwsem: Enable lock event counting")
    Suggested-by: Linus Torvalds
    Signed-off-by: Waiman Long
    Signed-off-by: Linus Torvalds

    Waiman Long
     

24 May, 2019

2 commits

  • Based on 1 normalized pattern(s):

    this file is released under the gplv2 and any later version

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 1 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Kate Stewart
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190520170857.732920462@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public licence as published by
    the free software foundation either version 2 of the licence or at
    your option any later version

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 114 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Kate Stewart
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190520170857.552531963@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

23 May, 2019

1 commit


22 May, 2019

4 commits

  • Pull SPDX update from Greg KH:
    "Here is a series of patches that add SPDX tags to different kernel
    files, based on two different things:

    - SPDX entries are added to a bunch of files that we missed a year
    ago that do not have any license information at all.

    These were either missed because the tool saw the MODULE_LICENSE()
    tag, or some EXPORT_SYMBOL tags, and got confused and thought the
    file had a real license, or the files have been added since the
    last big sweep, or they were Makefile/Kconfig files, which we
    didn't touch last time.

    - Add GPL-2.0-only or GPL-2.0-or-later tags to files where our scan
    tools can determine the license text in the file itself. Where this
    happens, the license text is removed, in order to cut down on the
    700+ different ways we have in the kernel today, in a quest to get
    rid of all of these.

    These patches have been out for review on the linux-spdx@vger mailing
    list, and while they were created by automatic tools, they were
    hand-verified by a bunch of different people, all whom names are on
    the patches are reviewers.

    The reason for these "large" patches is if we were to continue to
    progress at the current rate of change in the kernel, adding license
    tags to individual files in different subsystems, we would be finished
    in about 10 years at the earliest.

    There will be more series of these types of patches coming over the
    next few weeks as the tools and reviewers crunch through the more
    "odd" variants of how to say "GPLv2" that developers have come up with
    over the years, combined with other fun oddities (GPL + a BSD
    disclaimer?) that are being unearthed, with the goal for the whole
    kernel to be cleaned up.

    These diffstats are not small, 3840 files are touched, over 10k lines
    removed in just 24 patches"

    * tag 'spdx-5.2-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (24 commits)
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 25
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 24
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 23
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 22
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 21
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 20
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 19
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 18
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 17
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 15
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 14
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 12
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 11
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 10
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 9
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 7
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 5
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 4
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 3
    ...

    Linus Torvalds
     
  • Without this check a snapshot is taken whenever a bucket's max is hit,
    rather than only when the global max is hit, as it should be.

    Before:

    In this example, we do a first run of the workload (cyclictest),
    examine the output, note the max ('triggering value') (347), then do
    a second run and note the max again.

    In this case, the max in the second run (39) is below the max in the
    first run, but since we haven't cleared the histogram, the first max
    is still in the histogram and is higher than any other max, so it
    should still be the max for the snapshot. It isn't however - the
    value should still be 347 after the second run.

    # echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="cyclictest"' >> /sys/kernel/debug/tracing/events/sched/sched_waking/trigger
    # echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0:onmax($wakeup_lat).save(next_prio,next_comm,prev_pid,prev_prio,prev_comm):onmax($wakeup_lat).snapshot() if next_comm=="cyclictest"' >> /sys/kernel/debug/tracing/events/sched/sched_switch/trigger

    # cyclictest -p 80 -n -s -t 2 -D 2

    # cat /sys/kernel/debug/tracing/events/sched/sched_switch/hist

    { next_pid: 2143 } hitcount: 199
    max: 44 next_prio: 120 next_comm: cyclictest
    prev_pid: 0 prev_prio: 120 prev_comm: swapper/4

    { next_pid: 2145 } hitcount: 1325
    max: 38 next_prio: 19 next_comm: cyclictest
    prev_pid: 0 prev_prio: 120 prev_comm: swapper/2

    { next_pid: 2144 } hitcount: 1982
    max: 347 next_prio: 19 next_comm: cyclictest
    prev_pid: 0 prev_prio: 120 prev_comm: swapper/6

    Snapshot taken (see tracing/snapshot). Details:
    triggering value { onmax($wakeup_lat) }: 347
    triggered by event with key: { next_pid: 2144 }

    # cyclictest -p 80 -n -s -t 2 -D 2

    # cat /sys/kernel/debug/tracing/events/sched/sched_switch/hist

    { next_pid: 2143 } hitcount: 199
    max: 44 next_prio: 120 next_comm: cyclictest
    prev_pid: 0 prev_prio: 120 prev_comm: swapper/4

    { next_pid: 2148 } hitcount: 199
    max: 16 next_prio: 120 next_comm: cyclictest
    prev_pid: 0 prev_prio: 120 prev_comm: swapper/1

    { next_pid: 2145 } hitcount: 1325
    max: 38 next_prio: 19 next_comm: cyclictest
    prev_pid: 0 prev_prio: 120 prev_comm: swapper/2

    { next_pid: 2150 } hitcount: 1326
    max: 39 next_prio: 19 next_comm: cyclictest
    prev_pid: 0 prev_prio: 120 prev_comm: swapper/4

    { next_pid: 2144 } hitcount: 1982
    max: 347 next_prio: 19 next_comm: cyclictest
    prev_pid: 0 prev_prio: 120 prev_comm: swapper/6

    { next_pid: 2149 } hitcount: 1983
    max: 130 next_prio: 19 next_comm: cyclictest
    prev_pid: 0 prev_prio: 120 prev_comm: swapper/0

    Snapshot taken (see tracing/snapshot). Details:
    triggering value { onmax($wakeup_lat) }: 39
    triggered by event with key: { next_pid: 2150 }

    After:

    In this example, we do a first run of the workload (cyclictest),
    examine the output, note the max ('triggering value') (375), then do
    a second run and note the max again.

    In this case, the max in the second run is still 375, the highest in
    any bucket, as it should be.

    # cyclictest -p 80 -n -s -t 2 -D 2

    # cat /sys/kernel/debug/tracing/events/sched/sched_switch/hist

    { next_pid: 2072 } hitcount: 200
    max: 28 next_prio: 120 next_comm: cyclictest
    prev_pid: 0 prev_prio: 120 prev_comm: swapper/5

    { next_pid: 2074 } hitcount: 1323
    max: 375 next_prio: 19 next_comm: cyclictest
    prev_pid: 0 prev_prio: 120 prev_comm: swapper/2

    { next_pid: 2073 } hitcount: 1980
    max: 153 next_prio: 19 next_comm: cyclictest
    prev_pid: 0 prev_prio: 120 prev_comm: swapper/6

    Snapshot taken (see tracing/snapshot). Details:
    triggering value { onmax($wakeup_lat) }: 375
    triggered by event with key: { next_pid: 2074 }

    # cyclictest -p 80 -n -s -t 2 -D 2

    # cat /sys/kernel/debug/tracing/events/sched/sched_switch/hist

    { next_pid: 2101 } hitcount: 199
    max: 49 next_prio: 120 next_comm: cyclictest
    prev_pid: 0 prev_prio: 120 prev_comm: swapper/6

    { next_pid: 2072 } hitcount: 200
    max: 28 next_prio: 120 next_comm: cyclictest
    prev_pid: 0 prev_prio: 120 prev_comm: swapper/5

    { next_pid: 2074 } hitcount: 1323
    max: 375 next_prio: 19 next_comm: cyclictest
    prev_pid: 0 prev_prio: 120 prev_comm: swapper/2

    { next_pid: 2103 } hitcount: 1325
    max: 74 next_prio: 19 next_comm: cyclictest
    prev_pid: 0 prev_prio: 120 prev_comm: swapper/4

    { next_pid: 2073 } hitcount: 1980
    max: 153 next_prio: 19 next_comm: cyclictest
    prev_pid: 0 prev_prio: 120 prev_comm: swapper/6

    { next_pid: 2102 } hitcount: 1981
    max: 84 next_prio: 19 next_comm: cyclictest
    prev_pid: 12 prev_prio: 120 prev_comm: kworker/0:1

    Snapshot taken (see tracing/snapshot). Details:
    triggering value { onmax($wakeup_lat) }: 375
    triggered by event with key: { next_pid: 2074 }

    Link: http://lkml.kernel.org/r/95958351329f129c07504b4d1769c47a97b70d65.1555597045.git.tom.zanussi@linux.intel.com

    Cc: stable@vger.kernel.org
    Fixes: a3785b7eca8fd ("tracing: Add hist trigger snapshot() action")
    Signed-off-by: Tom Zanussi
    Signed-off-by: Steven Rostedt (VMware)

    Tom Zanussi
     
  • There's an existing check for variable references in keys, but it
    doesn't go far enough. It checks whether a key field is a variable
    reference but doesn't check whether it's an expression containing
    variable references, which can cause the same problems for callers.

    Use the existing field_has_hist_vars() function rather than a direct
    top-level flag check to catch all possible variable references.

    Link: http://lkml.kernel.org/r/e8c3d3d53db5ca90ceea5a46e5413103a6902fc7.1555597045.git.tom.zanussi@linux.intel.com

    Cc: stable@vger.kernel.org
    Fixes: 067fe038e70f6 ("tracing: Add variable reference handling to hist triggers")
    Reported-by: Vincent Bernat
    Signed-off-by: Tom Zanussi
    Signed-off-by: Steven Rostedt (VMware)

    Tom Zanussi
     
  • hist_field_var_ref() is an implementation of hist_field_fn_t(), which
    can be called with a null tracing_map_elt elt param when assembling a
    key in event_hist_trigger().

    In the case of hist_field_var_ref() this doesn't make sense, because a
    variable can only be resolved by looking it up using an already
    assembled key i.e. a variable can't be used to assemble a key since
    the key is required in order to access the variable.

    Upper layers should prevent the user from constructing a key using a
    variable in the first place, but in case one slips through, it
    shouldn't cause a NULL pointer dereference. Also if one does slip
    through, we want to know about it, so emit a one-time warning in that
    case.

    Link: http://lkml.kernel.org/r/64ec8dc15c14d305295b64cdfcc6b2b9dd14753f.1555597045.git.tom.zanussi@linux.intel.com

    Reported-by: Vincent Bernat
    Signed-off-by: Tom Zanussi
    Signed-off-by: Steven Rostedt (VMware)

    Tom Zanussi
     

21 May, 2019

5 commits

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version this program is distributed in the
    hope that it would be useful but without any warranty without even
    the implied warranty of merchantability or fitness for a particular
    purpose see the gnu general public license for more details

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 6 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Steve Winslow
    Reviewed-by: Kate Stewart
    Reviewed-by: Jilayne Lovejoy
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190519154043.007767574@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 2 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version this program is distributed in the
    hope that it will be useful but without any warranty without even
    the implied warranty of merchantability or fitness for a particular
    purpose see the gnu general public license for more details you
    should have received a copy of the gnu general public license along
    with this program if not see http www gnu org licenses

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version this program is distributed in the
    hope that it will be useful but without any warranty without even
    the implied warranty of merchantability or fitness for a particular
    purpose see the gnu general public license for more details [based]
    [from] [clk] [highbank] [c] you should have received a copy of the
    gnu general public license along with this program if not see http
    www gnu org licenses

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 355 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Kate Stewart
    Reviewed-by: Jilayne Lovejoy
    Reviewed-by: Steve Winslow
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190519154041.837383322@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version this program is distributed in the
    hope that it will be useful but without any warranty without even
    the implied warranty of merchantability or fitness for a particular
    purpose see the gnu general public license for more details you
    should have received a copy of the gnu general public license along
    with this program if not you can access it online at http www gnu
    org licenses gpl 2 0 html

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 1 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Kate Stewart
    Reviewed-by: Jilayne Lovejoy
    Reviewed-by: Steve Winslow
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190519154041.430943677@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Add SPDX license identifiers to all Make/Kconfig files which:

    - Have no license information of any form

    These files fall under the project license, GPL v2 only. The resulting SPDX
    license identifier is:

    GPL-2.0-only

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Add SPDX license identifiers to all files which:

    - Have no license information of any form

    - Have EXPORT_.*_SYMBOL_GPL inside which was used in the
    initial scan/conversion to ignore the file

    These files fall under the project license, GPL v2 only. The resulting SPDX
    license identifier is:

    GPL-2.0-only

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

20 May, 2019

3 commits

  • Pull networking fixes from David Miller:1) Use after free in __dev_map_entry_free(), from Eric Dumazet.

    1) Use after free in __dev_map_entry_free(), from Eric Dumazet.

    2) Fix TCP retransmission timestamps on passive Fast Open, from Yuchung
    Cheng.

    3) Orphan NFC, we'll take the patches directly into my tree. From
    Johannes Berg.

    4) We can't recycle cloned TCP skbs, from Eric Dumazet.

    5) Some flow dissector bpf test fixes, from Stanislav Fomichev.

    6) Fix RCU marking and warnings in rhashtable, from Herbert Xu.

    7) Fix some potential fib6 leaks, from Eric Dumazet.

    8) Fix a _decode_session4 uninitialized memory read bug fix that got
    lost in a merge. From Florian Westphal.

    9) Fix ipv6 source address routing wrt. exception route entries, from
    Wei Wang.

    10) The netdev_xmit_more() conversion was not done %100 properly in mlx5
    driver, fix from Tariq Toukan.

    11) Clean up botched merge on netfilter kselftest, from Florian
    Westphal.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (74 commits)
    of_net: fix of_get_mac_address retval if compiled without CONFIG_OF
    net: fix kernel-doc warnings for socket.c
    net: Treat sock->sk_drops as an unsigned int when printing
    kselftests: netfilter: fix leftover net/net-next merge conflict
    mlxsw: core: Prevent reading unsupported slave address from SFP EEPROM
    mlxsw: core: Prevent QSFP module initialization for old hardware
    vsock/virtio: Initialize core virtio vsock before registering the driver
    net/mlx5e: Fix possible modify header actions memory leak
    net/mlx5e: Fix no rewrite fields with the same match
    net/mlx5e: Additional check for flow destination comparison
    net/mlx5e: Add missing ethtool driver info for representors
    net/mlx5e: Fix number of vports for ingress ACL configuration
    net/mlx5e: Fix ethtool rxfh commands when CONFIG_MLX5_EN_RXNFC is disabled
    net/mlx5e: Fix wrong xmit_more application
    net/mlx5: Fix peer pf disable hca command
    net/mlx5: E-Switch, Correct type to u16 for vport_num and int for vport_index
    net/mlx5: Add meaningful return codes to status_to_err function
    net/mlx5: Imply MLXFW in mlx5_core
    Revert "tipc: fix modprobe tipc failed after switch order of device registration"
    vsock/virtio: free packets during the socket release
    ...

    Linus Torvalds
     
  • Merge yet more updates from Andrew Morton:
    "A few final bits:

    - large changes to vmalloc, yielding large performance benefits

    - tweak the console-flush-on-panic code

    - a few fixes"

    * emailed patches from Andrew Morton :
    panic: add an option to replay all the printk message in buffer
    initramfs: don't free a non-existent initrd
    fs/writeback.c: use rcu_barrier() to wait for inflight wb switches going into workqueue when umount
    mm/compaction.c: correct zone boundary handling when isolating pages from a pageblock
    mm/vmap: add DEBUG_AUGMENT_LOWEST_MATCH_CHECK macro
    mm/vmap: add DEBUG_AUGMENT_PROPAGATE_CHECK macro
    mm/vmalloc.c: keep track of free blocks for vmap allocation

    Linus Torvalds
     
  • Pull IRQ chip updates from Ingo Molnar:
    "A late irqchips update:

    - New TI INTR/INTA set of drivers

    - Rewrite of the stm32mp1-exti driver as a platform driver

    - Update the IOMMU MSI mapping API to be RT friendly

    - A number of cleanups and other low impact fixes"

    * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (34 commits)
    iommu/dma-iommu: Remove iommu_dma_map_msi_msg()
    irqchip/gic-v3-mbi: Don't map the MSI page in mbi_compose_m{b, s}i_msg()
    irqchip/ls-scfg-msi: Don't map the MSI page in ls_scfg_msi_compose_msg()
    irqchip/gic-v3-its: Don't map the MSI page in its_irq_compose_msi_msg()
    irqchip/gicv2m: Don't map the MSI page in gicv2m_compose_msi_msg()
    iommu/dma-iommu: Split iommu_dma_map_msi_msg() in two parts
    genirq/msi: Add a new field in msi_desc to store an IOMMU cookie
    arm64: arch_k3: Enable interrupt controller drivers
    irqchip/ti-sci-inta: Add msi domain support
    soc: ti: Add MSI domain bus support for Interrupt Aggregator
    irqchip/ti-sci-inta: Add support for Interrupt Aggregator driver
    dt-bindings: irqchip: Introduce TISCI Interrupt Aggregator bindings
    irqchip/ti-sci-intr: Add support for Interrupt Router driver
    dt-bindings: irqchip: Introduce TISCI Interrupt router bindings
    gpio: thunderx: Use the default parent apis for {request,release}_resources
    genirq: Introduce irq_chip_{request,release}_resource_parent() apis
    firmware: ti_sci: Add helper apis to manage resources
    firmware: ti_sci: Add RM mapping table for am654
    firmware: ti_sci: Add support for IRQ management
    firmware: ti_sci: Add support for RM core ops
    ...

    Linus Torvalds
     

19 May, 2019

1 commit

  • Currently on panic, kernel will lower the loglevel and print out pending
    printk msg only with console_flush_on_panic().

    Add an option for users to configure the "panic_print" to replay all
    dmesg in buffer, some of which they may have never seen due to the
    loglevel setting, which will help panic debugging .

    [feng.tang@intel.com: keep the original console_flush_on_panic() inside panic()]
    Link: http://lkml.kernel.org/r/1556199137-14163-1-git-send-email-feng.tang@intel.com
    [feng.tang@intel.com: use logbuf lock to protect the console log index]
    Link: http://lkml.kernel.org/r/1556269868-22654-1-git-send-email-feng.tang@intel.com
    Link: http://lkml.kernel.org/r/1556095872-36838-1-git-send-email-feng.tang@intel.com
    Signed-off-by: Feng Tang
    Reviewed-by: Petr Mladek
    Cc: Aaro Koskinen
    Cc: Petr Mladek
    Cc: Steven Rostedt
    Cc: Sergey Senozhatsky
    Cc: Kees Cook
    Cc: Borislav Petkov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Feng Tang
     

17 May, 2019

5 commits

  • Pull cgroup fix from Tejun Heo:
    "The cgroup2 freezer pulled in this cycle broke strace. This pull
    request includes a workaround for the problem.

    It's not a complete fix in that it may cause spurious frozen state
    flip-flops which is fairly minor. Will push a full fix once it's
    ready"

    * 'for-5.2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
    signal: unconditionally leave the frozen state in ptrace_stop()

    Linus Torvalds
     
  • For iptable module to load a bpf program from a pinned location, it
    only retrieve a loaded program and cannot change the program content so
    requiring a write permission for it might not be necessary.
    Also when adding or removing an unrelated iptable rule, it might need to
    flush and reload the xt_bpf related rules as well and triggers the inode
    permission check. It might be better to remove the write premission
    check for the inode so we won't need to grant write access to all the
    processes that flush and restore iptables rules.

    Signed-off-by: Chenbo Feng
    Signed-off-by: Alexei Starovoitov

    Chenbo Feng
     
  • Pull time fixes from Ingo Molnar:
    "A TIA adjtimex interface extension, and a POSIX compliance ABI fix for
    timespec64 users"

    * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    ntp: Allow TAI-UTC offset to be set to zero
    y2038: Make CONFIG_64BIT_TIME unconditional

    Linus Torvalds
     
  • Pull locking fix from Ingo Molnar:
    "A single rwsem fix"

    * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    locking/rwsem: Prevent decrement of reader count before increment

    Linus Torvalds
     
  • Alex Xu reported a regression in strace, caused by the introduction of
    the cgroup v2 freezer. The regression can be reproduced by stracing
    the following simple program:

    #include

    int main() {
    write(1, "a", 1);
    return 0;
    }

    An attempt to run strace ./a.out leads to the infinite loop:
    [ pre-main omitted ]
    write(1, "a", 1) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
    write(1, "a", 1) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
    write(1, "a", 1) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
    write(1, "a", 1) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
    write(1, "a", 1) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
    write(1, "a", 1) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
    [ repeats forever ]

    The problem occurs because the traced task leaves ptrace_stop()
    (and the signal handling loop) with the frozen bit set. So let's
    call cgroup_leave_frozen(true) unconditionally after sleeping
    in ptrace_stop().

    With this patch applied, strace works as expected:
    [ pre-main omitted ]
    write(1, "a", 1) = 1
    exit_group(0) = ?
    +++ exited with 0 +++

    Reported-by: Alex Xu
    Fixes: 76f969e8948d ("cgroup: cgroup v2 freezer")
    Signed-off-by: Roman Gushchin
    Acked-by: Oleg Nesterov
    Cc: Tejun Heo
    Signed-off-by: Tejun Heo

    Roman Gushchin
     

16 May, 2019

2 commits

  • Daniel Borkmann says:

    ====================
    pull-request: bpf 2019-05-16

    The following pull-request contains BPF updates for your *net* tree.

    The main changes are:

    1) Fix a use after free in __dev_map_entry_free(), from Eric.

    2) Several sockmap related bug fixes: a splat in strparser if
    it was never initialized, remove duplicate ingress msg list
    purging which can race, fix msg->sg.size accounting upon
    skb to msg conversion, and last but not least fix a timeout
    bug in tcp_bpf_wait_data(), from John.

    3) Fix LRU map to avoid messing with eviction heuristics upon
    syscall lookup, e.g. map walks from user space side will
    then lead to eviction of just recently created entries on
    updates as it would mark all map entries, from Daniel.

    4) Don't bail out when libbpf feature probing fails. Also
    various smaller fixes to flow_dissector test, from Stanislav.

    5) Fix missing brackets for BTF_INT_OFFSET() in UAPI, from Gary.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Pull tracing updates from Steven Rostedt:
    "The major changes in this tracing update includes:

    - Removal of non-DYNAMIC_FTRACE from 32bit x86

    - Removal of mcount support from x86

    - Emulating a call from int3 on x86_64, fixes live kernel patching

    - Consolidated Tracing Error logs file

    Minor updates:

    - Removal of klp_check_compiler_support()

    - kdb ftrace dumping output changes

    - Accessing and creating ftrace instances from inside the kernel

    - Clean up of #define if macro

    - Introduction of TRACE_EVENT_NOP() to disable trace events based on
    config options

    And other minor fixes and clean ups"

    * tag 'trace-v5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (44 commits)
    x86: Hide the int3_emulate_call/jmp functions from UML
    livepatch: Remove klp_check_compiler_support()
    ftrace/x86: Remove mcount support
    ftrace/x86_32: Remove support for non DYNAMIC_FTRACE
    tracing: Simplify "if" macro code
    tracing: Fix documentation about disabling options using trace_options
    tracing: Replace kzalloc with kcalloc
    tracing: Fix partial reading of trace event's id file
    tracing: Allow RCU to run between postponed startup tests
    tracing: Fix white space issues in parse_pred() function
    tracing: Eliminate const char[] auto variables
    ring-buffer: Fix mispelling of Calculate
    tracing: probeevent: Fix to make the type of $comm string
    tracing: probeevent: Do not accumulate on ret variable
    tracing: uprobes: Re-enable $comm support for uprobe events
    ftrace/x86_64: Emulate call function while updating in breakpoint handler
    x86_64: Allow breakpoints to emulate call instructions
    x86_64: Add gap to int3 to allow for call emulation
    tracing: kdb: Allow ftdump to skip all but the last few entries
    tracing: Add trace_total_entries() / trace_total_entries_cpu()
    ...

    Linus Torvalds
     

15 May, 2019

12 commits

  • In preparation to enabling -Wimplicit-fallthrough, mark switch cases
    where we are expecting to fall through.

    This patch aims to suppress 3 missing-break-in-switch false positives
    on some architectures.

    Acked-by: Arnd Bergmann
    Cc: Deepa Dinamani
    Cc: Gustavo A. R. Silva
    Cc: Kees Cook
    Cc: Jann Horn
    Signed-off-by: Stephen Rothwell
    Signed-off-by: Linus Torvalds

    Stephen Rothwell
     
  • Merge more updates from Andrew Morton:

    - a couple of hotfixes

    - almost all of the rest of MM

    - lib/ updates

    - binfmt_elf updates

    - autofs updates

    - quite a lot of misc fixes and updates
    - reiserfs, fatfs
    - signals
    - exec
    - cpumask
    - rapidio
    - sysctl
    - pids
    - eventfd
    - gcov
    - panic
    - pps

    - gdb script updates

    - ipc updates

    * emailed patches from Andrew Morton : (126 commits)
    mm: memcontrol: fix NUMA round-robin reclaim at intermediate level
    mm: memcontrol: fix recursive statistics correctness & scalabilty
    mm: memcontrol: move stat/event counting functions out-of-line
    mm: memcontrol: make cgroup stats and events query API explicitly local
    drivers/virt/fsl_hypervisor.c: prevent integer overflow in ioctl
    drivers/virt/fsl_hypervisor.c: dereferencing error pointers in ioctl
    mm, memcg: rename ambiguously named memory.stat counters and functions
    arch: remove and
    treewide: replace #include with #include
    fs/block_dev.c: Remove duplicate header
    fs/cachefiles/namei.c: remove duplicate header
    include/linux/sched/signal.h: replace `tsk' with `task'
    fs/coda/psdev.c: remove duplicate header
    ipc: do cyclic id allocation for the ipc object.
    ipc: conserve sequence numbers in ipcmni_extend mode
    ipc: allow boot time extension of IPCMNI from 32k to 16M
    ipc/mqueue: optimize msg_get()
    ipc/mqueue: remove redundant wq task assignment
    ipc: prevent lockup on alloc_msg and free_msg
    scripts/gdb: print cached rate in lx-clk-summary
    ...

    Linus Torvalds
     
  • Allow specifying reboot_mode for panic only. This is needed on systems
    where ramoops is used to store panic logs, and user wants to use warm
    reset to preserve those, while still having cold reset on normal
    reboots.

    Link: http://lkml.kernel.org/r/20190322004735.27702-1-aaro.koskinen@iki.fi
    Signed-off-by: Aaro Koskinen
    Reviewed-by: Kees Cook
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Aaro Koskinen
     
  • When kernel panic happens, it will first print the panic call stack,
    then the ending msg like:

    [ 35.743249] ---[ end Kernel panic - not syncing: Fatal exception
    [ 35.749975] ------------[ cut here ]------------

    The above message are very useful for debugging.

    But if system is configured to not reboot on panic, say the
    "panic_timeout" parameter equals 0, it will likely print out many noisy
    message like WARN() call stack for each and every CPU except the panic
    one, messages like below:

    WARNING: CPU: 1 PID: 280 at kernel/sched/core.c:1198 set_task_cpu+0x183/0x190
    Call Trace:

    try_to_wake_up
    default_wake_function
    autoremove_wake_function
    __wake_up_common
    __wake_up_common_lock
    __wake_up
    wake_up_klogd_work_func
    irq_work_run_list
    irq_work_tick
    update_process_times
    tick_sched_timer
    __hrtimer_run_queues
    hrtimer_interrupt
    smp_apic_timer_interrupt
    apic_timer_interrupt

    For people working in console mode, the screen will first show the panic
    call stack, but immediately overridden by these noisy extra messages,
    which makes debugging much more difficult, as the original context gets
    lost on screen.

    Also these noisy messages will confuse some users, as I have seen many bug
    reporters posted the noisy message into bugzilla, instead of the real
    panic call stack and context.

    Adding a flag "suppress_printk" which gets set in panic() to avoid those
    noisy messages, without changing current kernel behavior that both panic
    blinking and sysrq magic key can work as is, suggested by Petr Mladek.

    To verify this, make sure kernel is not configured to reboot on panic and
    in console
    # echo c > /proc/sysrq-trigger
    to see if console only prints out the panic call stack.

    Link: http://lkml.kernel.org/r/1551430186-24169-1-git-send-email-feng.tang@intel.com
    Signed-off-by: Feng Tang
    Suggested-by: Petr Mladek
    Reviewed-by: Petr Mladek
    Acked-by: Steven Rostedt (VMware)
    Acked-by: Sergey Senozhatsky
    Cc: Thomas Gleixner
    Cc: Kees Cook
    Cc: Borislav Petkov
    Cc: Andi Kleen
    Cc: Peter Zijlstra
    Cc: Greg Kroah-Hartman
    Cc: Jiri Slaby
    Cc: Sasha Levin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Feng Tang
     
  • LLVM uses profiling data that's deliberately similar to GCC, but has a
    very different way of exporting that data. LLVM calls llvm_gcov_init()
    once per module, and provides a couple of callbacks that we can use to
    ask for more data.

    We care about the "writeout" callback, which in turn calls back into
    compiler-rt/this module to dump all the gathered coverage data to disk:

    llvm_gcda_start_file()
    llvm_gcda_emit_function()
    llvm_gcda_emit_arcs()
    llvm_gcda_emit_function()
    llvm_gcda_emit_arcs()
    [... repeats for each function ...]
    llvm_gcda_summary_info()
    llvm_gcda_end_file()

    This design is much more stateless and unstructured than gcc's, and is
    intended to run at process exit. This forces us to keep some local
    state about which module we're dealing with at the moment. On the other
    hand, it also means we don't depend as much on how LLVM represents
    profiling data internally.

    See LLVM's lib/Transforms/Instrumentation/GCOVProfiling.cpp for more
    details on how this works, particularly GCOVProfiler::emitProfileArcs(),
    GCOVProfiler::insertCounterWriteout(), and GCOVProfiler::insertFlush().

    [akpm@linux-foundation.org: coding-style fixes]
    Link: http://lkml.kernel.org/r/20190417225328.208129-1-trong@android.com
    Signed-off-by: Greg Hackmann
    Signed-off-by: Nick Desaulniers
    Signed-off-by: Tri Vo
    Co-developed-by: Nick Desaulniers
    Co-developed-by: Tri Vo
    Tested-by: Trilok Soni
    Tested-by: Prasad Sodagudi
    Tested-by: Tri Vo
    Tested-by: Daniel Mentz
    Tested-by: Petri Gynther
    Reviewed-by: Peter Oberparleiter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Greg Hackmann
     
  • Patch series "gcov: add Clang support", v4.

    This patch (of 3):

    base.c contains a few callbacks specific to GCC's gcov implementation.
    Move these into their own module in preparation for Clang support.

    Link: http://lkml.kernel.org/r/20190318025411.98014-2-trong@android.com
    Signed-off-by: Greg Hackmann
    Signed-off-by: Nick Desaulniers
    Signed-off-by: Tri Vo
    Tested-by: Trilok Soni
    Tested-by: Prasad Sodagudi
    Tested-by: Tri Vo
    Reviewed-by: Peter Oberparleiter
    Cc: Daniel Mentz
    Cc: Petri Gynther
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Greg Hackmann
     
  • Hash functions are not needed since idr is used now. Let's remove hash
    header file for cleanup.

    Link: http://lkml.kernel.org/r/20190430053319.95913-1-scuttimmy@gmail.com
    Signed-off-by: Timmy Li
    Cc: "Eric W. Biederman"
    Cc: Michal Hocko
    Cc: Matthew Wilcox
    Cc: Oleg Nesterov
    Cc: Mike Rapoport
    Cc: KJ Tsanaktsidis
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Timmy Li
     
  • Today, proc_do_large_bitmap() truncates a large write input buffer to
    PAGE_SIZE - 1, which may result in misparsed numbers at the (truncated)
    end of the buffer. Further, it fails to notify the caller that the
    buffer was truncated, so it doesn't get called iteratively to finish the
    entire input buffer.

    Tell the caller if there's more work to do by adding the skipped amount
    back to left/*lenp before returning.

    To fix the misparsing, reset the position if we have completely consumed
    a truncated buffer (or if just one char is left, which may be a "-" in a
    range), and ask the caller to come back for more.

    Link: http://lkml.kernel.org/r/20190320222831.8243-7-mcgrof@kernel.org
    Signed-off-by: Eric Sandeen
    Signed-off-by: Luis Chamberlain
    Acked-by: Kees Cook
    Cc: Eric Sandeen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Sandeen
     
  • Currently when userspace gives us a values that overflow e.g. file-max
    and other callers of __do_proc_doulongvec_minmax() we simply ignore the
    new value and leave the current value untouched.

    This can be problematic as it gives the illusion that the limit has
    indeed be bumped when in fact it failed. This commit makes sure to
    return EINVAL when an overflow is detected. Please note that this is a
    userspace facing change.

    Link: http://lkml.kernel.org/r/20190210203943.8227-4-christian@brauner.io
    Signed-off-by: Christian Brauner
    Acked-by: Luis Chamberlain
    Cc: Kees Cook
    Cc: Alexey Dobriyan
    Cc: Al Viro
    Cc: Dominik Brodowski
    Cc: "Eric W. Biederman"
    Cc: Joe Lawrence
    Cc: Waiman Long
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christian Brauner
     
  • Switch to bitmap_zalloc() to show clearly what we are allocating.
    Besides that it returns pointer of bitmap type instead of opaque void *.

    Link: http://lkml.kernel.org/r/20190304094037.57756-1-andriy.shevchenko@linux.intel.com
    Signed-off-by: Andy Shevchenko
    Acked-by: Kees Cook
    Reviewed-by: Andrew Morton
    Cc: Luis Chamberlain
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • There is a plan to build the kernel with -Wimplicit-fallthrough and this
    place in the code produced a warning (W=1).

    This commit remove the following warning:

    kernel/signal.c:795:13: warning: this statement may fall through [-Wimplicit-fallthrough=]

    Link: http://lkml.kernel.org/r/20190114203505.17875-1-malat@debian.org
    Signed-off-by: Mathieu Malaterre
    Acked-by: Gustavo A. R. Silva
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mathieu Malaterre
     
  • The out_unlock label is misleading; no unlocking happens after it, so
    just return NULL directly.

    Also, nothing between the kmem_cache_zalloc() that creates new and the
    two key_put() can initialize new->uid_keyring or new->session_keyring,
    so those calls are no-ops.

    Link: http://lkml.kernel.org/r/20190424200404.9114-1-linux@rasmusvillemoes.dk
    Signed-off-by: Rasmus Villemoes
    Reviewed-by: Andrew Morton
    Cc: "Peter Zijlstra (Intel)"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes