11 Feb, 2019

2 commits

  • Cc: stable@vger.kernel.org # v4.18+
    Signed-off-by: Bob Tracy
    Signed-off-by: Matt Turner

    Bob Tracy
     
  • Pull perf fixes from Ingo Molnar:
    "A couple of kernel side fixes:

    - Fix the Intel uncore driver on certain hardware configurations

    - Fix a CPU hotplug related memory allocation bug

    - Remove a spurious WARN()

    ... plus also a handful of perf tooling fixes"

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    perf script python: Add Python3 support to tests/attr.py
    perf trace: Support multiple "vfs_getname" probes
    perf symbols: Filter out hidden symbols from labels
    perf symbols: Add fallback definitions for GELF_ST_VISIBILITY()
    tools headers uapi: Sync linux/in.h copy from the kernel sources
    perf clang: Do not use 'return std::move(something)'
    perf mem/c2c: Fix perf_mem_events to support powerpc
    perf tests evsel-tp-sched: Fix bitwise operator
    perf/core: Don't WARN() for impossible ring-buffer sizes
    perf/x86/intel: Delay memory deallocation until x86_pmu_dead_cpu()
    perf/x86/intel/uncore: Add Node ID mask

    Linus Torvalds
     

09 Feb, 2019

3 commits

  • Pull networking fixes from David Miller:
    "This pull request is dedicated to the upcoming snowpocalypse parts 2
    and 3 in the Pacific Northwest:

    1) Drop profiles are broken because some drivers use dev_kfree_skb*
    instead of dev_consume_skb*, from Yang Wei.

    2) Fix IWLWIFI kconfig deps, from Luca Coelho.

    3) Fix percpu maps updating in bpftool, from Paolo Abeni.

    4) Missing station release in batman-adv, from Felix Fietkau.

    5) Fix some networking compat ioctl bugs, from Johannes Berg.

    6) ucc_geth must reset the BQL queue state when stopping the device,
    from Mathias Thore.

    7) Several XDP bug fixes in virtio_net from Toshiaki Makita.

    8) TSO packets must be sent always on queue 0 in stmmac, from Jose
    Abreu.

    9) Fix socket refcounting bug in RDS, from Eric Dumazet.

    10) Handle sparse cpu allocations in bpf selftests, from Martynas
    Pumputis.

    11) Make sure mgmt frames have enough tailroom in mac80211, from Felix
    Feitkau.

    12) Use safe list walking in sctp_sendmsg() asoc list traversal, from
    Greg Kroah-Hartman.

    13) Make DCCP's ccid_hc_[rt]x_parse_options always check for NULL
    ccid, from Eric Dumazet.

    14) Need to reload WoL password into bcmsysport device after deep
    sleeps, from Florian Fainelli.

    15) Remove filter from mask before freeing in cls_flower, from Petr
    Machata.

    16) Missing release and use after free in error paths of s390 qeth
    code, from Julian Wiedmann.

    17) Fix lockdep false positive in dsa code, from Marc Zyngier.

    18) Fix counting of ATU violations in mv88e6xxx, from Andrew Lunn.

    19) Fix EQ firmware assert in qed driver, from Manish Chopra.

    20) Don't default Caivum PTP to Y in kconfig, from Bjorn Helgaas"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (116 commits)
    net: dsa: b53: Fix for failure when irq is not defined in dt
    sit: check if IPv6 enabled before calling ip6_err_gen_icmpv6_unreach()
    geneve: should not call rt6_lookup() when ipv6 was disabled
    net: Don't default Cavium PTP driver to 'y'
    net: broadcom: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
    net: via-velocity: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
    net: tehuti: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
    net: sun: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
    net: fsl_ucc_hdlc: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
    net: fec_mpc52xx: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
    net: smsc: epic100: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
    net: dscc4: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
    net: tulip: de2104x: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
    net: defxx: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
    net/mlx5e: Don't overwrite pedit action when multiple pedit used
    net/mlx5e: Update hw flows when encap source mac changed
    qed*: Advance drivers version to 8.37.0.20
    qed: Change verbosity for coalescing message.
    qede: Fix system crash on configuring channels.
    qed: Consider TX tcs while deriving the max num_queues for PF.
    ...

    Linus Torvalds
     
  • Pull char/misc fixes from Greg KH:
    "Here are some small char and misc driver fixes for 5.0-rc6.

    Nothing huge here, some more binderfs fixups found as people use it,
    and there is a "large" selftest added to validate the binderfs code,
    which makes up the majority of this pull request.

    There's also some small mei and mic fixes to resolve some reported
    issues.

    All of these have been in linux-next for over a week with no reported
    issues"

    * tag 'char-misc-5.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
    mic: vop: Fix crash on remove
    mic: vop: Fix use-after-free on remove
    binderfs: remove separate device_initcall()
    fpga: stratix10-soc: fix wrong of_node_put() in init function
    mic: vop: Fix broken virtqueues
    mei: free read cb on ctrl_wr list flush
    samples: mei: use /dev/mei0 instead of /dev/mei
    mei: me: add ice lake point device id.
    binderfs: respect limit on binder control creation
    binder: fix CONFIG_ANDROID_BINDER_DEVICES
    selftests: add binderfs selftests

    Linus Torvalds
     
  • Pull staging/IIO driver fixes from Greg KH:
    "Here are some small iio and staging driver fixes for 5.0-rc6.

    Nothing big, just resolve some reported IIO driver issues, and one
    staging driver bug. One staging driver patch was added and then
    reverted as well.

    All of these have been in linux-next for a while with no reported
    issues"

    * tag 'staging-5.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
    Revert "staging: erofs: keep corrupted fs from crashing kernel in erofs_namei()"
    staging: erofs: keep corrupted fs from crashing kernel in erofs_namei()
    staging: octeon: fix broken phylib usage
    iio: ti-ads8688: Update buffer allocation for timestamps
    tools: iio: iio_generic_buffer: make num_loops signed
    iio: adc: axp288: Fix TS-pin handling
    iio: chemical: atlas-ph-sensor: correct IIO_TEMP values to millicelsius

    Linus Torvalds
     

05 Feb, 2019

4 commits

  • Support both Python 2 and Python 3 in tests/attr.py

    The use of "except as" syntax implies the minimum supported Python2 version is
    now v2.6

    Committer testing:

    $ make -C tools/perf PYTHON3=python install-bin

    Before:

    # perf test attr
    16: Setup struct perf_event_attr : FAILED!
    48: Synthesize attr update : Ok
    [root@quaco ~]# perf test -v attr
    16: Setup struct perf_event_attr :
    --- start ---
    test child forked, pid 3121
    File "/home/acme/libexec/perf-core/tests/attr.py", line 324
    except Unsup, obj:
    ^
    SyntaxError: invalid syntax
    test child finished with -1
    ---- end ----
    Setup struct perf_event_attr: FAILED!
    48: Synthesize attr update :
    --- start ---
    test child forked, pid 3124
    test child finished with 0
    ---- end ----
    Synthesize attr update: Ok
    #

    After:

    # perf test attr
    16: Setup struct perf_event_attr : Ok
    48: Synthesize attr update : Ok
    #

    Signed-off-by: Tony Jones
    Acked-by: Jiri Olsa
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Jonathan Corbet
    Cc: Ravi Bangoria
    Cc: Seeteena Thoufeek
    Link: http://lkml.kernel.org/r/20190124005229.16146-7-tonyj@suse.de
    Signed-off-by: Arnaldo Carvalho de Melo

    Tony Jones
     
  • With a suitably defined "probe:vfs_getname" probe, 'perf trace' can
    "beautify" its output, so syscalls like open() or openat() can print the
    "filename" argument instead of just its hex address, like:

    $ perf trace -e open -- touch /dev/null
    [...]
    0.590 ( 0.014 ms): touch/18063 open(filename: /dev/null, flags: CREAT|NOCTTY|NONBLOCK|WRONLY, mode: IRUGO|IWUGO) = 3
    [...]

    The output without such beautifier looks like:

    0.529 ( 0.011 ms): touch/18075 open(filename: 0xc78cf288, flags: CREAT|NOCTTY|NONBLOCK|WRONLY, mode: IRUGO|IWUGO) = 3

    However, when the vfs_getname probe expands to multiple probes and it is
    not the first one that is hit, the beautifier fails, as following:

    0.326 ( 0.010 ms): touch/18072 open(filename: , flags: CREAT|NOCTTY|NONBLOCK|WRONLY, mode: IRUGO|IWUGO) = 3

    Fix it by hooking into all the expanded probes (inlines), now, for instance:

    [root@quaco ~]# perf probe -l
    probe:vfs_getname (on getname_flags:73@fs/namei.c with pathname)
    probe:vfs_getname_1 (on getname_flags:73@fs/namei.c with pathname)
    [root@quaco ~]# perf trace -e open* sleep 1
    0.010 ( 0.005 ms): sleep/5588 openat(dfd: CWD, filename: /etc/ld.so.cache, flags: RDONLY|CLOEXEC) = 3
    0.029 ( 0.006 ms): sleep/5588 openat(dfd: CWD, filename: /lib64/libc.so.6, flags: RDONLY|CLOEXEC) = 3
    0.194 ( 0.008 ms): sleep/5588 openat(dfd: CWD, filename: /usr/lib/locale/locale-archive, flags: RDONLY|CLOEXEC) = 3
    [root@quaco ~]#

    Works, further verified with:

    [root@quaco ~]# perf test vfs
    65: Use vfs_getname probe to get syscall args filenames : Ok
    66: Add vfs_getname probe to get syscall args filenames : Ok
    67: Check open filename arg using perf trace + vfs_getname: Ok
    [root@quaco ~]#

    Reported-by: Michael Petlan
    Tested-by: Michael Petlan
    Cc: Adrian Hunter
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Link: https://lkml.kernel.org/n/tip-mv8kolk17xla1smvmp3qabv1@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • When perf is built with the annobin plugin (RHEL8 build) extra symbols
    are added to its binary:

    # nm perf | grep annobin | head -10
    0000000000241100 t .annobin_annotate.c
    0000000000326490 t .annobin_annotate.c
    0000000000249255 t .annobin_annotate.c_end
    00000000003283a8 t .annobin_annotate.c_end
    00000000001bce18 t .annobin_annotate.c_end.hot
    00000000001bce18 t .annobin_annotate.c_end.hot
    00000000001bc3e2 t .annobin_annotate.c_end.unlikely
    00000000001bc400 t .annobin_annotate.c_end.unlikely
    00000000001bce18 t .annobin_annotate.c.hot
    00000000001bce18 t .annobin_annotate.c.hot
    ...

    Those symbols have no use for report or annotation and should be
    skipped. Moreover they interfere with the DWARF unwind test on the PPC
    arch, where they are mixed with checked symbols and then the test fails:

    # perf test dwarf -v
    59: Test dwarf unwind :
    --- start ---
    test child forked, pid 8515
    unwind: .annobin_dwarf_unwind.c:ip = 0x10dba40dc (0x2740dc)
    ...
    got: .annobin_dwarf_unwind.c 0x10dba40dc, expecting test__arch_unwind_sample
    unwind: failed with 'no error'

    The annobin symbols are defined as NOTYPE/LOCAL/HIDDEN:

    # readelf -s ./perf | grep annobin | head -1
    40: 00000000001bce4f 0 NOTYPE LOCAL HIDDEN 13 .annobin_init.c

    They can still pass the check for the label symbol. Adding check for
    HIDDEN and INTERNAL (as suggested by Nick below) visibility and filter
    out such symbols.

    > Just to be awkward, if you are going to ignore STV_HIDDEN
    > symbols then you should probably also ignore STV_INTERNAL ones
    > as well... Annobin does not generate them, but you never know,
    > one day some other tool might create some.

    Signed-off-by: Jiri Olsa
    Cc: Alexander Shishkin
    Cc: Masami Hiramatsu
    Cc: Michael Petlan
    Cc: Namhyung Kim
    Cc: Nick Clifton
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20190128133526.GD15461@krava
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • Those aren't present in Alpine Linux 3.4 to edge, so provide fallback
    defines to get the next patch building there keeping the build
    bisectable.

    Cc: Adrian Hunter
    Cc: Alexander Shishkin
    Cc: Jiri Olsa
    Cc: Masami Hiramatsu
    Cc: Michael Petlan
    Cc: Namhyung Kim
    Cc: Nick Clifton
    Cc: Peter Zijlstra
    Link: https://lkml.kernel.org/n/tip-03cg3gya2ju4ba2x6ibb9fuz@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

04 Feb, 2019

7 commits

  • To get the changes in this cset:

    f275ee0fa3a0 ("IN_BADCLASS: fix macro to actually work")

    The macros changed in this cset are not used in tools/, so this is just
    to silence this perf tools build warning:

    Warning: Kernel ABI header at 'tools/include/uapi/linux/in.h' differs from latest version at 'include/uapi/linux/in.h'
    diff -u tools/include/uapi/linux/in.h include/uapi/linux/in.h

    Cc: Adrian Hunter
    Cc: David S. Miller
    Cc: Greg Kroah-Hartman
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Link: https://lkml.kernel.org/n/tip-xbk34kwamn8bw8ywpuxetct9@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • It prevents copy elision, generating this warning when building with
    fedora:rawhide's clang:

    clang version 7.0.1 (Fedora 7.0.1-2.fc30)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /usr/bin
    Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-redhat-linux/9
    Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/9
    Selected GCC installation: /usr/bin/../lib/gcc/x86_64-redhat-linux/9
    Candidate multilib: .;@m64
    Candidate multilib: 32;@m32
    Selected multilib: .;@m64

    $ make -C tools/perf CC=clang LIBCLANGLLVM=1

    util/c++/clang.cpp: In function 'std::unique_ptr > perf::getBPFObjectFromModule(llvm::Module*)':
    util/c++/clang.cpp:163:18: error: moving a local object in a return statement prevents copy elision [-Werror=pessimizing-move]
    163 | return std::move(Buffer);
    | ~~~~~~~~~^~~~~~~~
    util/c++/clang.cpp:163:18: note: remove 'std::move' call
    cc1plus: all warnings being treated as errors

    References:

    http://www.cplusplus.com/forum/general/186411/#msg908572
    https://en.cppreference.com/w/cpp/language/return#Notes
    https://en.cppreference.com/w/cpp/language/copy_elision

    Cc: Adrian Hunter
    Cc: Jiri Olsa
    Cc: Luis Cláudio Gonçalves
    Cc: Namhyung Kim
    Cc: Wang Nan
    Link: https://lkml.kernel.org/n/tip-lehqf5x5q96l0o8myhb6blz6@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • PowerPC hardware does not have a builtin latency filter (--ldlat) for
    the "mem-load" event and perf_mem_events by default includes
    "/ldlat=30/" which is causing a failure on PowerPC. Refactor the code to
    support "perf mem/c2c" on PowerPC.

    This patch depends on kernel side changes done my Madhavan:
    https://lists.ozlabs.org/pipermail/linuxppc-dev/2018-December/182596.html

    Signed-off-by: Ravi Bangoria
    Acked-by: Jiri Olsa
    Cc: Dick Fowles
    Cc: Don Zickus
    Cc: Joe Mario
    Cc: Madhavan Srinivasan
    Cc: Michael Ellerman
    Cc: Namhyung Kim
    Cc: linuxppc-dev@lists.ozlabs.org
    Link: http://lkml.kernel.org/r/20190129132412.771-1-ravi.bangoria@linux.ibm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Ravi Bangoria
     
  • Notice that the use of the bitwise OR operator '|' always leads to true
    in this particular case, which seems a bit suspicious due to the context
    in which this expression is being used.

    Fix this by using bitwise AND operator '&' instead.

    This bug was detected with the help of Coccinelle.

    Signed-off-by: Gustavo A. R. Silva
    Acked-by: Jiri Olsa
    Cc: Alexander Shishkin
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: stable@vger.kernel.org
    Fixes: 6a6cd11d4e57 ("perf test: Add test for the sched tracepoint format fields")
    Link: http://lkml.kernel.org/r/20190122233439.GA5868@embeddedor
    Signed-off-by: Arnaldo Carvalho de Melo

    Gustavo A. R. Silva
     
  • Check basic nat/redirect/masquerade for ipv4 and ipv6.

    Signed-off-by: Florian Westphal
    Signed-off-by: Pablo Neira Ayuso

    Florian Westphal
     
  • In selftests the config fragment for netfilter was added as
    NF_TABLES_INET=y and this patch correct it as CONFIG_NF_TABLES_INET=y

    Signed-off-by: Naresh Kamboju
    Acked-by: Florian Westphal
    Signed-off-by: Pablo Neira Ayuso

    Naresh Kamboju
     
  • Pull perf fixes from Thomas Gleixner:
    "A pile of perf updates:

    - Fix broken sanity check in the /proc/sys/kernel/perf_cpu_time_max_percent
    write handler

    - Cure a perf script crash which caused by an unitinialized data
    structure

    - Highlight the hottest instruction in perf top and not a random one

    - Cure yet another clang issue when building perf python

    - Handle topology entries with no CPU correctly in the tools

    - Handle perf data which contains both tracepoints and performance
    counter entries correctly.

    - Add a missing NULL pointer check in perf ordered_events_free()"

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    perf script: Fix crash when processing recorded stat data
    perf top: Fix wrong hottest instruction highlighted
    perf tools: Handle TOPOLOGY headers with no CPU
    perf python: Remove -fstack-clash-protection when building with some clang versions
    perf core: Fix perf_proc_update_handler() bug
    perf script: Fix crash with printing mixed trace point and other events
    perf ordered_events: Fix crash in ordered_events__free

    Linus Torvalds
     

03 Feb, 2019

1 commit

  • …3/iio into staging-linus

    Jonathan writes:

    First set of IIO fixes for the 5.0 cycle.

    Been a busy month, so these are rather later than they should have been.

    * atlas-ph-sensor:
    - Temperature scale didn't correspond to the ABI.
    * axp288:
    - A few different fixes around the TS-pin handling.
    * ti-ads8688
    - Not enough space in the buffer used to build the scan to allow for
    the timestamp.
    * tools - iio_generic_buffer
    - Make num_loops signed so that we really are running for ever
    rather than just a long time when we specify -1.

    * tag 'iio-fixes-5.0a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio:
    iio: ti-ads8688: Update buffer allocation for timestamps
    tools: iio: iio_generic_buffer: make num_loops signed
    iio: adc: axp288: Fix TS-pin handling
    iio: chemical: atlas-ph-sensor: correct IIO_TEMP values to millicelsius

    Greg Kroah-Hartman
     

02 Feb, 2019

2 commits

  • /proc entries under /proc/net/* can't be cached into dcache because
    setns(2) can change current net namespace.

    [akpm@linux-foundation.org: coding-style fixes]
    [akpm@linux-foundation.org: avoid vim miscolorization]
    [adobriyan@gmail.com: write test, add dummy ->d_revalidate hook: necessary if /proc/net/* is pinned at setns time]
    Link: http://lkml.kernel.org/r/20190108192350.GA12034@avx2
    Link: http://lkml.kernel.org/r/20190107162336.GA9239@avx2
    Fixes: 1da4d377f943fe4194ffb9fb9c26cc58fad4dd24 ("proc: revalidate misc dentries")
    Signed-off-by: Alexey Dobriyan
    Reported-by: Mateusz Stępień
    Reported-by: Ahmad Fatoum
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • Alexei Starovoitov says:

    ====================
    pull-request: bpf 2019-01-31

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

    The main changes are:

    1) disable preemption in sender side of socket filters, from Alexei.

    2) fix two potential deadlocks in syscall bpf lookup and prog_register,
    from Martin and Alexei.

    3) fix BTF to allow typedef on func_proto, from Yonghong.

    4) two bpftool fixes, from Jiri and Paolo.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     

01 Feb, 2019

2 commits

  • Previously, bpf_num_possible_cpus() had a bug when calculating a
    number of possible CPUs in the case of sparse CPU allocations, as
    it was considering only the first range or element of
    /sys/devices/system/cpu/possible.

    E.g. in the case of "0,2-3" (CPU 1 is not available), the function
    returned 1 instead of 3.

    This patch fixes the function by making it parse all CPU ranges and
    elements.

    Signed-off-by: Martynas Pumputis
    Acked-by: Yonghong Song
    Signed-off-by: Daniel Borkmann

    Martynas Pumputis
     
  • …/git/shuah/linux-kselftest

    Pull kselftest fixes from Shuah Khan:
    "This consists of run-time fixes to cpu-hotplug, and seccomp tests,
    compile fixes to ir, net, and timers Makefiles"

    * tag 'linux-kselftest-5.0-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
    selftests: timers: use LDLIBS instead of LDFLAGS
    selftests: net: use LDLIBS instead of LDFLAGS
    selftests/seccomp: Enhance per-arch ptrace syscall skip tests
    selftests: Use lirc.h from kernel tree, not from system
    selftests: cpu-hotplug: fix case where CPUs offline > CPUs present

    Linus Torvalds
     

30 Jan, 2019

3 commits

  • This adds the promised selftest for binderfs. It will verify the following
    things:
    - binderfs mounting works
    - binder device allocation works
    - performing a binder ioctl() request through a binderfs device works
    - binder device removal works
    - binder-control removal fails
    - binderfs unmounting works

    The tests are performed both privileged and unprivileged. The latter
    verifies that binderfs behaves correctly in user namespaces.

    Cc: Todd Kjos
    Signed-off-by: Christian Brauner
    Acked-by: Shuah Khan
    Signed-off-by: Greg Kroah-Hartman

    Christian Brauner
     
  • Fixed one test_btf raw test such that typedef func_proto
    is permitted now.

    Fixes: 78a2540e8945 ("tools/bpf: Add tests for BTF_KIND_FUNC_PROTO and BTF_KIND_FUNC")
    Acked-by: Martin KaFai Lau
    Signed-off-by: Yonghong Song
    Signed-off-by: Alexei Starovoitov

    Yonghong Song
     
  • Pull networking fixes from David Miller:

    1) Need to save away the IV across tls async operations, from Dave
    Watson.

    2) Upon successful packet processing, we should liberate the SKB with
    dev_consume_skb{_irq}(). From Yang Wei.

    3) Only apply RX hang workaround on effected macb chips, from Harini
    Katakam.

    4) Dummy netdev need a proper namespace assigned to them, from Josh
    Elsasser.

    5) Some paths of nft_compat run lockless now, and thus we need to use a
    proper refcnt_t. From Florian Westphal.

    6) Avoid deadlock in mlx5 by doing IRQ locking, from Moni Shoua.

    7) netrom does not refcount sockets properly wrt. timers, fix that by
    using the sock timer API. From Cong Wang.

    8) Fix locking of inexact inserts of xfrm policies, from Florian
    Westphal.

    9) Missing xfrm hash generation bump, also from Florian.

    10) Missing of_node_put() in hns driver, from Yonglong Liu.

    11) Fix DN_IFREQ_SIZE, from Johannes Berg.

    12) ip6mr notifier is invoked during traversal of wrong table, from Nir
    Dotan.

    13) TX promisc settings not performed correctly in qed, from Manish
    Chopra.

    14) Fix OOB access in vhost, from Jason Wang.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (52 commits)
    MAINTAINERS: Add entry for XDP (eXpress Data Path)
    net: set default network namespace in init_dummy_netdev()
    net: b44: replace dev_kfree_skb_xxx by dev_consume_skb_xxx for drop profiles
    net: caif: call dev_consume_skb_any when skb xmit done
    net: 8139cp: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
    net: macb: Apply RXUBR workaround only to versions with errata
    net: ti: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
    net: apple: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
    net: amd8111e: replace dev_kfree_skb_irq by dev_consume_skb_irq
    net: alteon: replace dev_kfree_skb_irq by dev_consume_skb_irq
    net: tls: Fix deadlock in free_resources tx
    net: tls: Save iv in tls_rec for async crypto requests
    vhost: fix OOB in get_rx_bufs()
    qed: Fix stack out of bounds bug
    qed: Fix system crash in ll2 xmit
    qed: Fix VF probe failure while FLR
    qed: Fix LACP pdu drops for VFs
    qed: Fix bug in tx promiscuous mode settings
    net: i825xx: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
    netfilter: ipt_CLUSTERIP: fix warning unused variable cn
    ...

    Linus Torvalds
     

29 Jan, 2019

1 commit

  • Prog arrays don't have 'owner_prog_type' and 'owner_jited'
    fields in their fdinfo when they are created. Those fields
    are set and reported when first program is checked for
    compatibility by bpf_prog_array_compatible().

    This means that bpftool cannot expect the fields to always
    be there. Currently trying to show maps on a system with
    an un-owned prog array leads to a crash:

    $ bpftool map show
    389: prog_array name tail_call_map flags 0x0
    Error: key 'owner_prog_type' not found in fdinfo
    Error: key 'owner_jited' not found in fdinfo
    key 4B value 4B max_entries 4 memlock 4096B
    Segmentation fault (core dumped)

    We pass a NULL pointer to atoi().

    Remove the assumption that fdinfo keys are always present.
    Add missing validations and remove the p_err() calls which
    may lead to broken JSON output as caller will not propagate
    the failure.

    Fixes: 99a44bef5870 ("tools: bpftool: add owner_prog_type and owner_jited to bpftool output")
    Signed-off-by: Jakub Kicinski
    Reviewed-by: Quentin Monnet
    Acked-by: Song Liu
    Signed-off-by: Daniel Borkmann

    Jakub Kicinski
     

28 Jan, 2019

6 commits

  • posix_timers fails to build due to undefined reference errors:

    aarch64-linaro-linux-gcc --sysroot=/build/tmp-rpb-glibc/sysroots/hikey
    -O2 -pipe -g -feliminate-unused-debug-types -O3 -Wl,-no-as-needed -Wall
    -DKTEST -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -lrt -lpthread
    posix_timers.c
    -o /build/tmp-rpb-glibc/work/hikey-linaro-linux/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/timers/posix_timers
    /tmp/cc1FTZzT.o: In function `check_timer_create':
    /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/timers/posix_timers.c:157:
    undefined reference to `timer_create'
    /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/timers/posix_timers.c:170:
    undefined reference to `timer_settime'
    collect2: error: ld returned 1 exit status

    It's GNU Make and linker specific.

    The default Makefile rule looks like:

    $(CC) $(CFLAGS) $(LDFLAGS) $@ $^ $(LDLIBS)

    When linking is done by gcc itself, no issue, but when it needs to be passed
    to proper ld, only LDLIBS follows and then ld cannot know what libs to link
    with.

    More detail:
    https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html

    LDFLAGS
    Extra flags to give to compilers when they are supposed to invoke the linker,
    ‘ld’, such as -L. Libraries (-lfoo) should be added to the LDLIBS variable
    instead.

    LDLIBS
    Library flags or names given to compilers when they are supposed to invoke the
    linker, ‘ld’. LOADLIBES is a deprecated (but still supported) alternative to
    LDLIBS. Non-library linker flags, such as -L, should go in the LDFLAGS
    variable.

    https://lkml.org/lkml/2010/2/10/362

    tools/perf: libraries must come after objects

    Link order matters, use LDLIBS instead of LDFLAGS to properly link against
    libpthread.

    Signed-off-by: Denys Dmytriyenko
    Signed-off-by: Fathi Boudra
    Signed-off-by: Shuah Khan

    Fathi Boudra
     
  • reuseport_bpf_numa fails to build due to undefined reference errors:

    aarch64-linaro-linux-gcc
    --sysroot=/build/tmp-rpb-glibc/sysroots/hikey -Wall
    -Wl,--no-as-needed -O2 -g -I../../../../usr/include/ -Wl,-O1
    -Wl,--hash-style=gnu -Wl,--as-needed -lnuma reuseport_bpf_numa.c
    -o
    /build/tmp-rpb-glibc/work/hikey-linaro-linux/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/net/reuseport_bpf_numa
    /tmp/ccfUuExT.o: In function `send_from_node':
    /build/tmp-rpb-glibc/work/hikey-linaro-linux/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/net/reuseport_bpf_numa.c:138:
    undefined reference to `numa_run_on_node'
    /tmp/ccfUuExT.o: In function `main':
    /build/tmp-rpb-glibc/work/hikey-linaro-linux/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/net/reuseport_bpf_numa.c:230:
    undefined reference to `numa_available'
    /build/tmp-rpb-glibc/work/hikey-linaro-linux/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/net/reuseport_bpf_numa.c:233:
    undefined reference to `numa_max_node'

    It's GNU Make and linker specific.

    The default Makefile rule looks like:

    $(CC) $(CFLAGS) $(LDFLAGS) $@ $^ $(LDLIBS)

    When linking is done by gcc itself, no issue, but when it needs to be passed
    to proper ld, only LDLIBS follows and then ld cannot know what libs to link
    with.

    More detail:
    https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html

    LDFLAGS
    Extra flags to give to compilers when they are supposed to invoke the linker,
    ‘ld’, such as -L. Libraries (-lfoo) should be added to the LDLIBS variable
    instead.

    LDLIBS
    Library flags or names given to compilers when they are supposed to invoke the
    linker, ‘ld’. LOADLIBES is a deprecated (but still supported) alternative to
    LDLIBS. Non-library linker flags, such as -L, should go in the LDFLAGS
    variable.

    https://lkml.org/lkml/2010/2/10/362

    tools/perf: libraries must come after objects

    Link order matters, use LDLIBS instead of LDFLAGS to properly link against
    libnuma.

    Signed-off-by: Fathi Boudra
    Signed-off-by: Shuah Khan

    Fathi Boudra
     
  • Pull x86 fixes from Thomas Gleixner:
    "A set of fixes for x86:

    - Fix the swapped outb() parameters in the KASLR code

    - Fix the PKEY handling at fork which missed to preserve the pkey
    state for the child. Comes with a test case to validate that.

    - Fix the entry stack handling for XEN PV to respect that XEN PV
    systems enter the function already on the current thread stack and
    not on the trampoline.

    - Fix kexec load failure caused by using a stale value when the
    kexec_buf structure is reused for subsequent allocations.

    - Fix a bogus sizeof() in the memory encryption code

    - Enforce PCI dependency for the Intel Low Power Subsystem

    - Enforce PCI_LOCKLESS_CONFIG when PCI is enabled"

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/Kconfig: Select PCI_LOCKLESS_CONFIG if PCI is enabled
    x86/entry/64/compat: Fix stack switching for XEN PV
    x86/kexec: Fix a kexec_file_load() failure
    x86/mm/mem_encrypt: Fix erroneous sizeof()
    x86/selftests/pkeys: Fork() to check for state being preserved
    x86/pkeys: Properly copy pkey state at fork()
    x86/kaslr: Fix incorrect i8254 outb() parameters
    x86/intel/lpss: Make PCI dependency explicit

    Linus Torvalds
     
  • Steffen Klassert says:

    ====================
    pull request (net): ipsec 2019-01-25

    1) Several patches to fix the fallout from the recent
    tree based policy lookup work. From Florian Westphal.

    2) Fix VTI for IPCOMP for 'not compressed' IPCOMP packets.
    We need an extra IPIP handler to process these packets
    correctly. From Su Yanjun.

    3) Fix validation of template and selector families for
    MODE_ROUTEOPTIMIZATION with ipv4-in-ipv6 packets.
    This can lead to a stack-out-of-bounds because
    flowi4 struct is treated as flowi6 struct.
    Fix from Florian Westphal.

    4) Restore the default behaviour of the xfrm set-mark
    in the output path. This was changed accidentally
    when mark setting was extended to the input path.
    From Benedict Wong.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Pull KVM fixes from Paolo Bonzini:
    "Quite a few fixes for x86: nested virtualization save/restore, AMD
    nested virtualization and virtual APIC, 32-bit fixes, an important fix
    to restore operation on older processors, and a bunch of hyper-v
    bugfixes. Several are marked stable.

    There are also fixes for GCC warnings and for a GCC/objtool interaction"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
    KVM: x86: Mark expected switch fall-throughs
    KVM: x86: fix TRACE_INCLUDE_PATH and remove -I. header search paths
    KVM: selftests: check returned evmcs version range
    x86/kvm/hyper-v: nested_enable_evmcs() sets vmcs_version incorrectly
    KVM: VMX: Move vmx_vcpu_run()'s VM-Enter asm blob to a helper function
    kvm: selftests: Fix region overlap check in kvm_util
    kvm: vmx: fix some -Wmissing-prototypes warnings
    KVM: nSVM: clear events pending from svm_complete_interrupts() when exiting to L1
    svm: Fix AVIC incomplete IPI emulation
    svm: Add warning message for AVIC IPI invalid target
    KVM: x86: WARN_ONCE if sending a PV IPI returns a fatal error
    KVM: x86: Fix PV IPIs for 32-bit KVM host
    x86/kvm/hyper-v: recommend using eVMCS only when it is enabled
    x86/kvm/hyper-v: don't recommend doing reset via synthetic MSR
    kvm: x86/vmx: Use kzalloc for cached_vmcs12
    KVM: VMX: Use the correct field var when clearing VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL
    KVM: x86: Fix single-step debugging
    x86/kvm/hyper-v: don't announce GUEST IDLE MSR support

    Linus Torvalds
     
  • Pull libnvdimm fixes from Dan Williams:
    "A fix for namespace label support for non-Intel NVDIMMs that implement
    the ACPI standard label method.

    This has apparently never worked and could wait for v5.1. However it
    has enough visibility with hardware vendors [1] and distro bug
    trackers [2], and low enough risk that I decided it should go in for
    -rc4. The other fixups target the new, for v5.0, nvdimm security
    functionality. The larger init path fixup closes a memory leak and a
    potential userspace lockup due to missed notifications.

    [1] https://github.com/pmem/ndctl/issues/78
    [2] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1811785

    These have all soaked in -next for a week with no reported issues.

    Summary:

    - Fix support for NVDIMMs that implement the ACPI standard label
    methods.

    - Fix error handling for security overwrite (memory leak / userspace
    hang condition), and another one-line security cleanup"

    * tag 'libnvdimm-fixes-5.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
    acpi/nfit: Fix command-supported detection
    acpi/nfit: Block function zero DSMs
    libnvdimm/security: Require nvdimm_security_setup_events() to succeed
    nfit_test: fix security state pull for nvdimm security nfit_test

    Linus Torvalds
     

26 Jan, 2019

5 commits

  • Passing EPERM during syscall skipping was confusing since the test wasn't
    actually exercising the errno evaluation -- it was just passing a literal
    "1" (EPERM). Instead, expand the tests to check both direct value returns
    (positive, 45000 in this case), and errno values (negative, -ESRCH in this
    case) to check both fake success and fake failure during syscall skipping.

    Reported-by: Colin Ian King
    Fixes: a33b2d0359a0 ("selftests/seccomp: Add tests for basic ptrace actions")
    Cc: stable@vger.kernel.org
    Signed-off-by: Kees Cook
    Signed-off-by: Shuah Khan

    Kees Cook
     
  • When the system lirc.h is older than v4.16, you will get errors like:

    ir_loopback.c:32:16: error: field ‘proto’ has incomplete type
    enum rc_proto proto;

    Cc: Shuah Khan
    Signed-off-by: Sean Young
    Signed-off-by: Shuah Khan

    Sean Young
     
  • The cpu-hotplug test assumes that we can offline the maximum CPU as
    described by /sys/devices/system/cpu/offline. However, in the case
    where the number of CPUs exceeds like kernel configuration then
    the offline count can be greater than the present count and we end
    up trying to test the offlining of a CPU that is not available to
    offline. Fix this by testing the maximum present CPU instead.

    Also, the test currently offlines the CPU and does not online it,
    so fix this by onlining the CPU after the test.

    Fixes: d89dffa976bc ("fault-injection: add selftests for cpu and memory hotplug")
    Signed-off-by: Colin Ian King
    Signed-off-by: Shuah Khan

    Colin Ian King
     
  • Check that KVM_CAP_HYPERV_ENLIGHTENED_VMCS returns correct version range.

    Signed-off-by: Vitaly Kuznetsov
    Signed-off-by: Paolo Bonzini

    Vitaly Kuznetsov
     
  • Fix a call to userspace_mem_region_find to conform to its spec of
    taking an inclusive, inclusive range. It was previously being called
    with an inclusive, exclusive range. Also remove a redundant region bounds
    check in vm_userspace_mem_region_add. Region overlap checking is already
    performed by the call to userspace_mem_region_find.

    Tested: Compiled tools/testing/selftests/kvm with -static
    Ran all resulting test binaries on an Intel Haswell test machine
    All tests passed

    Signed-off-by: Ben Gardon
    Reviewed-by: Jim Mattson
    Signed-off-by: Paolo Bonzini

    Ben Gardon
     

23 Jan, 2019

3 commits

  • When updating a percpu map, bpftool currently copies the provided
    value only into the first per CPU copy of the specified value,
    all others instances are left zeroed.

    This change explicitly copies the user-provided bytes to all the
    per CPU instances, keeping the sub-command syntax unchanged.

    v2 -> v3:
    - drop unused argument, as per Quentin's suggestion
    v1 -> v2:
    - rename the helper as per Quentin's suggestion

    Fixes: 71bb428fe2c1 ("tools: bpf: add bpftool")
    Signed-off-by: Paolo Abeni
    Reviewed-by: Quentin Monnet
    Signed-off-by: Daniel Borkmann

    Paolo Abeni
     
  • Lance reported an issue with bpftool not being able to
    dump program if there are more programs loaded and you
    want to dump any but the first program, like:

    # bpftool prog
    28: kprobe name trace_req_start tag 1dfc28ba8b3dd597 gpl
    loaded_at 2019-01-18T17:02:40+1100 uid 0
    xlated 112B jited 109B memlock 4096B map_ids 13
    29: kprobe name trace_req_compl tag 5b6a5ecc6030a683 gpl
    loaded_at 2019-01-18T17:02:40+1100 uid 0
    xlated 928B jited 575B memlock 4096B map_ids 13,14
    # bpftool prog dum jited tag 1dfc28ba8b3dd597
    0: push %rbp
    1: mov %rsp,%rbp
    ...

    # bpftool prog dum jited tag 5b6a5ecc6030a683
    Error: can't get prog info (29): Bad address

    The problem is in the prog_fd_by_tag function not cleaning
    the struct bpf_prog_info before another request, so the
    previous program length is still in there and kernel assumes
    it needs to dump the program, which fails because there's no
    user pointer set.

    Moving the struct bpf_prog_info declaration into the loop,
    so it gets cleaned before each query.

    Fixes: 71bb428fe2c1 ("tools: bpf: add bpftool")
    Reported-by: Lance Digby
    Signed-off-by: Jiri Olsa
    Reviewed-by: Quentin Monnet
    Acked-by: Jakub Kicinski
    Signed-off-by: Daniel Borkmann

    Jiri Olsa
     
  • …/git/shuah/linux-kselftest

    Pull kselftest fixes from Shuah Khan:
    "Fixes to rtc, seccomp and other tests"

    * tag 'linux-kselftest-5.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
    selftests/seccomp: Abort without user notification support
    selftests: gpio-mockup-chardev: Check asprintf() for error
    selftests: seccomp: use LDLIBS instead of LDFLAGS
    selftests/vm/gup_benchmark.c: match gup struct to kernel
    tools/testing/selftests/x86/unwind_vdso.c: Remove duplicate header
    x86/mpx/selftests: fix spelling mistake "succeded" -> "succeeded"
    selftests: rtc: rtctest: add alarm test on minute boundary
    selftests: rtc: rtctest: fix alarm tests

    Linus Torvalds
     

22 Jan, 2019

1 commit

  • …inux/kernel/git/acme/linux into perf/urgent

    Pull perf/urgent fixes from Arnaldo Carvalho de Melo:

    Kernel:

    Stephane Eranian:

    - Fix perf_proc_update_handler() bug.

    perf script:

    Andi Kleen:

    - Fix crash with printing mixed trace point and other events.

    Tony Jones:

    - Fix crash when processing recorded stat data.

    perf top:

    He Kuang:

    - Fix wrong hottest instruction highlighted.

    perf python:

    Arnaldo Carvalho de Melo:

    - Remove -fstack-clash-protection when building with some clang versions.

    perf ordered_events:

    Jiri Olsa:

    - Fix out of buffers crash in ordered_events__free().

    perf cpu_map:

    Stephane Eranian:

    - Handle TOPOLOGY headers with no CPU.

    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>

    Ingo Molnar