19 Nov, 2018

3 commits

  • Merge misc fixes from Andrew Morton:
    "16 fixes"

    * emailed patches from Andrew Morton :
    mm/memblock.c: fix a typo in __next_mem_pfn_range() comments
    mm, page_alloc: check for max order in hot path
    scripts/spdxcheck.py: make python3 compliant
    tmpfs: make lseek(SEEK_DATA/SEK_HOLE) return ENXIO with a negative offset
    lib/ubsan.c: don't mark __ubsan_handle_builtin_unreachable as noreturn
    mm/vmstat.c: fix NUMA statistics updates
    mm/gup.c: fix follow_page_mask() kerneldoc comment
    ocfs2: free up write context when direct IO failed
    scripts/faddr2line: fix location of start_kernel in comment
    mm: don't reclaim inodes with many attached pages
    mm, memory_hotplug: check zone_movable in has_unmovable_pages
    mm/swapfile.c: use kvzalloc for swap_info_struct allocation
    MAINTAINERS: update OMAP MMC entry
    hugetlbfs: fix kernel BUG at fs/hugetlbfs/inode.c:444!
    kernel/sched/psi.c: simplify cgroup_move_task()
    z3fold: fix possible reclaim races

    Linus Torvalds
     
  • Pull scheduler fix from Ingo Molnar:
    "Fix an exec() related scalability/performance regression, which was
    caused by incorrectly calculating load and migrating tasks on exec()
    when they shouldn't be"

    * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    sched/fair: Fix cpu_util_wake() for 'execl' type workloads

    Linus Torvalds
     
  • The existing code triggered an invalid warning about 'rq' possibly being
    used uninitialized. Instead of doing the silly warning suppression by
    initializa it to NULL, refactor the code to bail out early instead.

    Warning was:

    kernel/sched/psi.c: In function `cgroup_move_task':
    kernel/sched/psi.c:639:13: warning: `rq' may be used uninitialized in this function [-Wmaybe-uninitialized]

    Link: http://lkml.kernel.org/r/20181103183339.8669-1-olof@lixom.net
    Fixes: 2ce7135adc9ad ("psi: cgroup support")
    Signed-off-by: Olof Johansson
    Reviewed-by: Andrew Morton
    Acked-by: Johannes Weiner
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olof Johansson
     

14 Nov, 2018

6 commits

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

    Notice that in this particular case, I replaced the code comments with
    a proper "fall through" annotation, which is what GCC is expecting
    to find.

    Signed-off-by: Gustavo A. R. Silva
    Reviewed-by: Daniel Thompson
    Signed-off-by: Daniel Thompson

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

    Notice that in this particular case, I replaced the code comments with
    a proper "fall through" annotation, which is what GCC is expecting
    to find.

    Signed-off-by: Gustavo A. R. Silva
    Reviewed-by: Daniel Thompson
    Signed-off-by: Daniel Thompson

    Gustavo A. R. Silva
     
  • Replace the whole switch statement with a for loop. This makes the
    code clearer and easy to read.

    This also addresses the following Coverity warnings:

    Addresses-Coverity-ID: 115090 ("Missing break in switch")
    Addresses-Coverity-ID: 115091 ("Missing break in switch")
    Addresses-Coverity-ID: 114700 ("Missing break in switch")

    Suggested-by: Daniel Thompson
    Signed-off-by: Gustavo A. R. Silva
    Reviewed-by: Daniel Thompson
    [daniel.thompson@linaro.org: Tiny grammar change in description]
    Signed-off-by: Daniel Thompson

    Gustavo A. R. Silva
     
  • gcc 8.1.0 warns with:

    kernel/debug/kdb/kdb_support.c: In function ‘kallsyms_symbol_next’:
    kernel/debug/kdb/kdb_support.c:239:4: warning: ‘strncpy’ specified bound depends on the length of the source argument [-Wstringop-overflow=]
    strncpy(prefix_name, name, strlen(name)+1);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    kernel/debug/kdb/kdb_support.c:239:31: note: length computed here

    Use strscpy() with the destination buffer size, and use ellipses when
    displaying truncated symbols.

    v2: Use strscpy()

    Signed-off-by: Prarit Bhargava
    Cc: Jonathan Toppins
    Cc: Jason Wessel
    Cc: Daniel Thompson
    Cc: kgdb-bugreport@lists.sourceforge.net
    Reviewed-by: Daniel Thompson
    Signed-off-by: Daniel Thompson

    Prarit Bhargava
     
  • Since commit ad67b74d2469 ("printk: hash addresses printed with %p"),
    all pointers printed with %p are printed with hashed addresses
    instead of real addresses in order to avoid leaking addresses in
    dmesg and syslog. But this applies to kdb too, with is unfortunate:

    Entering kdb (current=0x(ptrval), pid 329) due to Keyboard Entry
    kdb> ps
    15 sleeping system daemon (state M) processes suppressed,
    use 'ps A' to see all.
    Task Addr Pid Parent [*] cpu State Thread Command
    0x(ptrval) 329 328 1 0 R 0x(ptrval) *sh

    0x(ptrval) 1 0 0 0 S 0x(ptrval) init
    0x(ptrval) 3 2 0 0 D 0x(ptrval) rcu_gp
    0x(ptrval) 4 2 0 0 D 0x(ptrval) rcu_par_gp
    0x(ptrval) 5 2 0 0 D 0x(ptrval) kworker/0:0
    0x(ptrval) 6 2 0 0 D 0x(ptrval) kworker/0:0H
    0x(ptrval) 7 2 0 0 D 0x(ptrval) kworker/u2:0
    0x(ptrval) 8 2 0 0 D 0x(ptrval) mm_percpu_wq
    0x(ptrval) 10 2 0 0 D 0x(ptrval) rcu_preempt

    The whole purpose of kdb is to debug, and for debugging real addresses
    need to be known. In addition, data displayed by kdb doesn't go into
    dmesg.

    This patch replaces all %p by %px in kdb in order to display real
    addresses.

    Fixes: ad67b74d2469 ("printk: hash addresses printed with %p")
    Cc:
    Signed-off-by: Christophe Leroy
    Signed-off-by: Daniel Thompson

    Christophe Leroy
     
  • On a powerpc 8xx, 'btc' fails as follows:

    Entering kdb (current=0x(ptrval), pid 282) due to Keyboard Entry
    kdb> btc
    btc: cpu status: Currently on cpu 0
    Available cpus: 0
    kdb_getarea: Bad address 0x0

    when booting the kernel with 'debug_boot_weak_hash', it fails as well

    Entering kdb (current=0xba99ad80, pid 284) due to Keyboard Entry
    kdb> btc
    btc: cpu status: Currently on cpu 0
    Available cpus: 0
    kdb_getarea: Bad address 0xba99ad80

    On other platforms, Oopses have been observed too, see
    https://github.com/linuxppc/linux/issues/139

    This is due to btc calling 'btt' with %p pointer as an argument.

    This patch replaces %p by %px to get the real pointer value as
    expected by 'btt'

    Fixes: ad67b74d2469 ("printk: hash addresses printed with %p")
    Cc:
    Signed-off-by: Christophe Leroy
    Reviewed-by: Daniel Thompson
    Signed-off-by: Daniel Thompson

    Christophe Leroy
     

12 Nov, 2018

4 commits

  • A ~10% regression has been reported for UnixBench's execl throughput
    test by Aaron Lu and Ye Xiaolong:

    https://lkml.org/lkml/2018/10/30/765

    That test is pretty simple, it does a "recursive" execve() syscall on the
    same binary. Starting from the syscall, this sequence is possible:

    do_execve()
    do_execveat_common()
    __do_execve_file()
    sched_exec()
    select_task_rq_fair()
    Reported-by: Ye Xiaolong
    Tested-by: Aaron Lu
    Signed-off-by: Patrick Bellasi
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Dietmar Eggemann
    Cc: Juri Lelli
    Cc: Linus Torvalds
    Cc: Morten Rasmussen
    Cc: Peter Zijlstra
    Cc: Quentin Perret
    Cc: Steve Muckle
    Cc: Suren Baghdasaryan
    Cc: Thomas Gleixner
    Cc: Todd Kjos
    Cc: Vincent Guittot
    Fixes: f9be3e5961c5 (sched/fair: Use util_est in LB and WU paths)
    Link: https://lore.kernel.org/lkml/20181025093100.GB13236@e110439-lin/
    Signed-off-by: Ingo Molnar

    Patrick Bellasi
     
  • Pull timer fix from Thomas Gleixner:
    "Just the removal of a redundant call into the sched deadline overrun
    check"

    * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    posix-cpu-timers: Remove useless call to check_dl_overrun()

    Linus Torvalds
     
  • Pull scheduler fixes from Thomas Gleixner:
    "Two small scheduler fixes:

    - Take hotplug lock in sched_init_smp(). Technically not really
    required, but lockdep will complain other.

    - Trivial comment fix in sched/fair"

    * 'sched/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    sched/fair: Fix a comment in task_numa_fault()
    sched/core: Take the hotplug lock in sched_init_smp()

    Linus Torvalds
     
  • Pull core fixes from Thomas Gleixner:
    "A couple of fixlets for the core:

    - Kernel doc function documentation fixes

    - Missing prototypes for weak watchdog functions"

    * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    resource/docs: Complete kernel-doc style function documentation
    watchdog/core: Add missing prototypes for weak functions
    resource/docs: Fix new kernel-doc warnings

    Linus Torvalds
     

11 Nov, 2018

1 commit

  • Pull namespace fixes from Eric Biederman:
    "I believe all of these are simple obviously correct bug fixes. These
    fall into two groups:

    - Fixing the implementation of MNT_LOCKED which prevents lesser
    privileged users from seeing unders mounts created by more
    privileged users.

    - Fixing the extended uid and group mapping in user namespaces.

    As well as ensuring the code looks correct I have spot tested these
    changes as well and in my testing the fixes are working"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
    mount: Prevent MNT_DETACH from disconnecting locked mounts
    mount: Don't allow copying MNT_UNBINDABLE|MNT_LOCKED mounts
    mount: Retest MNT_LOCKED in do_umount
    userns: also map extents in the reverse map to kernel IDs

    Linus Torvalds
     

08 Nov, 2018

2 commits

  • check_dl_overrun() is used to send a SIGXCPU to users that asked to be
    informed when a SCHED_DEADLINE runtime overruns occur.

    The function is called by check_thread_timers() already, so the call in
    check_process_timers() is redundant/wrong (even though harmless).

    Remove it.

    Fixes: 34be39305a77 ("sched/deadline: Implement "runtime overrun signal" support")
    Signed-off-by: Juri Lelli
    Signed-off-by: Thomas Gleixner
    Reviewed-by: Daniel Bristot de Oliveira
    Reviewed-by: Steven Rostedt (VMware)
    Cc: linux-rt-users@vger.kernel.org
    Cc: mtk.manpages@gmail.com
    Cc: Mathieu Poirier
    Cc: Peter Zijlstra
    Cc: Luca Abeni
    Cc: Claudio Scordino
    Link: https://lkml.kernel.org/r/20181107111032.32291-1-juri.lelli@redhat.com

    Juri Lelli
     
  • The current logic first clones the extent array and sorts both copies, then
    maps the lower IDs of the forward mapping into the lower namespace, but
    doesn't map the lower IDs of the reverse mapping.

    This means that code in a nested user namespace with >5 extents will see
    incorrect IDs. It also breaks some access checks, like
    inode_owner_or_capable() and privileged_wrt_inode_uidgid(), so a process
    can incorrectly appear to be capable relative to an inode.

    To fix it, we have to make sure that the "lower_first" members of extents
    in both arrays are translated; and we have to make sure that the reverse
    map is sorted *after* the translation (since otherwise the translation can
    break the sorting).

    This is CVE-2018-18955.

    Fixes: 6397fac4915a ("userns: bump idmap limits to 340")
    Cc: stable@vger.kernel.org
    Signed-off-by: Jann Horn
    Tested-by: Eric W. Biederman
    Reviewed-by: Eric W. Biederman
    Signed-off-by: Eric W. Biederman

    Jann Horn
     

07 Nov, 2018

2 commits

  • Add the missing kernel-doc style function parameters documentation.

    Signed-off-by: Borislav Petkov
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: akpm@linux-foundation.org
    Cc: linux-tip-commits@vger.kernel.org
    Cc: rdunlap@infradead.org
    Fixes: b69c2e20f6e4 ("resource: Clean it up a bit")
    Link: http://lkml.kernel.org/r/20181105093307.GA12445@zn.tnic
    Signed-off-by: Ingo Molnar

    Borislav Petkov
     
  • Pull tracing fix from Steven Rostedt:
    "Masami found a slight bug in his code where he transposed the
    arguments of a call to strpbrk.

    The reason this wasn't detected in our tests is that the only way this
    would transpire is when a kprobe event with a symbol offset is
    attached to a function that belongs to a module that isn't loaded yet.
    When the kprobe trace event is added, the offset would be truncated
    after it was parsed, and when the module is loaded, it would use the
    symbol without the offset (as the nul character added by the parsing
    would not be replaced with the original character)"

    * tag 'trace-v4.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
    tracing/kprobes: Fix strpbrk() argument order

    Linus Torvalds
     

06 Nov, 2018

1 commit

  • Pull networking fixes from David Miller:

    1) Handle errors mid-stream of an all dump, from Alexey Kodanev.

    2) Fix build of openvswitch with certain combinations of netfilter
    options, from Arnd Bergmann.

    3) Fix interactions between GSO and BQL, from Eric Dumazet.

    4) Don't put a '/' in RTL8201F's sysfs file name, from Holger
    Hoffstätte.

    5) S390 qeth driver fixes from Julian Wiedmann.

    6) Allow ipv6 link local addresses for netconsole when both source and
    destination are link local, from Matwey V. Kornilov.

    7) Fix the BPF program address seen in /proc/kallsyms, from Song Liu.

    8) Initialize mutex before use in dsa microchip driver, from Tristram
    Ha.

    9) Out-of-bounds access in hns3, from Yunsheng Lin.

    10) Various netfilter fixes from Stefano Brivio, Jozsef Kadlecsik, Jiri
    Slaby, Florian Westphal, Eric Westbrook, Andrey Ryabinin, and Pablo
    Neira Ayuso.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (50 commits)
    net: alx: make alx_drv_name static
    net: bpfilter: fix iptables failure if bpfilter_umh is disabled
    sock_diag: fix autoloading of the raw_diag module
    net: core: netpoll: Enable netconsole IPv6 link local address
    ipv6: properly check return value in inet6_dump_all()
    rtnetlink: restore handling of dumpit return value in rtnl_dump_all()
    net/ipv6: Move anycast init/cleanup functions out of CONFIG_PROC_FS
    bonding/802.3ad: fix link_failure_count tracking
    net: phy: realtek: fix RTL8201F sysfs name
    sctp: define SCTP_SS_DEFAULT for Stream schedulers
    sctp: fix strchange_flags name for Stream Change Event
    mlxsw: spectrum: Fix IP2ME CPU policer configuration
    openvswitch: fix linking without CONFIG_NF_CONNTRACK_LABELS
    qed: fix link config error handling
    net: hns3: Fix for out-of-bounds access when setting pfc back pressure
    net/mlx4_en: use __netdev_tx_sent_queue()
    net: do not abort bulk send on BQL status
    net: bql: add __netdev_tx_sent_queue()
    s390/qeth: report 25Gbit link speed
    s390/qeth: sanitize ARP requests
    ...

    Linus Torvalds
     

05 Nov, 2018

3 commits

  • Fix strpbrk()'s argument order, it must pass acceptable string
    in 2nd argument. Note that this can cause a kernel panic where
    it recovers backup character to code->data.

    Link: http://lkml.kernel.org/r/154108256792.2604.1816052586385217811.stgit@devbox

    Fixes: a6682814f371 ("tracing/kprobes: Allow kprobe-events to record module symbol")
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     
  • The first group of warnings is caused by a "/**" kernel-doc notation
    marker but the function comments are not in kernel-doc format.
    Also add another error return value here.

    ../kernel/resource.c:337: warning: Function parameter or member 'start' not described in 'find_next_iomem_res'
    ../kernel/resource.c:337: warning: Function parameter or member 'end' not described in 'find_next_iomem_res'
    ../kernel/resource.c:337: warning: Function parameter or member 'flags' not described in 'find_next_iomem_res'
    ../kernel/resource.c:337: warning: Function parameter or member 'desc' not described in 'find_next_iomem_res'
    ../kernel/resource.c:337: warning: Function parameter or member 'first_lvl' not described in 'find_next_iomem_res'
    ../kernel/resource.c:337: warning: Function parameter or member 'res' not described in 'find_next_iomem_res'

    Add the missing function parameter documentation for the other warnings:

    ../kernel/resource.c:409: warning: Function parameter or member 'arg' not described in 'walk_iomem_res_desc'
    ../kernel/resource.c:409: warning: Function parameter or member 'func' not described in 'walk_iomem_res_desc'

    Signed-off-by: Randy Dunlap
    Cc: Andrew Morton
    Cc: Borislav Petkov
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Fixes: b69c2e20f6e4 ("resource: Clean it up a bit")
    Link: http://lkml.kernel.org/r/dda2e4d8-bedd-3167-20fe-8c7d2d35b354@infradead.org
    Signed-off-by: Ingo Molnar

    Randy Dunlap
     
  • Duplicated 'case it'.

    Signed-off-by: Yi Wang
    Reviewed-by: Xi Xu
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: zhong.weidong@zte.com.cn
    Link: http://lkml.kernel.org/r/1541379013-11352-1-git-send-email-wang.yi59@zte.com.cn
    Signed-off-by: Ingo Molnar

    Yi Wang
     

04 Nov, 2018

9 commits

  • Pull scheduler fixes from Ingo Molnar:
    "A memory (under-)allocation fix and a comment fix"

    * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    sched/topology: Fix off by one bug
    sched/rt: Update comment in pick_next_task_rt()

    Linus Torvalds
     
  • Pull x86 fixes from Ingo Molnar:
    "A number of fixes and some late updates:

    - make in_compat_syscall() behavior on x86-32 similar to other
    platforms, this touches a number of generic files but is not
    intended to impact non-x86 platforms.

    - objtool fixes

    - PAT preemption fix

    - paravirt fixes/cleanups

    - cpufeatures updates for new instructions

    - earlyprintk quirk

    - make microcode version in sysfs world-readable (it is already
    world-readable in procfs)

    - minor cleanups and fixes"

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    compat: Cleanup in_compat_syscall() callers
    x86/compat: Adjust in_compat_syscall() to generic code under !COMPAT
    objtool: Support GCC 9 cold subfunction naming scheme
    x86/numa_emulation: Fix uniform-split numa emulation
    x86/paravirt: Remove unused _paravirt_ident_32
    x86/mm/pat: Disable preemption around __flush_tlb_all()
    x86/paravirt: Remove GPL from pv_ops export
    x86/traps: Use format string with panic() call
    x86: Clean up 'sizeof x' => 'sizeof(x)'
    x86/cpufeatures: Enumerate MOVDIR64B instruction
    x86/cpufeatures: Enumerate MOVDIRI instruction
    x86/earlyprintk: Add a force option for pciserial device
    objtool: Support per-function rodata sections
    x86/microcode: Make revision and processor flags world-readable

    Linus Torvalds
     
  • Pull perf updates and fixes from Ingo Molnar:
    "These are almost all tooling updates: 'perf top', 'perf trace' and
    'perf script' fixes and updates, an UAPI header sync with the merge
    window versions, license marker updates, much improved Sparc support
    from David Miller, and a number of fixes"

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (66 commits)
    perf intel-pt/bts: Calculate cpumode for synthesized samples
    perf intel-pt: Insert callchain context into synthesized callchains
    perf tools: Don't clone maps from parent when synthesizing forks
    perf top: Start display thread earlier
    tools headers uapi: Update linux/if_link.h header copy
    tools headers uapi: Update linux/netlink.h header copy
    tools headers: Sync the various kvm.h header copies
    tools include uapi: Update linux/mmap.h copy
    perf trace beauty: Use the mmap flags table generated from headers
    perf beauty: Wire up the mmap flags table generator to the Makefile
    perf beauty: Add a generator for MAP_ mmap's flag constants
    tools include uapi: Update asound.h copy
    tools arch uapi: Update asm-generic/unistd.h and arm64 unistd.h copies
    tools include uapi: Update linux/fs.h copy
    perf callchain: Honour the ordering of PERF_CONTEXT_{USER,KERNEL,etc}
    perf cs-etm: Correct CPU mode for samples
    perf unwind: Take pgoff into account when reporting elf to libdwfl
    perf top: Do not use overwrite mode by default
    perf top: Allow disabling the overwrite mode
    perf trace: Beautify mount's first pathname arg
    ...

    Linus Torvalds
     
  • Pull irq fixes from Ingo Molnar:
    "An irqchip driver fix and a memory (over-)allocation fix"

    * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    irqchip/irq-mvebu-sei: Fix a NULL vs IS_ERR() bug in probe function
    irq/matrix: Fix memory overallocation

    Linus Torvalds
     
  • When running on linux-next (8c60c36d0b8c ("Add linux-next specific files
    for 20181019")) + CONFIG_PROVE_LOCKING=y on a big.LITTLE system (e.g.
    Juno or HiKey960), we get the following report:

    [ 0.748225] Call trace:
    [ 0.750685] lockdep_assert_cpus_held+0x30/0x40
    [ 0.755236] static_key_enable_cpuslocked+0x20/0xc8
    [ 0.760137] build_sched_domains+0x1034/0x1108
    [ 0.764601] sched_init_domains+0x68/0x90
    [ 0.768628] sched_init_smp+0x30/0x80
    [ 0.772309] kernel_init_freeable+0x278/0x51c
    [ 0.776685] kernel_init+0x10/0x108
    [ 0.780190] ret_from_fork+0x10/0x18

    The static_key in question is 'sched_asym_cpucapacity' introduced by
    commit:

    df054e8445a4 ("sched/topology: Add static_key for asymmetric CPU capacity optimizations")

    In this particular case, we enable it because smp_prepare_cpus() will
    end up fetching the capacity-dmips-mhz entry from the devicetree,
    so we already have some asymmetry detected when entering sched_init_smp().

    This didn't get detected in tip/sched/core because we were missing:

    commit cb538267ea1e ("jump_label/lockdep: Assert we hold the hotplug lock for _cpuslocked() operations")

    Calls to build_sched_domains() post sched_init_smp() will hold the
    hotplug lock, it just so happens that this very first call is a
    special case. As stated by a comment in sched_init_smp(), "There's no
    userspace yet to cause hotplug operations" so this is a harmless
    warning.

    However, to both respect the semantics of underlying
    callees and make lockdep happy, take the hotplug lock in
    sched_init_smp(). This also satisfies the comment atop
    sched_init_domains() that says "Callers must hold the hotplug lock".

    Reported-by: Sudeep Holla
    Tested-by: Sudeep Holla
    Signed-off-by: Valentin Schneider
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Dietmar.Eggemann@arm.com
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: morten.rasmussen@arm.com
    Cc: quentin.perret@arm.com
    Link: http://lkml.kernel.org/r/1540301851-3048-1-git-send-email-valentin.schneider@arm.com
    Signed-off-by: Ingo Molnar

    Valentin Schneider
     
  • With the addition of the NUMA identity level, we increased @level by
    one and will run off the end of the array in the distance sort loop.

    Fixed: 051f3ca02e46 ("sched/topology: Introduce NUMA identity node sched domain")
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Remove one include of .
    No functional changes.

    Link: http://lkml.kernel.org/r/20181004134223.17735-1-michael@schupikov.de
    Signed-off-by: Michael Schupikov
    Reviewed-by: Richard Weinberger
    Acked-by: Luis Chamberlain
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Schupikov
     
  • We include kexec.h and slab.h twice in kexec_file.c. It's unnecessary.
    hence just remove them.

    Link: http://lkml.kernel.org/r/1537498098-19171-1-git-send-email-zhongjiang@huawei.com
    Signed-off-by: zhong jiang
    Reviewed-by: Bhupesh Sharma
    Reviewed-by: Andrew Morton
    Acked-by: Baoquan He
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    zhong jiang
     

03 Nov, 2018

5 commits

  • While dbecd7388476 ("bpf: get kernel symbol addresses via syscall")
    zeroed info.nr_jited_ksyms in bpf_prog_get_info_by_fd() for queries
    from unprivileged users, commit 815581c11cc2 ("bpf: get JITed image
    lengths of functions via syscall") forgot about doing so and therefore
    returns the #elems of the user set up buffer which is incorrect. It
    also needs to indicate a info.nr_jited_func_lens of zero.

    Fixes: 815581c11cc2 ("bpf: get JITed image lengths of functions via syscall")
    Signed-off-by: Daniel Borkmann
    Cc: Sandipan Das
    Cc: Song Liu
    Signed-off-by: Alexei Starovoitov

    Daniel Borkmann
     
  • Currently, when there is no subprog (prog->aux->func_cnt == 0),
    bpf_prog_info does not return any jited_ksyms or jited_func_lens. This
    patch adds main program address (prog->bpf_func) and main program
    length (prog->jited_len) to bpf_prog_info.

    Signed-off-by: Song Liu
    Signed-off-by: Daniel Borkmann

    Song Liu
     
  • Currently, jited_ksyms in bpf_prog_info shows page addresses of jited
    bpf program. The main reason here is to not expose randomized start
    address. However, this is not ideal for detailed profiling (find hot
    instructions from stack traces). This patch replaces the page address
    with real prog start address.

    This change is OK because bpf_prog_get_info_by_fd() is only available
    to root.

    Signed-off-by: Song Liu
    Signed-off-by: Daniel Borkmann

    Song Liu
     
  • Currently, /proc/kallsyms shows page address of jited bpf program. The
    main reason here is to not expose randomized start address. However,
    This is not ideal for detailed profiling (find hot instructions from
    stack traces). This patch replaces the page address with real prog start
    address.

    This change is OK because these addresses are still protected by sysctl
    kptr_restrict (see kallsyms_show_value()), and only programs loaded by
    root are added to kallsyms (see bpf_prog_kallsyms_add()).

    Signed-off-by: Song Liu
    Signed-off-by: Daniel Borkmann

    Song Liu
     
  • Pull block layer fixes from Jens Axboe:
    "The biggest part of this pull request is the revert of the blkcg
    cleanup series. It had one fix earlier for a stacked device issue, but
    another one was reported. Rather than play whack-a-mole with this,
    revert the entire series and try again for the next kernel release.

    Apart from that, only small fixes/changes.

    Summary:

    - Indentation fixup for mtip32xx (Colin Ian King)

    - The blkcg cleanup series revert (Dennis Zhou)

    - Two NVMe fixes. One fixing a regression in the nvme request
    initialization in this merge window, causing nvme-fc to not work.
    The other is a suspend/resume p2p resource issue (James, Keith)

    - Fix sg discard merge, allowing us to merge in cases where we didn't
    before (Jianchao Wang)

    - Call rq_qos_exit() after the queue is frozen, preventing a hang
    (Ming)

    - Fix brd queue setup, fixing an oops if we fail setting up all
    devices (Ming)"

    * tag 'for-linus-20181102' of git://git.kernel.dk/linux-block:
    nvme-pci: fix conflicting p2p resource adds
    nvme-fc: fix request private initialization
    blkcg: revert blkcg cleanups series
    block: brd: associate with queue until adding disk
    block: call rq_qos_exit() after queue is frozen
    mtip32xx: clean an indentation issue, remove extraneous tabs
    block: fix the DISCARD request merge

    Linus Torvalds
     

02 Nov, 2018

4 commits

  • This reverts a series committed earlier due to null pointer exception
    bug report in [1]. It seems there are edge case interactions that I did
    not consider and will need some time to understand what causes the
    adverse interactions.

    The original series can be found in [2] with a follow up series in [3].

    [1] https://www.spinics.net/lists/cgroups/msg20719.html
    [2] https://lore.kernel.org/lkml/20180911184137.35897-1-dennisszhou@gmail.com/
    [3] https://lore.kernel.org/lkml/20181020185612.51587-1-dennis@kernel.org/

    This reverts the following commits:
    d459d853c2ed, b2c3fa546705, 101246ec02b5, b3b9f24f5fcc, e2b0989954ae,
    f0fcb3ec89f3, c839e7a03f92, bdc2491708c4, 74b7c02a9bc1, 5bf9a1f3b4ef,
    a7b39b4e961c, 07b05bcc3213, 49f4c2dc2b50, 27e6fa996c53

    Signed-off-by: Dennis Zhou
    Signed-off-by: Jens Axboe

    Dennis Zhou
     
  • Pull virtio/vhost updates from Michael Tsirkin:
    "Fixes and tweaks:

    - virtio balloon page hinting support

    - vhost scsi control queue

    - misc fixes"

    * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
    MAINTAINERS: remove reference to bogus vsock file
    vhost/scsi: Use common handling code in request queue handler
    vhost/scsi: Extract common handling code from control queue handler
    vhost/scsi: Respond to control queue operations
    vhost/scsi: truncate T10 PI iov_iter to prot_bytes
    virtio-balloon: VIRTIO_BALLOON_F_PAGE_POISON
    mm/page_poison: expose page_poisoning_enabled to kernel modules
    virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
    kvm_config: add CONFIG_VIRTIO_MENU

    Linus Torvalds
     
  • Pull stackleak gcc plugin from Kees Cook:
    "Please pull this new GCC plugin, stackleak, for v4.20-rc1. This plugin
    was ported from grsecurity by Alexander Popov. It provides efficient
    stack content poisoning at syscall exit. This creates a defense
    against at least two classes of flaws:

    - Uninitialized stack usage. (We continue to work on improving the
    compiler to do this in other ways: e.g. unconditional zero init was
    proposed to GCC and Clang, and more plugin work has started too).

    - Stack content exposure. By greatly reducing the lifetime of valid
    stack contents, exposures via either direct read bugs or unknown
    cache side-channels become much more difficult to exploit. This
    complements the existing buddy and heap poisoning options, but
    provides the coverage for stacks.

    The x86 hooks are included in this series (which have been reviewed by
    Ingo, Dave Hansen, and Thomas Gleixner). The arm64 hooks have already
    been merged through the arm64 tree (written by Laura Abbott and
    reviewed by Mark Rutland and Will Deacon).

    With VLAs having been removed this release, there is no need for
    alloca() protection, so it has been removed from the plugin"

    * tag 'stackleak-v4.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
    arm64: Drop unneeded stackleak_check_alloca()
    stackleak: Allow runtime disabling of kernel stack erasing
    doc: self-protection: Add information about STACKLEAK feature
    fs/proc: Show STACKLEAK metrics in the /proc file system
    lkdtm: Add a test for STACKLEAK
    gcc-plugins: Add STACKLEAK plugin for tracking the kernel stack
    x86/entry: Add STACKLEAK erasing the kernel stack at the end of syscalls

    Linus Torvalds
     
  • Pull networking fixes from David Miller:

    1) BPF verifier fixes from Daniel Borkmann.

    2) HNS driver fixes from Huazhong Tan.

    3) FDB only works for ethernet devices, reject attempts to install FDB
    rules for others. From Ido Schimmel.

    4) Fix spectre V1 in vhost, from Jason Wang.

    5) Don't pass on-stack object to irq_set_affinity_hint() in mvpp2
    driver, from Marc Zyngier.

    6) Fix mlx5e checksum handling when RXFCS is enabled, from Eric
    Dumazet.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (49 commits)
    openvswitch: Fix push/pop ethernet validation
    net: stmmac: Fix stmmac_mdio_reset() when building stmmac as modules
    bpf: test make sure to run unpriv test cases in test_verifier
    bpf: add various test cases to test_verifier
    bpf: don't set id on after map lookup with ptr_to_map_val return
    bpf: fix partial copy of map_ptr when dst is scalar
    libbpf: Fix compile error in libbpf_attach_type_by_name
    kselftests/bpf: use ping6 as the default ipv6 ping binary if it exists
    selftests: mlxsw: qos_mc_aware: Add a test for UC awareness
    selftests: mlxsw: qos_mc_aware: Tweak for min shaper
    mlxsw: spectrum: Set minimum shaper on MC TCs
    mlxsw: reg: QEEC: Add minimum shaper fields
    net: hns3: bugfix for rtnl_lock's range in the hclgevf_reset()
    net: hns3: bugfix for rtnl_lock's range in the hclge_reset()
    net: hns3: bugfix for handling mailbox while the command queue reinitialized
    net: hns3: fix incorrect return value/type of some functions
    net: hns3: bugfix for hclge_mdio_write and hclge_mdio_read
    net: hns3: bugfix for is_valid_csq_clean_head()
    net: hns3: remove unnecessary queue reset in the hns3_uninit_all_ring()
    net: hns3: bugfix for the initialization of command queue's spin lock
    ...

    Linus Torvalds