17 Mar, 2017

5 commits

  • Commit bfc8c90139eb ("mem-hotplug: implement get/put_online_mems")
    introduced new functions get/put_online_mems() and mem_hotplug_begin/end()
    in order to allow similar semantics for memory hotplug like for cpu
    hotplug.

    The corresponding functions for cpu hotplug are get/put_online_cpus()
    and cpu_hotplug_begin/done() for cpu hotplug.

    The commit however missed to introduce functions that would serialize
    memory hotplug operations like they are done for cpu hotplug with
    cpu_maps_update_begin/done().

    This basically leaves mem_hotplug.active_writer unprotected and allows
    concurrent writers to modify it, which may lead to problems as outlined
    by commit f931ab479dd2 ("mm: fix devm_memremap_pages crash, use
    mem_hotplug_{begin, done}").

    That commit was extended again with commit b5d24fda9c3d ("mm,
    devm_memremap_pages: hold device_hotplug lock over mem_hotplug_{begin,
    done}") which serializes memory hotplug operations for some call sites
    by using the device_hotplug lock.

    In addition with commit 3fc21924100b ("mm: validate device_hotplug is held
    for memory hotplug") a sanity check was added to mem_hotplug_begin() to
    verify that the device_hotplug lock is held.

    This in turn triggers the following warning on s390:

    WARNING: CPU: 6 PID: 1 at drivers/base/core.c:643 assert_held_device_hotplug+0x4a/0x58
    Call Trace:
    assert_held_device_hotplug+0x40/0x58)
    mem_hotplug_begin+0x34/0xc8
    add_memory_resource+0x7e/0x1f8
    add_memory+0xda/0x130
    add_memory_merged+0x15c/0x178
    sclp_detect_standby_memory+0x2ae/0x2f8
    do_one_initcall+0xa2/0x150
    kernel_init_freeable+0x228/0x2d8
    kernel_init+0x2a/0x140
    kernel_thread_starter+0x6/0xc

    One possible fix would be to add more lock_device_hotplug() and
    unlock_device_hotplug() calls around each call site of
    mem_hotplug_begin/end(). But that would give the device_hotplug lock
    additional semantics it better should not have (serialize memory hotplug
    operations).

    Instead add a new memory_add_remove_lock which has the similar semantics
    like cpu_add_remove_lock for cpu hotplug.

    To keep things hopefully a bit easier the lock will be locked and unlocked
    within the mem_hotplug_begin/end() functions.

    Link: http://lkml.kernel.org/r/20170314125226.16779-2-heiko.carstens@de.ibm.com
    Signed-off-by: Heiko Carstens
    Reported-by: Sebastian Ott
    Acked-by: Dan Williams
    Acked-by: Rafael J. Wysocki
    Cc: Michal Hocko
    Cc: Vladimir Davydov
    Cc: Ben Hutchings
    Cc: Gerald Schaefer
    Cc: Martin Schwidefsky
    Cc: Greg Kroah-Hartman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Heiko Carstens
     
  • When vmalloc() fails it prints a very lengthy message with all the
    details about memory consumption assuming that it happened due to OOM.

    However, vmalloc() can also fail due to fatal signal pending. In such
    case the message is quite confusing because it suggests that it is OOM
    but the numbers suggest otherwise. The messages can also pollute
    console considerably.

    Don't warn when vmalloc() fails due to fatal signal pending.

    Link: http://lkml.kernel.org/r/20170313114425.72724-1-dvyukov@google.com
    Signed-off-by: Dmitry Vyukov
    Reviewed-by: Matthew Wilcox
    Acked-by: Kirill A. Shutemov
    Acked-by: Michal Hocko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dmitry Vyukov
     
  • We still get a build error in random configurations, after this has been
    modified a few times:

    In file included from include/linux/mm.h:68:0,
    from include/linux/suspend.h:8,
    from arch/x86/kernel/asm-offsets.c:12:
    arch/x86/include/asm/pgtable.h:66:26: error: redefinition of 'native_pud_clear'
    #define pud_clear(pud) native_pud_clear(pud)

    My interpretation is that the build error comes from a typo in
    __PAGETABLE_PUD_FOLDED, so fix that typo now, and remove the incorrect
    #ifdef around the native_pud_clear definition.

    Fixes: 3e761a42e19c ("mm, x86: fix HIGHMEM64 && PARAVIRT build config for native_pud_clear()")
    Fixes: a00cc7d9dd93 ("mm, x86: add support for PUD-sized transparent hugepages")
    Link: http://lkml.kernel.org/r/20170314121330.182155-1-arnd@arndb.de
    Signed-off-by: Arnd Bergmann
    Ackedy-by: Dave Jiang
    Cc: Matthew Wilcox
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: Thomas Garnier
    Cc: Kees Cook
    Cc: Dave Hansen
    Cc: Hugh Dickins
    Cc: Borislav Petkov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arnd Bergmann
     
  • Add a prototype of task_struct to fix below warning on arm64.

    In file included from arch/arm64/kernel/probes/kprobes.c:19:0:
    include/linux/kasan.h:81:132: error: 'struct task_struct' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
    static inline void kasan_unpoison_task_stack(struct task_struct *task) {}

    As same as other types (kmem_cache, page, and vm_struct) this adds a
    prototype of task_struct data structure on top of kasan.h.

    [arnd] A related warning was fixed before, but now appears in a
    different line in the same file in v4.11-rc2. The patch from Masami
    Hiramatsu still seems appropriate, so let's take his version.

    Fixes: 71af2ed5eeea ("kasan, sched/headers: Remove from ")
    Link: https://patchwork.kernel.org/patch/9569839/
    Link: http://lkml.kernel.org/r/20170313141517.3397802-1-arnd@arndb.de
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Masami Hiramatsu
    Acked-by: Alexander Potapenko
    Acked-by: Andrey Ryabinin
    Cc: Dmitry Vyukov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masami Hiramatsu
     
  • Commmit 5a27aa822029 ("z3fold: add kref refcounting") introduced a bug
    in z3fold_reclaim_page() with function exit that may leave pool->lock
    spinlock held. Here comes the trivial fix.

    Fixes: 5a27aa822029 ("z3fold: add kref refcounting")
    Link: http://lkml.kernel.org/r/20170311222239.7b83d8e7ef1914e05497649f@gmail.com
    Reported-by: Alexey Khoroshilov
    Signed-off-by: Vitaly Wool
    Cc: Dan Streetman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vitaly Wool
     

16 Mar, 2017

4 commits

  • Pull block fixes from Jens Axboe:
    "Four small fixes for this cycle:

    - followup fix from Neil for a fix that went in before -rc2, ensuring
    that we always see the full per-task bio_list.

    - fix for blk-mq-sched from me that ensures that we retain similar
    direct-to-issue behavior on running the queue.

    - fix from Sagi fixing a potential NULL pointer dereference in blk-mq
    on spurious CPU unplug.

    - a memory leak fix in writeback from Tahsin, fixing a case where
    device removal of a mounted device can leak a struct
    wb_writeback_work"

    * 'for-linus' of git://git.kernel.dk/linux-block:
    blk-mq-sched: don't run the queue async from blk_mq_try_issue_directly()
    writeback: fix memory leak in wb_queue_work()
    blk-mq: Fix tagset reinit in the presence of cpu hot-unplug
    blk: Ensure users for current->bio_list can see the full list.

    Linus Torvalds
     
  • Pull SCSI fixes from James Bottomley:
    "This is a rather large set of fixes. The bulk are for lpfc correcting
    a lot of issues in the new NVME driver code which just went in in the
    merge window.

    The others are:

    - fix a hang in the vmware paravirt driver caused by incorrect
    handling of the new MSI vector allocation

    - long standing bug in storvsc, which recent block changes turned
    from being a harmless annoyance into a hang

    - yet more fallout (in mpt3sas) from the changes to device blocking

    The remainder are small fixes and updates"

    * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (34 commits)
    scsi: lpfc: Add shutdown method for kexec
    scsi: storvsc: Workaround for virtual DVD SCSI version
    scsi: lpfc: revise version number to 11.2.0.10
    scsi: lpfc: code cleanups in NVME initiator discovery
    scsi: lpfc: code cleanups in NVME initiator base
    scsi: lpfc: correct rdp diag portnames
    scsi: lpfc: remove dead sli3 nvme code
    scsi: lpfc: correct double print
    scsi: lpfc: Rename LPFC_MAX_EQ_DELAY to LPFC_MAX_EQ_DELAY_EQID_CNT
    scsi: lpfc: Rework lpfc Kconfig for NVME options
    scsi: lpfc: add transport eh_timed_out reference
    scsi: lpfc: Fix eh_deadline setting for sli3 adapters.
    scsi: lpfc: add NVME exchange aborts
    scsi: lpfc: Fix nvme allocation bug on failed nvme_fc_register_localport
    scsi: lpfc: Fix IO submission if WQ is full
    scsi: lpfc: Fix NVME CMD IU byte swapped word 1 problem
    scsi: lpfc: Fix RCTL value on NVME LS request and response
    scsi: lpfc: Fix crash during Hardware error recovery on SLI3 adapters
    scsi: lpfc: fix missing spin_unlock on sql_list_lock
    scsi: lpfc: don't dereference dma_buf->iocbq before null check
    ...

    Linus Torvalds
     
  • Pull gfs2 fix from Bob Peterson:
    "This is an emergency patch for 4.11-rc3

    The GFS2 developers uncovered a really nasty problem that can lead to
    random corruption and kernel panic, much like the last one. Andreas
    Gruenbacher wrote a simple one-line patch to fix the problem."

    * tag 'gfs2-4.11-rc3.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2:
    gfs2: Avoid alignment hole in struct lm_lockname

    Linus Torvalds
     
  • Pull crypto fixes from Herbert Xu:

    - self-test failure of crc32c on powerpc

    - regressions of ecb(aes) when used with xts/lrw in s5p-sss

    - a number of bugs in the omap RNG driver

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
    crypto: s5p-sss - Fix spinlock recursion on LRW(AES)
    hwrng: omap - Do not access INTMASK_REG on EIP76
    hwrng: omap - use devm_clk_get() instead of of_clk_get()
    hwrng: omap - write registers after enabling the clock
    crypto: s5p-sss - Fix completing crypto request in IRQ handler
    crypto: powerpc - Fix initialisation of crc32c context

    Linus Torvalds
     

15 Mar, 2017

19 commits

  • Commit 88ffbf3e03 switches to using rhashtables for glocks, hashing over
    the entire struct lm_lockname instead of its individual fields. On some
    architectures, struct lm_lockname contains a hole of uninitialized
    memory due to alignment rules, which now leads to incorrect hash values.
    Get rid of that hole.

    Signed-off-by: Andreas Gruenbacher
    Signed-off-by: Bob Peterson
    CC: #v4.3+

    Andreas Gruenbacher
     
  • Pull networking fixes from David Miller:

    1) Ensure that mtu is at least IPV6_MIN_MTU in ipv6 VTI tunnel driver,
    from Steffen Klassert.

    2) Fix crashes when user tries to get_next_key on an LPM bpf map, from
    Alexei Starovoitov.

    3) Fix detection of VLAN fitlering feature for bnx2x VF devices, from
    Michal Schmidt.

    4) We can get a divide by zero when TCP socket are morphed into
    listening state, fix from Eric Dumazet.

    5) Fix socket refcounting bugs in skb_complete_wifi_ack() and
    skb_complete_tx_timestamp(). From Eric Dumazet.

    6) Use after free in dccp_feat_activate_values(), also from Eric
    Dumazet.

    7) Like bonding team needs to use ETH_MAX_MTU as netdev->max_mtu, from
    Jarod Wilson.

    8) Fix use after free in vrf_xmit(), from David Ahern.

    9) Don't do UDP Fragmentation Offload on IPComp ipsec packets, from
    Alexey Kodanev.

    10) Properly check napi_complete_done() return value in order to decide
    whether to re-enable IRQs or not in amd-xgbe driver, from Thomas
    Lendacky.

    11) Fix double free of hwmon device in marvell phy driver, from Andrew
    Lunn.

    12) Don't crash on malformed netlink attributes in act_connmark, from
    Etienne Noss.

    13) Don't remove routes with a higher metric in ipv6 ECMP route replace,
    from Sabrina Dubroca.

    14) Don't write into a cloned SKB in ipv6 fragmentation handling, from
    Florian Westphal.

    15) Fix routing redirect races in dccp and tcp, basically the ICMP
    handler can't modify the socket's cached route in it's locked by the
    user at this moment. From Jon Maxwell.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (108 commits)
    qed: Enable iSCSI Out-of-Order
    qed: Correct out-of-bound access in OOO history
    qed: Fix interrupt flags on Rx LL2
    qed: Free previous connections when releasing iSCSI
    qed: Fix mapping leak on LL2 rx flow
    qed: Prevent creation of too-big u32-chains
    qed: Align CIDs according to DORQ requirement
    mlxsw: reg: Fix SPVMLR max record count
    mlxsw: reg: Fix SPVM max record count
    net: Resend IGMP memberships upon peer notification.
    dccp: fix memory leak during tear-down of unsuccessful connection request
    tun: fix premature POLLOUT notification on tun devices
    dccp/tcp: fix routing redirect race
    ucc/hdlc: fix two little issue
    vxlan: fix ovs support
    net: use net->count to check whether a netns is alive or not
    bridge: drop netfilter fake rtable unconditionally
    ipv6: avoid write to a possibly cloned skb
    net: wimax/i2400m: fix NULL-deref at probe
    isdn/gigaset: fix NULL-deref at probe
    ...

    Linus Torvalds
     
  • Pull cgroup fixes from Tejun Heo:
    "Three cgroup fixes. Nothing critical:

    - the pids controller could trigger suspicious RCU warning
    spuriously. Fixed.

    - in the debug controller, %p -> %pK to protect kernel pointer
    from getting exposed.

    - documentation formatting fix"

    * 'for-4.11-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
    cgroups: censor kernel pointer in debug files
    cgroup/pids: remove spurious suspicious RCU usage warning
    cgroup: Fix indenting in PID controller documentation

    Linus Torvalds
     
  • Pull libata fixes from Tejun Heo:
    "Three libata fixes:

    - fix for a circular reference bug in sysfs code which prevented
    pata_legacy devices from being released after probe failure, which
    in turn prevented devres from releasing the associated resources.

    - drop spurious WARN in the command issue path which can be triggered
    by a legitimate passthrough command.

    - an ahci_qoriq specific fix"

    * 'for-4.11-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata:
    ahci: qoriq: correct the sata ecc setting error
    libata: drop WARN from protocol error in ata_sff_qc_issue()
    libata: transport: Remove circular dependency at free time

    Linus Torvalds
     
  • Pull workqueue fix from Tejun Heo:
    "If a delayed work is queued with NULL @wq, workqueue code explodes
    after the timer expires at which point it's difficult to tell who the
    culprit was.

    This actually happened and the offender was net/smc this time.

    Add an explicit sanity check for it in the queueing path"

    * 'for-4.11-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
    workqueue: trigger WARN if queue_delayed_work() is called with NULL @wq

    Linus Torvalds
     
  • Pull percpu fixes from Tejun Heo:

    - the allocation path was updating pcpu_nr_empty_pop_pages without the
    required locking which can lead to incorrect handling of empty chunks
    (e.g. keeping too many around), which is buggy but shouldn't lead to
    critical failures. Fixed by adding the locking

    - a trivial patch to drop an unused param from pcpu_get_pages()

    * 'for-4.11-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu:
    percpu: remove unused chunk_alloc parameter from pcpu_get_pages()
    percpu: acquire pcpu_lock when updating pcpu_nr_empty_pop_pages

    Linus Torvalds
     
  • Yuval Mintz says:

    ====================
    qed: Fixes series

    This address several different issues in qed.
    The more significant portions:

    Patch #1 would cause timeout when qedr utilizes the highest
    CIDs availble for it [or when future qede adapters would utilize
    queues in some constellations].

    Patch #4 fixes a leak of mapped addresses; When iommu is enabled,
    offloaded storage protocols might eventually run out of resources
    and fail to map additional buffers.

    Patches #6,#7 were missing in the initial iSCSI infrastructure
    submissions, and would hamper qedi's stability when it reaches
    out-of-order scenarios.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Missing in the initial submission, qed fails to propagate qedi's
    request to enable OOO to firmware.

    Fixes: fc831825f99e ("qed: Add support for hardware offloaded iSCSI")
    Signed-off-by: Yuval Mintz
    Signed-off-by: David S. Miller

    Mintz, Yuval
     
  • Need to set the number of entries in database, otherwise the logic
    would quickly surpass the array.

    Fixes: 1d6cff4fca43 ("qed: Add iSCSI out of order packet handling")
    Signed-off-by: Yuval Mintz
    Signed-off-by: David S. Miller

    Mintz, Yuval
     
  • Before iterating over the the LL2 Rx ring, the ring's
    spinlock is taken via spin_lock_irqsave().
    The actual processing of the packet [including handling
    by the protocol driver] is done without said lock,
    so qed releases the spinlock and re-claims it afterwards.

    Problem is that the final spin_lock_irqrestore() at the end
    of the iteration uses the original flags saved from the
    initial irqsave() instead of the flags from the most recent
    irqsave(). So it's possible that the interrupt status would
    be incorrect at the end of the processing.

    Fixes: 0a7fb11c23c0 ("qed: Add Light L2 support");
    CC: Ram Amrani
    Signed-off-by: Yuval Mintz
    Signed-off-by: David S. Miller

    Ram Amrani
     
  • Fixes: fc831825f99e ("qed: Add support for hardware offloaded iSCSI")
    Signed-off-by: Yuval Mintz
    Signed-off-by: David S. Miller

    Mintz, Yuval
     
  • When receiving an Rx LL2 packet, qed fails to unmap the previous buffer.

    Fixes: 0a7fb11c23c0 ("qed: Add Light L2 support");
    Signed-off-by: Yuval Mintz
    Signed-off-by: David S. Miller

    Mintz, Yuval
     
  • Current Logic would allow the creation of a chain with U32_MAX + 1
    elements, when the actual maximum supported by the driver infrastructure
    is U32_MAX.

    Fixes: a91eb52abb50 ("qed: Revisit chain implementation")
    Signed-off-by: Tomer Tayar
    Signed-off-by: Yuval Mintz
    Signed-off-by: David S. Miller

    Tomer Tayar
     
  • The Doorbell HW block can be configured at a granularity
    of 16 x CIDs, so we need to make sure that the actual number
    of CIDs configured would be a multiplication of 16.

    Today, when RoCE is enabled - given that the number is unaligned,
    doorbelling the higher CIDs would fail to reach the firmware and
    would eventually timeout.

    Fixes: dbb799c39717 ("qed: Initialize hardware for new protocols")
    Signed-off-by: Ram Amrani
    Signed-off-by: Yuval Mintz
    Signed-off-by: David S. Miller

    Ram Amrani
     
  • Jiri Pirko says:

    ====================
    mlxsw: Couple of fixes

    Couple or small fixes.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • The num_rec field is 8 bit, so the maximal count number is 255.
    This fixes vlans learning not being enabled for wider ranges than 255.

    Fixes: a4feea74cd7a ("mlxsw: reg: Add Switch Port VLAN MAC Learning register definition")
    Signed-off-by: Jiri Pirko
    Reviewed-by: Ido Schimmel
    Signed-off-by: David S. Miller

    Jiri Pirko
     
  • The num_rec field is 8 bit, so the maximal count number is 255. This
    fixes vlans not being enabled for wider ranges than 255.

    Fixes: b2e345f9a454 ("mlxsw: reg: Add Switch Port VID and Switch Port VLAN Membership registers definitions")
    Signed-off-by: Jiri Pirko
    Reviewed-by: Ido Schimmel
    Signed-off-by: David S. Miller

    Jiri Pirko
     
  • When we notify peers of potential changes, it's also good to update
    IGMP memberships. For example, during VM migration, updating IGMP
    memberships will redirect existing multicast streams to the VM at the
    new location.

    Signed-off-by: Vladislav Yasevich
    Acked-by: Michael S. Tsirkin
    Signed-off-by: David S. Miller

    Vlad Yasevich
     
  • If we have scheduling enabled, we jump directly to insert-and-run.
    That's fine, but we run the queue async and we don't pass in information
    on whether we can block from this context or not. Fixup both these
    cases.

    Reviewed-by: Bart Van Assche
    Reviewed-by: Omar Sandoval
    Signed-off-by: Jens Axboe

    Jens Axboe
     

14 Mar, 2017

12 commits

  • This patch fixes a memory leak, which happens if the connection request
    is not fulfilled between parsing the DCCP options and handling the SYN
    (because e.g. the backlog is full), because we forgot to free the
    list of ack vectors.

    Reported-by: Jianwen Ji
    Signed-off-by: Hannes Frederic Sowa
    Signed-off-by: David S. Miller

    Hannes Frederic Sowa
     
  • aszlig observed failing ssh tunnels (-w) during initialization since
    commit cc9da6cc4f56e0 ("ipv6: addrconf: use stable address generator for
    ARPHRD_NONE"). We already had reports that the mentioned commit breaks
    Juniper VPN connections. I can't clearly say that the Juniper VPN client
    has the same problem, but it is worth a try to hint to this patch.

    Because of the early generation of link local addresses, the kernel now
    can start asking for routers on the local subnet much earlier than usual.
    Those router solicitation packets arrive inside the ssh channels and
    should be transmitted to the tun fd before the configuration scripts
    might have upped the interface and made it ready for transmission.

    ssh polls on the interface and receives back a POLL_OUT. It tries to send
    the earily router solicitation packet to the tun interface. Unfortunately
    it hasn't been up'ed yet by config scripts, thus failing with -EIO. ssh
    doesn't retry again and considers the tun interface broken forever.

    Link: https://bugzilla.kernel.org/show_bug.cgi?id=121131
    Fixes: cc9da6cc4f56 ("ipv6: addrconf: use stable address generator for ARPHRD_NONE")
    Cc: Bjørn Mork
    Reported-by: Valdis Kletnieks
    Cc: Valdis Kletnieks
    Reported-by: Jonas Lippuner
    Cc: Jonas Lippuner
    Reported-by: aszlig
    Cc: aszlig
    Signed-off-by: Hannes Frederic Sowa
    Signed-off-by: David S. Miller

    Hannes Frederic Sowa
     
  • As Eric Dumazet pointed out this also needs to be fixed in IPv6.
    v2: Contains the IPv6 tcp/Ipv6 dccp patches as well.

    We have seen a few incidents lately where a dst_enty has been freed
    with a dangling TCP socket reference (sk->sk_dst_cache) pointing to that
    dst_entry. If the conditions/timings are right a crash then ensues when the
    freed dst_entry is referenced later on. A Common crashing back trace is:

    #8 [] page_fault at ffffffff8163e648
    [exception RIP: __tcp_ack_snd_check+74]
    .
    .
    #9 [] tcp_rcv_established at ffffffff81580b64
    #10 [] tcp_v4_do_rcv at ffffffff8158b54a
    #11 [] tcp_v4_rcv at ffffffff8158cd02
    #12 [] ip_local_deliver_finish at ffffffff815668f4
    #13 [] ip_local_deliver at ffffffff81566bd9
    #14 [] ip_rcv_finish at ffffffff8156656d
    #15 [] ip_rcv at ffffffff81566f06
    #16 [] __netif_receive_skb_core at ffffffff8152b3a2
    #17 [] __netif_receive_skb at ffffffff8152b608
    #18 [] netif_receive_skb at ffffffff8152b690
    #19 [] vmxnet3_rq_rx_complete at ffffffffa015eeaf [vmxnet3]
    #20 [] vmxnet3_poll_rx_only at ffffffffa015f32a [vmxnet3]
    #21 [] net_rx_action at ffffffff8152bac2
    #22 [] __do_softirq at ffffffff81084b4f
    #23 [] call_softirq at ffffffff8164845c
    #24 [] do_softirq at ffffffff81016fc5
    #25 [] irq_exit at ffffffff81084ee5
    #26 [] do_IRQ at ffffffff81648ff8

    Of course it may happen with other NIC drivers as well.

    It's found the freed dst_entry here:

    224 static bool tcp_in_quickack_mode(struct sock *sk)↩
    225 {↩
    226 ▹ const struct inet_connection_sock *icsk = inet_csk(sk);↩
    227 ▹ const struct dst_entry *dst = __sk_dst_get(sk);↩
    228 ↩
    229 ▹ return (dst && dst_metric(dst, RTAX_QUICKACK)) ||↩
    230 ▹ ▹ (icsk->icsk_ack.quick && !icsk->icsk_ack.pingpong);↩
    231 }↩

    But there are other backtraces attributed to the same freed dst_entry in
    netfilter code as well.

    All the vmcores showed 2 significant clues:

    - Remote hosts behind the default gateway had always been redirected to a
    different gateway. A rtable/dst_entry will be added for that host. Making
    more dst_entrys with lower reference counts. Making this more probable.

    - All vmcores showed a postitive LockDroppedIcmps value, e.g:

    LockDroppedIcmps 267

    A closer look at the tcp_v4_err() handler revealed that do_redirect() will run
    regardless of whether user space has the socket locked. This can result in a
    race condition where the same dst_entry cached in sk->sk_dst_entry can be
    decremented twice for the same socket via:

    do_redirect()->__sk_dst_check()-> dst_release().

    Which leads to the dst_entry being prematurely freed with another socket
    pointing to it via sk->sk_dst_cache and a subsequent crash.

    To fix this skip do_redirect() if usespace has the socket locked. Instead let
    the redirect take place later when user space does not have the socket
    locked.

    The dccp/IPv6 code is very similar in this respect, so fixing it there too.

    As Eric Garver pointed out the following commit now invalidates routes. Which
    can set the dst->obsolete flag so that ipv4_dst_check() returns null and
    triggers the dst_release().

    Fixes: ceb3320610d6 ("ipv4: Kill routes during PMTU/redirect updates.")
    Cc: Eric Garver
    Cc: Hannes Sowa
    Signed-off-by: Jon Maxwell
    Signed-off-by: David S. Miller

    Jon Maxwell
     
  • 1. modify bd_status from u32 to u16 in function hdlc_rx_done,
    because bd_status register is 16bits
    2. write bd_length register before writing bd_status register

    Signed-off-by: Zhao Qiang
    Signed-off-by: David S. Miller

    Zhao Qiang
     
  • Pull some more powerpc fixes from Michael Ellerman:
    "The main item is the addition of the Power9 Machine Check handler.
    This was delayed to make sure some details were correct, and is as
    minimal as possible.

    The rest is small fixes, two for the Power9 PMU, two dealing with
    obscure toolchain problems, two for the PowerNV IOMMU code (used by
    VFIO), and one to fix a crash on 32-bit machines with macio devices
    due to missing dma_ops.

    Thanks to:
    Alexey Kardashevskiy, Cyril Bur, Larry Finger, Madhavan Srinivasan,
    Nicholas Piggin"

    * tag 'powerpc-4.11-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
    powerpc/64s: POWER9 machine check handler
    powerpc/64s: allow machine check handler to set severity and initiator
    powerpc/64s: fix handling of non-synchronous machine checks
    powerpc/pmac: Fix crash in dma-mapping.h with NULL dma_ops
    powerpc/powernv/ioda2: Update iommu table base on ownership change
    powerpc/powernv/ioda2: Gracefully fail if too many TCE levels requested
    selftests/powerpc: Replace stxvx and lxvx with stxvd2x/lxvd2x
    powerpc/perf: Handle sdar_mode for marked event in power9
    powerpc/perf: Fix perf_get_data_addr() for power9 DD1
    powerpc/boot: Fix zImage TOC alignment

    Linus Torvalds
     
  • The required changes in the function vxlan_dev_create() were missing
    in commit 8bcdc4f3a20b.
    The vxlan device is not registered anymore after this patch and the error
    path causes an stack dump:
    WARNING: CPU: 3 PID: 1498 at net/core/dev.c:6713 rollback_registered_many+0x9d/0x3f0

    Fixes: 8bcdc4f3a20b ("vxlan: add changelink support")
    CC: Roopa Prabhu
    Signed-off-by: Nicolas Dichtel
    Acked-by: Roopa Prabhu
    Signed-off-by: David S. Miller

    Nicolas Dichtel
     
  • The previous idea was to check whether a net namespace is in
    net_exit_list or not. It doesn't work, because net->exit_list is used in
    __register_pernet_operations and __unregister_pernet_operations where
    all namespaces are added to a temporary list to make cleanup in a error
    case, so list_empty(&net->exit_list) always returns false.

    Reported-by: Mantas Mikulėnas
    Fixes: 002d8a1a6c11 ("net: skip genenerating uevents for network namespaces that are exiting")
    Signed-off-by: Andrei Vagin
    Signed-off-by: David S. Miller

    Andrey Vagin
     
  • Pull x86 platform driver updates from Darren Hart:
    "Asus fixes for the airplane LED and a long awaited fujitsu cleanup.

    asus-wmi:
    - Remove quirk_no_rfkill
    - Detect quirk_no_rfkill from the DSDT

    fujitsu-laptop:
    - remove redundant MODULE_ALIAS entries
    - autodetect LCD interface on all models
    - simplify acpi_bus_register_driver() error handling
    - remove redundant forward declarations
    - replace numeric values with constants
    - rename FUNC_RFKILL to FUNC_FLAGS
    - make platform-related variables match naming convention
    - replace "hotkey" with "laptop" in symbol names
    - clearly denote backlight-related symbols"

    * tag 'platform-drivers-x86-v4.11-2' of git://git.infradead.org/linux-platform-drivers-x86:
    platform/x86: asus-wmi: Remove quirk_no_rfkill
    platform/x86: asus-wmi: Detect quirk_no_rfkill from the DSDT
    platform/x86: fujitsu-laptop: remove redundant MODULE_ALIAS entries
    platform/x86: fujitsu-laptop: autodetect LCD interface on all models
    platform/x86: fujitsu-laptop: simplify acpi_bus_register_driver() error handling
    platform/x86: fujitsu-laptop: remove redundant forward declarations
    platform/x86: fujitsu-laptop: replace numeric values with constants
    platform/x86: fujitsu-laptop: rename FUNC_RFKILL to FUNC_FLAGS
    platform/x86: fujitsu-laptop: make platform-related variables match naming convention
    platform/x86: fujitsu-laptop: replace "hotkey" with "laptop" in symbol names
    platform/x86: fujitsu-laptop: clearly denote backlight-related symbols

    Linus Torvalds
     
  • Andreas reports kernel oops during rmmod of the br_netfilter module.
    Hannes debugged the oops down to a NULL rt6info->rt6i_indev.

    Problem is that br_netfilter has the nasty concept of adding a fake
    rtable to skb->dst; this happens in a br_netfilter prerouting hook.

    A second hook (in bridge LOCAL_IN) is supposed to remove these again
    before the skb is handed up the stack.

    However, on module unload hooks get unregistered which means an
    skb could traverse the prerouting hook that attaches the fake_rtable,
    while the 'fake rtable remove' hook gets removed from the hooklist
    immediately after.

    Fixes: 34666d467cbf1e2e3c7 ("netfilter: bridge: move br_netfilter out of the core")
    Reported-by: Andreas Karis
    Debugged-by: Hannes Frederic Sowa
    Signed-off-by: Florian Westphal
    Acked-by: Pablo Neira Ayuso
    Signed-off-by: David S. Miller

    Florian Westphal
     
  • ip6_fragment, in case skb has a fraglist, checks if the
    skb is cloned. If it is, it will move to the 'slow path' and allocates
    new skbs for each fragment.

    However, right before entering the slowpath loop, it updates the
    nexthdr value of the last ipv6 extension header to NEXTHDR_FRAGMENT,
    to account for the fragment header that will be inserted in the new
    ipv6-fragment skbs.

    In case original skb is cloned this munges nexthdr value of another
    skb. Avoid this by doing the nexthdr update for each of the new fragment
    skbs separately.

    This was observed with tcpdump on a bridge device where netfilter ipv6
    reassembly is active: tcpdump shows malformed fragment headers as
    the l4 header (icmpv6, tcp, etc). is decoded as a fragment header.

    Cc: Hannes Frederic Sowa
    Reported-by: Andreas Karis
    Signed-off-by: Florian Westphal
    Signed-off-by: David S. Miller

    Florian Westphal
     
  • Make sure to check the number of endpoints to avoid dereferencing a
    NULL-pointer or accessing memory beyond the endpoint array should a
    malicious device lack the expected endpoints.

    The endpoints are specifically dereferenced in the i2400m_bootrom_init
    path during probe (e.g. in i2400mu_tx_bulk_out).

    Fixes: f398e4240fce ("i2400m/USB: probe/disconnect, dev init/shutdown
    and reset backends")
    Cc: Inaky Perez-Gonzalez

    Signed-off-by: Johan Hovold
    Signed-off-by: David S. Miller

    Johan Hovold
     
  • Make sure to check the number of endpoints to avoid dereferencing a
    NULL-pointer should a malicious device lack endpoints.

    Fixes: cf7776dc05b8 ("[PATCH] isdn4linux: Siemens Gigaset drivers -
    direct USB connection")
    Cc: stable # 2.6.17
    Cc: Hansjoerg Lipp

    Signed-off-by: Johan Hovold
    Signed-off-by: David S. Miller

    Johan Hovold