22 Nov, 2016

2 commits

  • Exactly because for_each_thread() in autogroup_move_group() can't see it
    and update its ->sched_task_group before _put() and possibly free().

    So the exiting task needs another sched_move_task() before exit_notify()
    and we need to re-introduce the PF_EXITING (or similar) check removed by
    the previous change for another reason.

    Signed-off-by: Oleg Nesterov
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Linus Torvalds
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: hartsjc@redhat.com
    Cc: vbendel@redhat.com
    Cc: vlovejoy@redhat.com
    Link: http://lkml.kernel.org/r/20161114184612.GA15968@redhat.com
    Signed-off-by: Ingo Molnar

    Oleg Nesterov
     
  • Pull networking fixes from David Miller:

    1) Clear congestion control state when changing algorithms on an
    existing socket, from Florian Westphal.

    2) Fix register bit values in altr_tse_pcs portion of stmmac driver,
    from Jia Jie Ho.

    3) Fix PTP handling in stammc driver for GMAC4, from Giuseppe
    CAVALLARO.

    4) Fix udplite multicast delivery handling, it ignores the udp_table
    parameter passed into the lookups, from Pablo Neira Ayuso.

    5) Synchronize the space estimated by rtnl_vfinfo_size and the space
    actually used by rtnl_fill_vfinfo. From Sabrina Dubroca.

    6) Fix memory leak in fib_info when splitting nodes, from Alexander
    Duyck.

    7) If a driver does a napi_hash_del() explicitily and not via
    netif_napi_del(), it must perform RCU synchronization as needed. Fix
    this in virtio-net and bnxt drivers, from Eric Dumazet.

    8) Likewise, it is not necessary to invoke napi_hash_del() is we are
    also doing neif_napi_del() in the same code path. Remove such calls
    from be2net and cxgb4 drivers, also from Eric Dumazet.

    9) Don't allocate an ID in peernet2id_alloc() if the netns is dead,
    from WANG Cong.

    10) Fix OF node and device struct leaks in of_mdio, from Johan Hovold.

    11) We cannot cache routes in ip6_tunnel when using inherited traffic
    classes, from Paolo Abeni.

    12) Fix several crashes and leaks in cpsw driver, from Johan Hovold.

    13) Splice operations cannot use freezable blocking calls in AF_UNIX,
    from WANG Cong.

    14) Link dump filtering by master device and kind support added an error
    in loop index updates during the dump if we actually do filter, fix
    from Zhang Shengju.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (59 commits)
    tcp: zero ca_priv area when switching cc algorithms
    net: l2tp: Treat NET_XMIT_CN as success in l2tp_eth_dev_xmit
    ethernet: stmmac: make DWMAC_STM32 depend on it's associated SoC
    tipc: eliminate obsolete socket locking policy description
    rtnl: fix the loop index update error in rtnl_dump_ifinfo()
    l2tp: fix racy SOCK_ZAPPED flag check in l2tp_ip{,6}_bind()
    net: macb: add check for dma mapping error in start_xmit()
    rtnetlink: fix FDB size computation
    netns: fix get_net_ns_by_fd(int pid) typo
    af_unix: conditionally use freezable blocking calls in read
    net: ethernet: ti: cpsw: fix fixed-link phy probe deferral
    net: ethernet: ti: cpsw: add missing sanity check
    net: ethernet: ti: cpsw: fix secondary-emac probe error path
    net: ethernet: ti: cpsw: fix of_node and phydev leaks
    net: ethernet: ti: cpsw: fix deferred probe
    net: ethernet: ti: cpsw: fix mdio device reference leak
    net: ethernet: ti: cpsw: fix bad register access in probe error path
    net: sky2: Fix shutdown crash
    cfg80211: limit scan results cache size
    net sched filters: pass netlink message flags in event notification
    ...

    Linus Torvalds
     

20 Nov, 2016

2 commits

  • Pull KVM fixes from Radim Krčmář:
    "ARM:
    - Fix handling of the 32bit cycle counter
    - Fix cycle counter filtering

    x86:
    - Fix a race leading to double unregistering of user notifiers
    - Amend oversight in kvm_arch_set_irq that turned Hyper-V code dead
    - Use SRCU around kvm_lapic_set_vapic_addr
    - Avoid recursive flushing of asynchronous page faults
    - Do not rely on deferred update in KVM_GET_CLOCK, which fixes #GP
    - Let userspace know that KVM_GET_CLOCK is useful with master clock;
    4.9 changed the return value to better match the guest clock, but
    didn't provide means to let guests take advantage of it"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
    kvm: x86: merge kvm_arch_set_irq and kvm_arch_set_irq_inatomic
    KVM: x86: fix missed SRCU usage in kvm_lapic_set_vapic_addr
    KVM: async_pf: avoid recursive flushing of work items
    kvm: kvmclock: let KVM_GET_CLOCK return whether the master clock is in use
    KVM: Disable irq while unregistering user notifier
    KVM: x86: do not go through vcpu in __get_kvmclock_ns
    KVM: arm64: Fix the issues when guest PMCCFILTR is configured
    arm64: KVM: pmu: Fix AArch32 cycle counter access

    Linus Torvalds
     
  • Userspace can read the exact value of kvmclock by reading the TSC
    and fetching the timekeeping parameters out of guest memory. This
    however is brittle and not necessary anymore with KVM 4.11. Provide
    a mechanism that lets userspace know if the new KVM_GET_CLOCK
    semantics are in effect, and---since we are at it---if the clock
    is stable across all VCPUs.

    Cc: Radim Krčmář
    Cc: Marcelo Tosatti
    Signed-off-by: Paolo Bonzini
    Signed-off-by: Radim Krčmář

    Paolo Bonzini
     

19 Nov, 2016

4 commits

  • Pull ACPI fixes from Rafael Wysocki:
    "They fix an ACPI thermal management regression introduced by a recent
    FADT handling cleanup, an ACPI tools build issue introduced by a
    recent ACPICA commit and a PCC mailbox initialization bug causing
    lockdep to complain loudly.

    Specifics:

    - Revert a recent ACPICA cleanup that attempted to get rid of all
    FADT version 2 legacy, but broke ACPI thermal management on at
    least one system (Rafael Wysocki).

    - Fix cross-compiled builds of ACPI tools that stopped working after
    a recent cleanup related to the handling of header files in ACPICA
    (Lv Zheng).

    - Fix a locking issue in the PCC channel initialization code that
    invokes devm_request_irq() under a spinlock (among other things)
    and causes lockdep to complain (Hoan Tran)"

    * tag 'acpi-4.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    tools/power/acpi: Remove direct kernel source include reference
    mailbox: PCC: Fix lockdep warning when request PCC channel
    Revert "ACPICA: FADT support cleanup"

    Linus Torvalds
     
  • Pull nfsd bugfix from Bruce Fields:
    "Just one fix for an NFS/RDMA crash"

    * tag 'nfsd-4.9-2' of git://linux-nfs.org/~bfields/linux:
    sunrpc: svc_age_temp_xprts_now should not call setsockopt non-tcp transports

    Linus Torvalds
     
  • * acpica-fixes:
    Revert "ACPICA: FADT support cleanup"

    * acpi-cppc-fixes:
    mailbox: PCC: Fix lockdep warning when request PCC channel

    * acpi-tools-fixes:
    tools/power/acpi: Remove direct kernel source include reference

    Rafael J. Wysocki
     
  • The argument to get_net_ns_by_fd() is a /proc/$PID/ns/net file
    descriptor not a pid. Fix the typo.

    Signed-off-by: Stefan Hajnoczi
    Acked-by: Rami Rosen
    Signed-off-by: David S. Miller

    Stefan Hajnoczi
     

18 Nov, 2016

1 commit

  • Prior to 3.15, there was a race between zap_pte_range() and
    page_mkclean() where writes to a page could be lost. Dave Hansen
    discovered by inspection that there is a similar race between
    move_ptes() and page_mkclean().

    We've been able to reproduce the issue by enlarging the race window with
    a msleep(), but have not been able to hit it without modifying the code.
    So, we think it's a real issue, but is difficult or impossible to hit in
    practice.

    The zap_pte_range() issue is fixed by commit 1cf35d47712d("mm: split
    'tlb_flush_mmu()' into tlb flushing and memory freeing parts"). And
    this patch is to fix the race between page_mkclean() and mremap().

    Here is one possible way to hit the race: suppose a process mmapped a
    file with READ | WRITE and SHARED, it has two threads and they are bound
    to 2 different CPUs, e.g. CPU1 and CPU2. mmap returned X, then thread
    1 did a write to addr X so that CPU1 now has a writable TLB for addr X
    on it. Thread 2 starts mremaping from addr X to Y while thread 1
    cleaned the page and then did another write to the old addr X again.
    The 2nd write from thread 1 could succeed but the value will get lost.

    thread 1 thread 2
    (bound to CPU1) (bound to CPU2)

    1: write 1 to addr X to get a
    writeable TLB on this CPU

    2: mremap starts

    3: move_ptes emptied PTE for addr X
    and setup new PTE for addr Y and
    then dropped PTL for X and Y

    4: page laundering for N by doing
    fadvise FADV_DONTNEED. When done,
    pageframe N is deemed clean.

    5: *write 2 to addr X

    6: tlb flush for addr X

    7: munmap (Y, pagesize) to make the
    page unmapped

    8: fadvise with FADV_DONTNEED again
    to kick the page off the pagecache

    9: pread the page from file to verify
    the value. If 1 is there, it means
    we have lost the written 2.

    *the write may or may not cause segmentation fault, it depends on
    if the TLB is still on the CPU.

    Please note that this is only one specific way of how the race could
    occur, it didn't mean that the race could only occur in exact the above
    config, e.g. more than 2 threads could be involved and fadvise() could
    be done in another thread, etc.

    For anonymous pages, they could race between mremap() and page reclaim:
    THP: a huge PMD is moved by mremap to a new huge PMD, then the new huge
    PMD gets unmapped/splitted/pagedout before the flush tlb happened for
    the old huge PMD in move_page_tables() and we could still write data to
    it. The normal anonymous page has similar situation.

    To fix this, check for any dirty PTE in move_ptes()/move_huge_pmd() and
    if any, did the flush before dropping the PTL. If we did the flush for
    every move_ptes()/move_huge_pmd() call then we do not need to do the
    flush in move_pages_tables() for the whole range. But if we didn't, we
    still need to do the whole range flush.

    Alternatively, we can track which part of the range is flushed in
    move_ptes()/move_huge_pmd() and which didn't to avoid flushing the whole
    range in move_page_tables(). But that would require multiple tlb
    flushes for the different sub-ranges and should be less efficient than
    the single whole range flush.

    KBuild test on my Sandybridge desktop doesn't show any noticeable change.
    v4.9-rc4:
    real 5m14.048s
    user 32m19.800s
    sys 4m50.320s

    With this commit:
    real 5m13.888s
    user 32m19.330s
    sys 4m51.200s

    Reported-by: Dave Hansen
    Signed-off-by: Aaron Lu
    Signed-off-by: Linus Torvalds

    Aaron Lu
     

17 Nov, 2016

3 commits

  • Avoid breaking cross-compiled ACPI tools builds by rearranging the
    handling of kernel header files.

    This patch also contains OUTPUT/srctree cleanups in order to make above fix
    working for various build environments.

    Fixes: e323c02dee59 (ACPICA: MSVC9: Fix inclusion order issue)
    Reported-and-tested-by: Yisheng Xie
    Reported-by: Andy Shevchenko
    Signed-off-by: Lv Zheng
    [ rjw: Changelog ]
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     
  • The patch that removed the FIB offload infrastructure was a bit too
    aggressive and also removed code needed to clean up us splitting the table
    if additional rules were added. Specifically the function
    fib_trie_flush_external was called at the end of a new rule being added to
    flush the foreign trie entries from the main trie.

    I updated the code so that we only call fib_trie_flush_external on the main
    table so that we flush the entries for local from main. This way we don't
    call it for every rule change which is what was happening previously.

    Fixes: 347e3b28c1ba2 ("switchdev: remove FIB offload infrastructure")
    Reported-by: Eric Dumazet
    Cc: Jiri Pirko
    Signed-off-by: Alexander Duyck
    Acked-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Alexander Duyck
     
  • I made some invalid assumptions with BPF_AND and BPF_MOD that could result in
    invalid accesses to bpf map entries. Fix this up by doing a few things

    1) Kill BPF_MOD support. This doesn't actually get used by the compiler in real
    life and just adds extra complexity.

    2) Fix the logic for BPF_AND, don't allow AND of negative numbers and set the
    minimum value to 0 for positive AND's.

    3) Don't do operations on the ranges if they are set to the limits, as they are
    by definition undefined, and allowing arithmetic operations on those values
    could make them appear valid when they really aren't.

    This fixes the testcase provided by Jann as well as a few other theoretical
    problems.

    Reported-by: Jann Horn
    Signed-off-by: Josef Bacik
    Acked-by: Alexei Starovoitov
    Signed-off-by: David S. Miller

    Josef Bacik
     

16 Nov, 2016

1 commit

  • Rolf Neugebauer reported very long delays at netns dismantle.

    Eric W. Biederman was kind enough to look at this problem
    and noticed synchronize_net() occurring from netif_napi_del() that was
    added in linux-4.5

    Busy polling makes no sense for tunnels NAPI.
    If busy poll is used for sessions over tunnels, the poller will need to
    poll the physical device queue anyway.

    netif_tx_napi_add() could be used here, but function name is misleading,
    and renaming it is not stable material, so set NAPI_STATE_NO_BUSY_POLL
    bit directly.

    This will avoid inserting gro_cells napi structures in napi_hash[]
    and avoid the problematic synchronize_net() (per possible cpu) that
    Rolf reported.

    Fixes: 93d05d4a320c ("net: provide generic busy polling to all NAPI drivers")
    Signed-off-by: Eric Dumazet
    Reported-by: Rolf Neugebauer
    Reported-by: Eric W. Biederman
    Acked-by: Cong Wang
    Tested-by: Rolf Neugebauer
    Signed-off-by: David S. Miller

    Eric Dumazet
     

15 Nov, 2016

2 commits

  • Pull networking fixes from David Miller:

    1) Fix off by one wrt. indexing when dumping /proc/net/route entries,
    from Alexander Duyck.

    2) Fix lockdep splats in iwlwifi, from Johannes Berg.

    3) Cure panic when inserting certain netfilter rules when NFT_SET_HASH
    is disabled, from Liping Zhang.

    4) Memory leak when nft_expr_clone() fails, also from Liping Zhang.

    5) Disable UFO when path will apply IPSEC tranformations, from Jakub
    Sitnicki.

    6) Don't bogusly double cwnd in dctcp module, from Florian Westphal.

    7) skb_checksum_help() should never actually use the value "0" for the
    resulting checksum, that has a special meaning, use CSUM_MANGLED_0
    instead. From Eric Dumazet.

    8) Per-tx/rx queue statistic strings are wrong in qed driver, fix from
    Yuval MIntz.

    9) Fix SCTP reference counting of associations and transports in
    sctp_diag. From Xin Long.

    10) When we hit ip6tunnel_xmit() we could have come from an ipv4 path in
    a previous layer or similar, so explicitly clear the ipv6 control
    block in the skb. From Eli Cooper.

    11) Fix bogus sleeping inside of inet_wait_for_connect(), from WANG
    Cong.

    12) Correct deivce ID of T6 adapter in cxgb4 driver, from Hariprasad
    Shenai.

    13) Fix potential access past the end of the skb page frag array in
    tcp_sendmsg(). From Eric Dumazet.

    14) 'skb' can legitimately be NULL in inet{,6}_exact_dif_match(). Fix
    from David Ahern.

    15) Don't return an error in tcp_sendmsg() if we wronte any bytes
    successfully, from Eric Dumazet.

    16) Extraneous unlocks in netlink_diag_dump(), we removed the locking
    but forgot to purge these unlock calls. From Eric Dumazet.

    17) Fix memory leak in error path of __genl_register_family(). We leak
    the attrbuf, from WANG Cong.

    18) cgroupstats netlink policy table is mis-sized, from WANG Cong.

    19) Several XDP bug fixes in mlx5, from Saeed Mahameed.

    20) Fix several device refcount leaks in network drivers, from Johan
    Hovold.

    21) icmp6_send() should use skb dst device not skb->dev to determine L3
    routing domain. From David Ahern.

    22) ip_vs_genl_family sets maxattr incorrectly, from WANG Cong.

    23) We leak new macvlan port in some cases of maclan_common_netlink()
    errors. Fix from Gao Feng.

    24) Similar to the icmp6_send() fix, icmp_route_lookup() should
    determine L3 routing domain using skb_dst(skb)->dev not skb->dev.
    Also from David Ahern.

    25) Several fixes for route offloading and FIB notification handling in
    mlxsw driver, from Jiri Pirko.

    26) Properly cap __skb_flow_dissect()'s return value, from Eric Dumazet.

    27) Fix long standing regression in ipv4 redirect handling, wrt.
    validating the new neighbour's reachability. From Stephen Suryaputra
    Lin.

    28) If sk_filter() trims the packet excessively, handle it reasonably in
    tcp input instead of exploding. From Eric Dumazet.

    29) Fix handling of napi hash state when copying channels in sfc driver,
    from Bert Kenward.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (121 commits)
    mlxsw: spectrum_router: Flush FIB tables during fini
    net: stmmac: Fix lack of link transition for fixed PHYs
    sctp: change sk state only when it has assocs in sctp_shutdown
    bnx2: Wait for in-flight DMA to complete at probe stage
    Revert "bnx2: Reset device during driver initialization"
    ps3_gelic: fix spelling mistake in debug message
    net: ethernet: ixp4xx_eth: fix spelling mistake in debug message
    ibmvnic: Fix size of debugfs name buffer
    ibmvnic: Unmap ibmvnic_statistics structure
    sfc: clear napi_hash state when copying channels
    mlxsw: spectrum_router: Correctly dump neighbour activity
    mlxsw: spectrum: Fix refcount bug on span entries
    bnxt_en: Fix VF virtual link state.
    bnxt_en: Fix ring arithmetic in bnxt_setup_tc().
    Revert "include/uapi/linux/atm_zatm.h: include linux/time.h"
    tcp: take care of truncations done by sk_filter()
    ipv4: use new_gw for redirect neigh lookup
    r8152: Fix error path in open function
    net: bpqether.h: remove if_ether.h guard
    net: __skb_flow_dissect() must cap its return value
    ...

    Linus Torvalds
     
  • Pavel Machek reports that commit 6ea8c546f365 (ACPICA: FADT support
    cleanup) breaks thermal management on his Thinkpad X60 and T40p, so
    revert it.

    Link: https://bugzilla.kernel.org/show_bug.cgi?id=187311
    Fixes: 6ea8c546f365 (ACPICA: FADT support cleanup)
    Reported-by: Pavel Machek
    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

14 Nov, 2016

4 commits

  • This fixes the following panic that can occur with NFSoRDMA.

    general protection fault: 0000 [#1] SMP
    Modules linked in: rpcrdma ib_isert iscsi_target_mod ib_iser libiscsi
    scsi_transport_iscsi ib_srpt target_core_mod ib_srp scsi_transport_srp
    scsi_tgt ib_ipoib rdma_ucm ib_ucm ib_uverbs ib_umad rdma_cm ib_cm iw_cm
    mlx5_ib ib_core intel_powerclamp coretemp kvm_intel kvm sg ioatdma
    ipmi_devintf ipmi_ssif dcdbas iTCO_wdt iTCO_vendor_support pcspkr
    irqbypass sb_edac shpchp dca crc32_pclmul ghash_clmulni_intel edac_core
    lpc_ich aesni_intel lrw gf128mul glue_helper ablk_helper mei_me mei
    ipmi_si cryptd wmi ipmi_msghandler acpi_pad acpi_power_meter nfsd
    auth_rpcgss nfs_acl lockd grace sunrpc ip_tables xfs libcrc32c sd_mod
    crc_t10dif crct10dif_generic mgag200 i2c_algo_bit drm_kms_helper
    syscopyarea sysfillrect sysimgblt ahci fb_sys_fops ttm libahci mlx5_core
    tg3 crct10dif_pclmul drm crct10dif_common
    ptp i2c_core libata crc32c_intel pps_core fjes dm_mirror dm_region_hash
    dm_log dm_mod
    CPU: 1 PID: 120 Comm: kworker/1:1 Not tainted 3.10.0-514.el7.x86_64 #1
    Hardware name: Dell Inc. PowerEdge R320/0KM5PX, BIOS 2.4.2 01/29/2015
    Workqueue: events check_lifetime
    task: ffff88031f506dd0 ti: ffff88031f584000 task.ti: ffff88031f584000
    RIP: 0010:[] []
    _raw_spin_lock_bh+0x17/0x50
    RSP: 0018:ffff88031f587ba8 EFLAGS: 00010206
    RAX: 0000000000020000 RBX: 20041fac02080072 RCX: ffff88031f587fd8
    RDX: 0000000000000000 RSI: 0000000000000000 RDI: 20041fac02080072
    RBP: ffff88031f587bb0 R08: 0000000000000008 R09: ffffffff8155be77
    R10: ffff880322a59b00 R11: ffffea000bf39f00 R12: 20041fac02080072
    R13: 000000000000000d R14: ffff8800c4fbd800 R15: 0000000000000001
    FS: 0000000000000000(0000) GS:ffff880322a40000(0000)
    knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 00007f3c52d4547e CR3: 00000000019ba000 CR4: 00000000001407e0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    Stack:
    20041fac02080002 ffff88031f587bd0 ffffffff81557830 20041fac02080002
    ffff88031f587c78 ffff88031f587c40 ffffffff8155ae08 000000010157df32
    0000000800000001 ffff88031f587c20 ffffffff81096acb ffffffff81aa37d0
    Call Trace:
    [] lock_sock_nested+0x20/0x50
    [] sock_setsockopt+0x78/0x940
    [] ? lock_timer_base.isra.33+0x2b/0x50
    [] kernel_setsockopt+0x4d/0x50
    [] svc_age_temp_xprts_now+0x174/0x1e0 [sunrpc]
    [] nfsd_inetaddr_event+0x9d/0xd0 [nfsd]
    [] notifier_call_chain+0x4c/0x70
    [] __blocking_notifier_call_chain+0x4d/0x70
    [] blocking_notifier_call_chain+0x16/0x20
    [] __inet_del_ifa+0x168/0x2d0
    [] check_lifetime+0x25f/0x270
    [] process_one_work+0x17b/0x470
    [] worker_thread+0x126/0x410
    [] ? rescuer_thread+0x460/0x460
    [] kthread+0xcf/0xe0
    [] ? kthread_create_on_node+0x140/0x140
    [] ret_from_fork+0x58/0x90
    [] ? kthread_create_on_node+0x140/0x140
    Code: ca 75 f1 5d c3 0f 1f 80 00 00 00 00 eb d9 66 0f 1f 44 00 00 0f 1f
    44 00 00 55 48 89 e5 53 48 89 fb e8 7e 04 a0 ff b8 00 00 02 00 0f
    c1 03 89 c2 c1 ea 10 66 39 c2 75 03 5b 5d c3 83 e2 fe 0f
    RIP [] _raw_spin_lock_bh+0x17/0x50
    RSP

    Signed-off-by: Scott Mayhew
    Fixes: c3d4879e ("sunrpc: Add a function to close temporary transports immediately")
    Reviewed-by: Chuck Lever
    Signed-off-by: J. Bruce Fields

    Scott Mayhew
     
  • Pull USB / PHY fixes from Greg KH:
    "Here are a number of small USB and PHY driver fixes for 4.9-rc5

    Nothing major, just small fixes for reported issues, all of these have
    been in linux-next for a while with no reported issues"

    * tag 'usb-4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
    USB: cdc-acm: fix TIOCMIWAIT
    cdc-acm: fix uninitialized variable
    drivers/usb: Skip auto handoff for TI and RENESAS usb controllers
    usb: musb: remove duplicated actions
    usb: musb: da8xx: Don't print phy error on -EPROBE_DEFER
    phy: sun4i: check PMU presence when poking unknown bit of pmu
    phy-rockchip-pcie: remove deassert of phy_rst from exit callback
    phy: da8xx-usb: rename the ohci device to ohci-da8xx
    phy: Add reset callback for not generic phy
    uwb: fix device reference leaks
    usb: gadget: u_ether: remove interrupt throttling
    usb: dwc3: st: add missing include
    usb: dwc3: Fix error handling for core init

    Linus Torvalds
     
  • This reverts commit cf00713a655d ("include/uapi/linux/atm_zatm.h: include
    linux/time.h").

    This attempted to fix userspace breakage that no longer existed when
    the patch was merged. Almost one year earlier, commit 70ba07b675b5
    ("atm: remove 'struct zatm_t_hist'") deleted the struct in question.

    After this patch was merged, we now have to deal with people being
    unable to include this header in conjunction with standard C library
    headers like stdlib.h (which linux-atm does). Example breakage:
    x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../.. -I./../q2931 -I./../saal \
    -I. -DCPPFLAGS_TEST -I../../src/include -O2 -march=native -pipe -g \
    -frecord-gcc-switches -freport-bug -Wimplicit-function-declaration \
    -Wnonnull -Wstrict-aliasing -Wparentheses -Warray-bounds \
    -Wfree-nonheap-object -Wreturn-local-addr -fno-strict-aliasing -Wall \
    -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -c zntune.c
    In file included from /usr/include/linux/atm_zatm.h:17:0,
    from zntune.c:17:
    /usr/include/linux/time.h:9:8: error: redefinition of ‘struct timespec’
    struct timespec {
    ^
    In file included from /usr/include/sys/select.h:43:0,
    from /usr/include/sys/types.h:219,
    from /usr/include/stdlib.h:314,
    from zntune.c:9:
    /usr/include/time.h:120:8: note: originally defined here
    struct timespec
    ^

    Signed-off-by: Mike Frysinger
    Acked-by: Mikko Rapeli
    Signed-off-by: David S. Miller

    Mike Frysinger
     
  • With syzkaller help, Marco Grassi found a bug in TCP stack,
    crashing in tcp_collapse()

    Root cause is that sk_filter() can truncate the incoming skb,
    but TCP stack was not really expecting this to happen.
    It probably was expecting a simple DROP or ACCEPT behavior.

    We first need to make sure no part of TCP header could be removed.
    Then we need to adjust TCP_SKB_CB(skb)->end_seq

    Many thanks to syzkaller team and Marco for giving us a reproducer.

    Signed-off-by: Eric Dumazet
    Reported-by: Marco Grassi
    Reported-by: Vladis Dronov
    Signed-off-by: David S. Miller

    Eric Dumazet
     

13 Nov, 2016

2 commits

  • __LINUX_IF_ETHER_H is not defined anywhere, and if_ether.h can keep itself from
    double inclusion, though it uses a single underscore prefix.

    Signed-off-by: Baruch Siach
    Signed-off-by: David S. Miller

    Baruch Siach
     
  • If the bpf program calls bpf_redirect(dev, 0) and dev is
    an ipip/ip6tnl, it currently includes the mac header.
    e.g. If dev is ipip, the end result is IP-EthHdr-IP instead
    of IP-IP.

    The fix is to pull the mac header. At ingress, skb_postpull_rcsum()
    is not needed because the ethhdr should have been pulled once already
    and then got pushed back just before calling the bpf_prog.
    At egress, this patch calls skb_postpull_rcsum().

    If bpf_redirect(dev, BPF_F_INGRESS) is called,
    it also fails now because it calls dev_forward_skb() which
    eventually calls eth_type_trans(skb, dev). The eth_type_trans()
    will set skb->type = PACKET_OTHERHOST because the mac address
    does not match the redirecting dev->dev_addr. The PACKET_OTHERHOST
    will eventually cause the ip_rcv() errors out. To fix this,
    ____dev_forward_skb() is added.

    Joint work with Daniel Borkmann.

    Fixes: cfc7381b3002 ("ip_tunnel: add collect_md mode to IPIP tunnel")
    Fixes: 8d79266bc48c ("ip6_tunnel: add collect_md mode to IPv6 tunnels")
    Acked-by: Daniel Borkmann
    Acked-by: Alexei Starovoitov
    Signed-off-by: Martin KaFai Lau
    Signed-off-by: David S. Miller

    Martin KaFai Lau
     

12 Nov, 2016

8 commits

  • Pull ACPI fix from Rafael Wysocki:
    "Fix a recent regression in the 8250_dw serial driver introduced by
    adding a quirk for the APM X-Gene SoC to it which uncovered an issue
    related to the handling of built-in device properties in the core ACPI
    device enumeration code (Heikki Krogerus)"

    * tag 'acpi-4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    ACPI / platform: Add support for build-in properties

    Linus Torvalds
     
  • * device-properties:
    ACPI / platform: Add support for build-in properties

    Rafael J. Wysocki
     
  • Merge misc fixes from Andrew Morton:
    "15 fixes"

    * emailed patches from Andrew Morton :
    lib/stackdepot: export save/fetch stack for drivers
    mm: kmemleak: scan .data.ro_after_init
    memcg: prevent memcg caches to be both OFF_SLAB & OBJFREELIST_SLAB
    coredump: fix unfreezable coredumping task
    mm/filemap: don't allow partially uptodate page for pipes
    mm/hugetlb: fix huge page reservation leak in private mapping error paths
    ocfs2: fix not enough credit panic
    Revert "console: don't prefer first registered if DT specifies stdout-path"
    mm: hwpoison: fix thp split handling in memory_failure()
    swapfile: fix memory corruption via malformed swapfile
    mm/cma.c: check the max limit for cma allocation
    scripts/bloat-o-meter: fix SIGPIPE
    shmem: fix pageflags after swapping DMA32 object
    mm, frontswap: make sure allocated frontswap map is assigned
    mm: remove extra newline from allocation stall warning

    Linus Torvalds
     
  • Pull VFS fixes from Al Viro:
    "Christoph's and Jan's aio fixes, fixup for generic_file_splice_read
    (removal of pointless detritus that actually breaks it when used for
    gfs2 ->splice_read()) and fixup for generic_file_read_iter()
    interaction with ITER_PIPE destinations."

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    splice: remove detritus from generic_file_splice_read()
    mm/filemap: don't allow partially uptodate page for pipes
    aio: fix freeze protection of aio writes
    fs: remove aio_run_iocb
    fs: remove the never implemented aio_fsync file operation
    aio: hold an extra file reference over AIO read/write operations

    Linus Torvalds
     
  • Pull Ceph fixes from Ilya Dryomov:
    "Ceph's ->read_iter() implementation is incompatible with the new
    generic_file_splice_read() code that went into -rc1. Switch to the
    less efficient default_file_splice_read() for now; the proper fix is
    being held for 4.10.

    We also have a fix for a 4.8 regression and a trival libceph fixup"

    * tag 'ceph-for-4.9-rc5' of git://github.com/ceph/ceph-client:
    libceph: initialize last_linger_id with a large integer
    libceph: fix legacy layout decode with pool 0
    ceph: use default file splice read callback

    Linus Torvalds
     
  • Limit the number of kmemleak false positives by including
    .data.ro_after_init in memory scanning. To achieve this we need to add
    symbols for start and end of the section to the linker scripts.

    The problem was been uncovered by commit 56989f6d8568 ("genetlink: mark
    families as __ro_after_init").

    Link: http://lkml.kernel.org/r/1478274173-15218-1-git-send-email-jakub.kicinski@netronome.com
    Reviewed-by: Catalin Marinas
    Signed-off-by: Jakub Kicinski
    Cc: Arnd Bergmann
    Cc: Cong Wang
    Cc: Johannes Berg
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jakub Kicinski
     
  • This reverts commit 05fd007e4629 ("console: don't prefer first
    registered if DT specifies stdout-path").

    The reverted commit changes existing behavior on which many ARM boards
    rely. Many ARM small-board-computers, like e.g. the Raspberry Pi have
    both a video output and a serial console. Depending on whether the user
    is using the device as a more regular computer; or as a headless device
    we need to have the console on either one or the other.

    Many users rely on the kernel behavior of the console being present on
    both outputs, before the reverted commit the console setup with no
    console= kernel arguments on an ARM board which sets stdout-path in dt
    would look like this:

    [root@localhost ~]# cat /proc/consoles
    ttyS0 -W- (EC p a) 4:64
    tty0 -WU (E p ) 4:1

    Where as after the reverted commit, it looks like this:

    [root@localhost ~]# cat /proc/consoles
    ttyS0 -W- (EC p a) 4:64

    This commit reverts commit 05fd007e4629 ("console: don't prefer first
    registered if DT specifies stdout-path") restoring the original
    behavior.

    Fixes: 05fd007e4629 ("console: don't prefer first registered if DT specifies stdout-path")
    Link: http://lkml.kernel.org/r/20161104121135.4780-2-hdegoede@redhat.com
    Signed-off-by: Hans de Goede
    Cc: Paul Burton
    Cc: Rob Herring
    Cc: Frank Rowand
    Cc: Thorsten Leemhuis
    Cc: Greg Kroah-Hartman
    Cc: Tejun Heo
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hans de Goede
     
  • Christian Borntraeger reports:

    With commit 8ea1d2a1985a ("mm, frontswap: convert frontswap_enabled to
    static key") kmemleak complains about a memory leak in swapon

    unreferenced object 0x3e09ba56000 (size 32112640):
    comm "swapon", pid 7852, jiffies 4294968787 (age 1490.770s)
    hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    backtrace:
    __vmalloc_node_range+0x194/0x2d8
    vzalloc+0x58/0x68
    SyS_swapon+0xd60/0x12f8
    system_call+0xd6/0x270

    Turns out kmemleak is right. We now allocate the frontswap map
    depending on the kernel config (and no longer on the enablement)

    swapfile.c:
    [...]
    if (IS_ENABLED(CONFIG_FRONTSWAP))
    frontswap_map = vzalloc(BITS_TO_LONGS(maxpages) * sizeof(long));

    but later on this is passed along
    --> enable_swap_info(p, prio, swap_map, cluster_info, frontswap_map);

    and ignored if frontswap is disabled
    --> frontswap_init(p->type, frontswap_map);

    static inline void frontswap_init(unsigned type, unsigned long *map)
    {
    if (frontswap_enabled())
    __frontswap_init(type, map);
    }

    Thing is, that frontswap map is never freed.

    The leakage is relatively not that bad, because swapon is an infrequent
    and privileged operation. However, if the first frontswap backend is
    registered after a swap type has been already enabled, it will WARN_ON
    in frontswap_register_ops() and frontswap will not be available for the
    swap type.

    Fix this by making sure the map is assigned by frontswap_init() as long
    as CONFIG_FRONTSWAP is enabled.

    Fixes: 8ea1d2a1985a ("mm, frontswap: convert frontswap_enabled to static key")
    Link: http://lkml.kernel.org/r/20161026134220.2566-1-vbabka@suse.cz
    Signed-off-by: Vlastimil Babka
    Reported-by: Christian Borntraeger
    Cc: Konrad Rzeszutek Wilk
    Cc: Boris Ostrovsky
    Cc: David Vrabel
    Cc: Juergen Gross
    Cc: "Kirill A. Shutemov"
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vlastimil Babka
     

11 Nov, 2016

1 commit


10 Nov, 2016

4 commits

  • Pablo Neira Ayuso says:

    ====================
    Netfilter fixes for net

    The following patchset contains a larger than usual batch of Netfilter
    fixes for your net tree. This series contains a mixture of old bugs and
    recently introduced bugs, they are:

    1) Fix a crash when using nft_dynset with nft_set_rbtree, which doesn't
    support the set element updates from the packet path. From Liping
    Zhang.

    2) Fix leak when nft_expr_clone() fails, from Liping Zhang.

    3) Fix a race when inserting new elements to the set hash from the
    packet path, also from Liping.

    4) Handle segmented TCP SIP packets properly, basically avoid that the
    INVITE in the allow header create bogus expectations by performing
    stricter SIP message parsing, from Ulrich Weber.

    5) nft_parse_u32_check() should return signed integer for errors, from
    John Linville.

    6) Fix wrong allocation instead of connlabels, allocate 16 instead of
    32 bytes, from Florian Westphal.

    7) Fix compilation breakage when building the ip_vs_sync code with
    CONFIG_OPTIMIZE_INLINING on x86, from Arnd Bergmann.

    8) Destroy the new set if the transaction object cannot be allocated,
    also from Liping Zhang.

    9) Use device to route duplicated packets via nft_dup only when set by
    the user, otherwise packets may not follow the right route, again
    from Liping.

    10) Fix wrong maximum genetlink attribute definition in IPVS, from
    WANG Cong.

    11) Ignore untracked conntrack objects from xt_connmark, from Florian
    Westphal.

    12) Allow to use conntrack helpers that are registered NFPROTO_UNSPEC
    via CT target, otherwise we cannot use the h.245 helper, from
    Florian.

    13) Revisit garbage collection heuristic in the new workqueue-based
    timer approach for conntrack to evict objects earlier, again from
    Florian.

    14) Fix crash in nf_tables when inserting an element into a verdict map,
    from Liping Zhang.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • We have a couple of drivers, acpi_apd.c and acpi_lpss.c,
    that need to pass extra build-in properties to the devices
    they create. Previously the drivers added those properties
    to the struct device which is member of the struct
    acpi_device, but that does not work. Those properties need
    to be assigned to the struct device of the platform device
    instead in order for them to become available to the
    drivers.

    To fix this, this patch changes acpi_create_platform_device
    function to take struct property_entry pointer as parameter.

    Fixes: 20a875e2e86e (serial: 8250_dw: Add quirk for APM X-Gene SoC)
    Signed-off-by: Heikki Krogerus
    Tested-by: Yazen Ghannam
    Tested-by: Jérôme de Bretagne
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Rafael J. Wysocki

    Heikki Krogerus
     
  • Pull sound fixes from Takashi Iwai:
    "This became a largish pull-request, as we've got a bunch of pending
    ASoC fixes at this time. One noticeable change is the removal of error
    directive in uapi/sound/asoc.h. We found that the API has been already
    used on Chromebooks, so we need to support it even now.

    A slight big LOC is found in Qualcomm lpass driver, but the rest are
    all small and easy fixes for ASoC drivers (sti, sun4i, Realtek codecs,
    Intel, tas571x, etc) in addition to the patches to harden the ALSA
    core proc file accesses"

    * tag 'sound-4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (26 commits)
    ALSA: info: Return error for invalid read/write
    ALSA: info: Limit the proc text input size
    ASoC: samsung: spdif: Fix DMA filter initialization
    ASoC: sun4i-codec: Enable bus clock after getting GPIO
    ASoC: lpass-cpu: add module licence and description
    ASoC: lpass-platform: Fix broken pcm data usage
    ASoC: sun4i-codec: return error code instead of NULL when create_card fails
    ASoC: hdmi-codec: Fix hdmi_of_xlate_dai_name when #sound-dai-cells =
    ASoC: samsung: get access to DMA engine early to defer probe properly
    ASoC: da7219: Connect output enable register to DAIOUT
    ASoC: Intel: Skylake: Fix to turn off hdmi power on probe failure
    ASoC: sti-sas: enable fast io for regmap
    ASoC: sti: fix channel status update after playback start
    ASoC: PXA: Brownstone needs I2C
    ASoC: Intel: Skylake: Always acquire runtime pm ref on unload
    ASoC: Intel: Atom: add terminate entry for dmi_system_id tables
    ASoC: rt298: fix jack type detect error
    ASoC: rt5663: fix a debug statement
    ASoC: cs4270: fix DAPM stream name mismatch
    ASoC: Intel: haswell depends on sst-firmware
    ...

    Linus Torvalds
     
  • Pull s390 fixes from Martin Schwidefsky:
    "Two bug fixes

    - a memory alignment fix in the s390 only hypfs code

    - a fix for the generic percpu code that caused ftrace to break on
    s390. This is not relevant for x86 but for all architectures that
    use the generic percpu code"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
    percpu: use notrace variant of preempt_disable/preempt_enable
    s390/hypfs: Use get_free_page() instead of kmalloc to ensure page alignment

    Linus Torvalds
     

08 Nov, 2016

1 commit

  • Commit 345ddcc882d8 ("ftrace: Have set_ftrace_pid use the bitmap like
    events do") added a couple of this_cpu_read calls to the ftrace code.

    On x86 this is not a problem, since it has single instructions to read
    percpu data. Other architectures which use the generic variant now
    have additional preempt_disable and preempt_enable calls in the core
    ftrace code. This may lead to recursive calls and in result to a dead
    machine, e.g. if preemption and debugging options are enabled.

    To fix this use the notrace variant of preempt_disable and
    preempt_enable within the generic percpu code.

    Reported-and-bisected-by: Sebastian Ott
    Tested-by: Sebastian Ott
    Fixes: 345ddcc882d8 ("ftrace: Have set_ftrace_pid use the bitmap like events do")
    Signed-off-by: Heiko Carstens
    Acked-by: Steven Rostedt
    Signed-off-by: Martin Schwidefsky

    Heiko Carstens
     

07 Nov, 2016

1 commit

  • …on/linux-phy into usb-linus

    Kishon writes:

    phy: for 4.9 -rc

    phy fixes:
    *) Add a empty function for phy_reset when CONFIG_GENERIC_PHY is not set
    *) change the phy lookup table for da8xx-usb to match it with the name
    present in the board configuraion file (used for non-dt boot)
    *) Fix incorrect programming sequence in w.r.t deassert of phy_rst
    in phy-rockchip-pcie
    *) Fix to avoid NULL pointer dereferencing error in sun4i phy

    Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>

    Greg Kroah-Hartman
     

06 Nov, 2016

1 commit

  • Pull MTD fixes from Brian Norris:

    - MAINTAINERS updates to reflect some new maintainers/submaintainers.

    We have some great volunteers who've been developing and reviewing
    already. We're going to try a group maintainership model, so
    eventually you'll probably see pull requests from people besides me.

    - NAND fixes from Boris:
    "Three simple fixes:

    - fix a non-critical bug in the gpmi driver
    - fix a bug in the 'automatic NAND timings selection' feature
    introduced in 4.9-rc1
    - fix a false positive uninitialized-var warning"

    * tag 'for-linus-20161104' of git://git.infradead.org/linux-mtd:
    mtd: mtk: avoid warning in mtk_ecc_encode
    mtd: nand: Fix data interface configuration logic
    mtd: nand: gpmi: disable the clocks on errors
    MAINTAINERS: add more people to the MTD maintainer team
    MAINTAINERS: add a maintainer for the SPI NOR subsystem

    Linus Torvalds
     

05 Nov, 2016

3 commits

  • Add a dummy function for phy_reset in case the CONFIG_GENERIC_PHY
    is disabled.

    Signed-off-by: Randy Li
    Signed-off-by: Kishon Vijay Abraham I

    Randy Li
     
  • Pull drm fixes from Dave Airlie:
    "Fixes for amdgpu, radeon, intel, imx and virtio-gpu.

    This is a bit larger than I'd like, but I had some stuff I meant to
    send for -rc3 but was waiting for the PAT regression fix to land. So
    this is really fixes for rc3 and rc4 in one go.

    There are a set of fixes for an oops we've been seeing around MST
    display unplug, along with more suspend/resume and shutdown fixes for
    amdgpu, one power management follow on fix for nouveau, and set of imx
    fixes, and a single virtio-gpu regression fix"

    * tag 'drm-fixes-for-v4.9-rc4' of git://people.freedesktop.org/~airlied/linux: (54 commits)
    virtio-gpu: fix vblank events
    drm/nouveau/acpi: fix check for power resources support
    drm/i915: Fix SKL+ 90/270 degree rotated plane coordinate computation
    drm/i915: Remove two invalid warns
    drm/i915: Rotated view does not need a fence
    drm/i915/fbc: fix CFB size calculation for gen8+
    drm: i915: Wait for fences on new fb, not old
    drm/i915: Clean up DDI DDC/AUX CH sanitation
    drm/i915: Respect alternate_aux_channel for all DDI ports
    drm/i915/gen9: fix watermarks when using the pipe scaler
    drm/i915: Fix mismatched INIT power domain disabling during suspend
    drm/i915: fix a read size argument
    drm/i915: Use fence_write() from rpm resume
    drm/i915/gen9: fix DDB partitioning for multi-screen cases
    drm/i915: workaround sparse warning on variable length arrays
    drm/i915: keep declarations in i915_drv.h
    drm/amd/powerplay: fix bug get wrong evv voltage of Polaris.
    drm/amdgpu/si_dpm: workaround for SI kickers
    drm/radeon/si_dpm: workaround for SI kickers
    drm/amdgpu: fix s3 resume back, uvd dpm randomly can't disable.
    ...

    Linus Torvalds
     
  • Mark Brown