02 Feb, 2016

1 commit

  • Pull networking fixes from David Miller:
    "This looks like a lot but it's a mixture of regression fixes as well
    as fixes for longer standing issues.

    1) Fix on-channel cancellation in mac80211, from Johannes Berg.

    2) Handle CHECKSUM_COMPLETE properly in xt_TCPMSS netfilter xtables
    module, from Eric Dumazet.

    3) Avoid infinite loop in UDP SO_REUSEPORT logic, also from Eric
    Dumazet.

    4) Avoid a NULL deref if we try to set SO_REUSEPORT after a socket is
    bound, from Craig Gallek.

    5) GRO key comparisons don't take lightweight tunnels into account,
    from Jesse Gross.

    6) Fix struct pid leak via SCM credentials in AF_UNIX, from Eric
    Dumazet.

    7) We need to set the rtnl_link_ops of ipv6 SIT tunnels before we
    register them, otherwise the NEWLINK netlink message is missing
    the proper attributes. From Thadeu Lima de Souza Cascardo.

    8) Several Spectrum chip bug fixes for mlxsw switch driver, from Ido
    Schimmel

    9) Handle fragments properly in ipv4 easly socket demux, from Eric
    Dumazet.

    10) Don't ignore the ifindex key specifier on ipv6 output route
    lookups, from Paolo Abeni"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (128 commits)
    tcp: avoid cwnd undo after receiving ECN
    irda: fix a potential use-after-free in ircomm_param_request
    net: tg3: avoid uninitialized variable warning
    net: nb8800: avoid uninitialized variable warning
    net: vxge: avoid unused function warnings
    net: bgmac: clarify CONFIG_BCMA dependency
    net: hp100: remove unnecessary #ifdefs
    net: davinci_cpdma: use dma_addr_t for DMA address
    ipv6/udp: use sticky pktinfo egress ifindex on connect()
    ipv6: enforce flowi6_oif usage in ip6_dst_lookup_tail()
    netlink: not trim skb for mmaped socket when dump
    vxlan: fix a out of bounds access in __vxlan_find_mac
    net: dsa: mv88e6xxx: fix port VLAN maps
    fib_trie: Fix shift by 32 in fib_table_lookup
    net: moxart: use correct accessors for DMA memory
    ipv4: ipconfig: avoid unused ic_proto_used symbol
    bnxt_en: Fix crash in bnxt_free_tx_skbs() during tx timeout.
    bnxt_en: Exclude rx_drop_pkts hw counter from the stack's rx_dropped counter.
    bnxt_en: Ring free response from close path should use completion ring
    net_sched: drr: check for NULL pointer in drr_dequeue
    ...

    Linus Torvalds
     

31 Jan, 2016

1 commit


30 Jan, 2016

10 commits

  • RFC 4015 section 3.4 says the TCP sender MUST refrain from
    reversing the congestion control state when the ACK signals
    congestion through the ECN-Echo flag. Currently we may not
    always do that when prior_ssthresh is reset upon receiving
    ACKs with ECE marks. This patch fixes that.

    Signed-off-by: Yuchung Cheng
    Signed-off-by: Neal Cardwell
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Yuchung Cheng
     
  • self->ctrl_skb is protected by self->spinlock, we should not
    access it out of the lock. Move the debugging printk inside.

    Reported-by: Dmitry Vyukov
    Cc: Samuel Ortiz
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    WANG Cong
     
  • Currently, the egress interface index specified via IPV6_PKTINFO
    is ignored by __ip6_datagram_connect(), so that RFC 3542 section 6.7
    can be subverted when the user space application calls connect()
    before sendmsg().
    Fix it by initializing properly flowi6_oif in connect() before
    performing the route lookup.

    Signed-off-by: Paolo Abeni
    Acked-by: Hannes Frederic Sowa
    Signed-off-by: David S. Miller

    Paolo Abeni
     
  • The current implementation of ip6_dst_lookup_tail basically
    ignore the egress ifindex match: if the saddr is set,
    ip6_route_output() purposefully ignores flowi6_oif, due
    to the commit d46a9d678e4c ("net: ipv6: Dont add RT6_LOOKUP_F_IFACE
    flag if saddr set"), if the saddr is 'any' the first route lookup
    in ip6_dst_lookup_tail fails, but upon failure a second lookup will
    be performed with saddr set, thus ignoring the ifindex constraint.

    This commit adds an output route lookup function variant, which
    allows the caller to specify lookup flags, and modify
    ip6_dst_lookup_tail() to enforce the ifindex match on the second
    lookup via said helper.

    ip6_route_output() becames now a static inline function build on
    top of ip6_route_output_flags(); as a side effect, out-of-tree
    modules need now a GPL license to access the output route lookup
    functionality.

    Signed-off-by: Paolo Abeni
    Acked-by: Hannes Frederic Sowa
    Acked-by: David Ahern
    Signed-off-by: David S. Miller

    Paolo Abeni
     
  • We should not trim skb for mmaped socket since its buf size is fixed
    and userspace will read as frame which data equals head. mmaped
    socket will not call recvmsg, means max_recvmsg_len is 0,
    skb_reserve was not called before commit: db65a3aaf29e.

    Fixes: db65a3aaf29e (netlink: Trim skb to alloc size to avoid MSG_TRUNC)
    Signed-off-by: Ken-ichirou MATSUZAWA
    Signed-off-by: David S. Miller

    Ken-ichirou MATSUZAWA
     
  • The fib_table_lookup function had a shift by 32 that triggered a UBSAN
    warning. This was due to the fact that I had placed the shift first and
    then followed it with the check for the suffix length to ignore the
    undefined behavior. If we reorder this so that we verify the suffix is
    less than 32 before shifting the value we can avoid the issue.

    Reported-by: Toralf Förster
    Signed-off-by: Alexander Duyck
    Signed-off-by: David S. Miller

    Alexander Duyck
     
  • When CONFIG_PROC_FS, CONFIG_IP_PNP_BOOTP, CONFIG_IP_PNP_DHCP and
    CONFIG_IP_PNP_RARP are all disabled, we get a warning about the
    ic_proto_used variable being unused:

    net/ipv4/ipconfig.c:146:12: error: 'ic_proto_used' defined but not used [-Werror=unused-variable]

    This avoids the warning, by making the definition conditional on
    whether a dynamic IP configuration protocol is configured. If not,
    we know that the value is always zero, so we can optimize away the
    variable and all code that depends on it.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller

    Arnd Bergmann
     
  • There are cases where qdisc_dequeue_peeked can return NULL, and the result
    is dereferenced later on in the function.

    Similarly to the other qdisc dequeue functions, check whether the skb
    pointer is NULL and if it is, goto out.

    Signed-off-by: Bernie Harris
    Reviewed-by: Cong Wang
    Signed-off-by: David S. Miller

    Bernie Harris
     
  • In 'commit 7fe8097cef5f ("tipc: fix nullpointer bug when subscribing
    to events")', we terminate the connection if the subscription
    creation fails.
    In the same commit, the subscription creation result was based on
    the value of the subscription pointer (set in the function) instead
    of the return code.

    Unfortunately, the same function tipc_subscrp_create() handles
    subscription cancel request. For a subscription cancellation request,
    the subscription pointer cannot be set. Thus if a subscriber has
    several subscriptions and cancels any of them, the connection is
    terminated.

    In this commit, we terminate the connection based on the return value
    of tipc_subscrp_create().
    Fixes: commit 7fe8097cef5f ("tipc: fix nullpointer bug when subscribing to events")

    Reviewed-by: Jon Maloy
    Signed-off-by: Parthasarathy Bhuvaragan
    Signed-off-by: David S. Miller

    Parthasarathy Bhuvaragan
     
  • We should not assume a valid protocol header is present,
    as this is not the case for IPv4 fragments.

    Lets avoid extra cache line misses and potential bugs
    if we actually find a socket and incorrectly uses its dst.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

29 Jan, 2016

12 commits

  • The commit cad20c278085d893ebd616cd20c0747a8e9d53c7 was supposed to
    fix handling of devices first using public addresses and then
    switching to RPAs after pairing. Unfortunately it missed a couple of
    key places in the code.

    1. When evaluating which devices should be removed from the existing
    white list we also need to consider whether we have an IRK for them or
    not, i.e. a call to hci_find_irk_by_addr() is needed.

    2. In smp_notify_keys() we should not be requiring the knowledge of
    the RPA, but should simply keep the IRK around if the other conditions
    require it.

    Signed-off-by: Johan Hedberg
    Signed-off-by: Marcel Holtmann
    Cc: stable@vger.kernel.org # 4.4+

    Johan Hedberg
     
  • At least the l2cap_add_psm() routine depends on the source address
    type being properly set to know what auto-allocation ranges to use, so
    the assignment to l2cap_chan needs to happen before this.

    Signed-off-by: Johan Hedberg
    Signed-off-by: Marcel Holtmann

    Johan Hedberg
     
  • The LE dynamic PSM range is different from BR/EDR (0x0080 - 0x00ff)
    and doesn't have requirements relating to parity, so separate checks
    are needed.

    Signed-off-by: Johan Hedberg
    Signed-off-by: Marcel Holtmann

    Johan Hedberg
     
  • Having proper defines makes the code a bit readable, it also avoids
    duplicating hard-coded values since these are also needed when
    auto-allocating PSM values (in a subsequent patch).

    Signed-off-by: Johan Hedberg
    Signed-off-by: Marcel Holtmann

    Johan Hedberg
     
  • With some combinations of user provided flags in netlink command,
    it is possible to call tcp_get_info() with a buffer that is not 8-bytes
    aligned.

    It does matter on some arches, so we need to use put_unaligned() to
    store the u64 fields.

    Current iproute2 package does not trigger this particular issue.

    Fixes: 0df48c26d841 ("tcp: add tcpi_bytes_acked to tcp_info")
    Fixes: 977cb0ecf82e ("tcp: add pacing_rate information into tcp_info")
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • When switchdev drivers process FDB notifications from the underlying
    device they resolve the netdev to which the entry points to and notify
    the bridge using the switchdev notifier.

    However, since the RTNL mutex is not held there is nothing preventing
    the netdev from disappearing in the middle, which will cause
    br_switchdev_event() to dereference a non-existing netdev.

    Make switchdev drivers hold the lock at the beginning of the
    notification processing session and release it once it ends, after
    notifying the bridge.

    Also, remove switchdev_mutex and fdb_lock, as they are no longer needed
    when RTNL mutex is held.

    Fixes: 03bf0c281234 ("switchdev: introduce switchdev notifier")
    Signed-off-by: Ido Schimmel
    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel
     
  • …kernel/git/jberg/mac80211

    Johannes Berg says:

    ====================
    Here's a first set of fixes for the 4.5-rc cycle:
    * make regulatory messages much less verbose by default
    * various remain-on-channel fixes
    * scheduled scanning fixes with hardware restart
    * a PS-Poll handling fix; was broken just recently
    * bugfix to avoid buffering non-bufferable MMPDUs
    * world regulatory domain data fix
    * a fix for scanning causing other work to get stuck
    * hwsim: revert an older problematic patch that caused some
    userspace tools to have issues - not that big a deal as
    it's a debug only driver though
    ====================

    Signed-off-by: David S. Miller <davem@davemloft.net>

    David S. Miller
     
  • This commit fixes a corner case in tcp_mark_head_lost() which was
    causing the WARN_ON(len > skb->len) in tcp_fragment() to fire.

    tcp_mark_head_lost() was assuming that if a packet has
    tcp_skb_pcount(skb) of N, then it's safe to fragment off a prefix of
    M*mss bytes, for any M < N. But with the tricky way TCP pcounts are
    maintained, this is not always true.

    For example, suppose the sender sends 4 1-byte packets and have the
    last 3 packet sacked. It will merge the last 3 packets in the write
    queue into an skb with pcount = 3 and len = 3 bytes. If another
    recovery happens after a sack reneging event, tcp_mark_head_lost()
    may attempt to split the skb assuming it has more than 2*MSS bytes.

    This sounds very counterintuitive, but as the commit description for
    the related commit c0638c247f55 ("tcp: don't fragment SACKed skbs in
    tcp_mark_head_lost()") notes, this is because tcp_shifted_skb()
    coalesces adjacent regions of SACKed skbs, and when doing this it
    preserves the sum of their packet counts in order to reflect the
    real-world dynamics on the wire. The c0638c247f55 commit tried to
    avoid problems by not fragmenting SACKed skbs, since SACKed skbs are
    where the non-proportionality between pcount and skb->len/mss is known
    to be possible. However, that commit did not handle the case where
    during a reneging event one of these weird SACKed skbs becomes an
    un-SACKed skb, which tcp_mark_head_lost() can then try to fragment.

    The fix is to simply mark the entire skb lost when this happens.
    This makes the recovery slightly more aggressive in such corner
    cases before we detect reordering. But once we detect reordering
    this code path is by-passed because FACK is disabled.

    Signed-off-by: Neal Cardwell
    Signed-off-by: Yuchung Cheng
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Neal Cardwell
     
  • Later parts of the stack (including fragmentation) expect that there is
    never a socket attached to frag in a frag_list, however this invariant
    was not enforced on all defrag paths. This could lead to the
    BUG_ON(skb->sk) during ip_do_fragment(), as per the call stack at the
    end of this commit message.

    While the call could be added to openvswitch to fix this particular
    error, the head and tail of the frags list are already orphaned
    indirectly inside ip_defrag(), so it seems like the remaining fragments
    should all be orphaned in all circumstances.

    kernel BUG at net/ipv4/ip_output.c:586!
    [...]
    Call Trace:

    [] ? do_output.isra.29+0x1b0/0x1b0 [openvswitch]
    [] ovs_fragment+0xcc/0x214 [openvswitch]
    [] ? dst_discard_out+0x20/0x20
    [] ? dst_ifdown+0x80/0x80
    [] ? find_bucket.isra.2+0x62/0x70 [openvswitch]
    [] ? mod_timer_pending+0x65/0x210
    [] ? __lock_acquire+0x3db/0x1b90
    [] ? nf_conntrack_in+0x252/0x500 [nf_conntrack]
    [] ? __lock_is_held+0x54/0x70
    [] do_output.isra.29+0xe3/0x1b0 [openvswitch]
    [] do_execute_actions+0xe11/0x11f0 [openvswitch]
    [] ? __lock_is_held+0x54/0x70
    [] ovs_execute_actions+0x32/0xd0 [openvswitch]
    [] ovs_dp_process_packet+0x85/0x140 [openvswitch]
    [] ? __lock_is_held+0x54/0x70
    [] ovs_execute_actions+0xb2/0xd0 [openvswitch]
    [] ovs_dp_process_packet+0x85/0x140 [openvswitch]
    [] ? ovs_ct_get_labels+0x49/0x80 [openvswitch]
    [] ovs_vport_receive+0x5d/0xa0 [openvswitch]
    [] ? __lock_acquire+0x3db/0x1b90
    [] ? __lock_acquire+0x3db/0x1b90
    [] ? __lock_acquire+0x3db/0x1b90
    [] ? internal_dev_xmit+0x5/0x140 [openvswitch]
    [] internal_dev_xmit+0x6c/0x140 [openvswitch]
    [] ? internal_dev_xmit+0x5/0x140 [openvswitch]
    [] dev_hard_start_xmit+0x2b9/0x5e0
    [] ? netif_skb_features+0xd1/0x1f0
    [] __dev_queue_xmit+0x800/0x930
    [] ? __dev_queue_xmit+0x50/0x930
    [] ? mark_held_locks+0x71/0x90
    [] ? neigh_resolve_output+0x106/0x220
    [] dev_queue_xmit+0x10/0x20
    [] neigh_resolve_output+0x178/0x220
    [] ? ip_finish_output2+0x1ff/0x590
    [] ip_finish_output2+0x1ff/0x590
    [] ? ip_finish_output2+0x7e/0x590
    [] ip_do_fragment+0x831/0x8a0
    [] ? ip_copy_metadata+0x1b0/0x1b0
    [] ip_fragment.constprop.49+0x43/0x80
    [] ip_finish_output+0x17c/0x340
    [] ? nf_hook_slow+0xe4/0x190
    [] ip_output+0x70/0x110
    [] ? ip_fragment.constprop.49+0x80/0x80
    [] ip_local_out+0x39/0x70
    [] ip_send_skb+0x19/0x40
    [] ip_push_pending_frames+0x33/0x40
    [] icmp_push_reply+0xea/0x120
    [] icmp_reply.constprop.23+0x1ed/0x230
    [] icmp_echo.part.21+0x4e/0x50
    [] ? __lock_is_held+0x54/0x70
    [] ? rcu_read_lock_held+0x5e/0x70
    [] icmp_echo+0x36/0x70
    [] icmp_rcv+0x271/0x450
    [] ip_local_deliver_finish+0x127/0x3a0
    [] ? ip_local_deliver_finish+0x41/0x3a0
    [] ip_local_deliver+0x60/0xd0
    [] ? ip_rcv_finish+0x560/0x560
    [] ip_rcv_finish+0xdd/0x560
    [] ip_rcv+0x283/0x3e0
    [] ? match_held_lock+0x192/0x200
    [] ? inet_del_offload+0x40/0x40
    [] __netif_receive_skb_core+0x392/0xae0
    [] ? process_backlog+0x8e/0x230
    [] ? mark_held_locks+0x71/0x90
    [] __netif_receive_skb+0x18/0x60
    [] process_backlog+0x78/0x230
    [] ? process_backlog+0xdd/0x230
    [] net_rx_action+0x155/0x400
    [] __do_softirq+0xcc/0x420
    [] ? ip_finish_output2+0x217/0x590
    [] do_softirq_own_stack+0x1c/0x30

    [] do_softirq+0x4e/0x60
    [] __local_bh_enable_ip+0xa8/0xb0
    [] ip_finish_output2+0x240/0x590
    [] ? ip_do_fragment+0x831/0x8a0
    [] ip_do_fragment+0x831/0x8a0
    [] ? ip_copy_metadata+0x1b0/0x1b0
    [] ip_fragment.constprop.49+0x43/0x80
    [] ip_finish_output+0x17c/0x340
    [] ? nf_hook_slow+0xe4/0x190
    [] ip_output+0x70/0x110
    [] ? ip_fragment.constprop.49+0x80/0x80
    [] ip_local_out+0x39/0x70
    [] ip_send_skb+0x19/0x40
    [] ip_push_pending_frames+0x33/0x40
    [] raw_sendmsg+0x7d3/0xc30
    [] ? __lock_acquire+0x3db/0x1b90
    [] ? inet_sendmsg+0xc7/0x1d0
    [] ? __lock_is_held+0x54/0x70
    [] inet_sendmsg+0x10a/0x1d0
    [] ? inet_sendmsg+0x5/0x1d0
    [] sock_sendmsg+0x38/0x50
    [] ___sys_sendmsg+0x25f/0x270
    [] ? handle_mm_fault+0x8dd/0x1320
    [] ? _raw_spin_unlock+0x27/0x40
    [] ? __do_page_fault+0x1e2/0x460
    [] ? __fget_light+0x66/0x90
    [] __sys_sendmsg+0x42/0x80
    [] SyS_sendmsg+0x12/0x20
    [] entry_SYSCALL_64_fastpath+0x12/0x6f
    Code: 00 00 44 89 e0 e9 7c fb ff ff 4c 89 ff e8 e7 e7 ff ff 41 8b 9d 80 00 00 00 2b 5d d4 89 d8 c1 f8 03 0f b7 c0 e9 33 ff ff f
    66 66 66 2e 0f 1f 84 00 00 00 00 00 66 66 66 66 90 55 48
    RIP [] ip_do_fragment+0x892/0x8a0
    RSP

    Fixes: 7f8a436eaa2c ("openvswitch: Add conntrack action")
    Signed-off-by: Joe Stringer
    Signed-off-by: David S. Miller

    Joe Stringer
     
  • After we use refcnt to check if transport is alive, the dead can be
    removed from sctp_transport.

    The traversal of transport_addr_list in procfs dump is using
    list_for_each_entry_rcu, no need to check if it has been freed.

    sctp_generate_t3_rtx_event and sctp_generate_heartbeat_event is
    protected by sock lock, it's not necessary to check dead, either.
    also, the timers are cancelled when sctp_transport_free() is
    called, that it doesn't wait for refcnt to reach 0 to cancel them.

    Signed-off-by: Xin Long
    Signed-off-by: Marcelo Ricardo Leitner
    Signed-off-by: David S. Miller

    Xin Long
     
  • Previously, before rhashtable, /proc assoc listing was done by
    read-locking the entire hash entry and dumping all assocs at once, so we
    were sure that the assoc wasn't freed because it wouldn't be possible to
    remove it from the hash meanwhile.

    Now we use rhashtable to list transports, and dump entries one by one.
    That is, now we have to check if the assoc is still a good one, as the
    transport we got may be being freed.

    Signed-off-by: Xin Long
    Reviewed-by: Marcelo Ricardo Leitner
    Signed-off-by: David S. Miller

    Xin Long
     
  • Now when __sctp_lookup_association is running in BH, it will try to
    check if t->dead is set, but meanwhile other CPUs may be freeing this
    transport and this assoc and if it happens that
    __sctp_lookup_association checked t->dead a bit too early, it may think
    that the association is still good while it was already freed.

    So we fix this race by using atomic_add_unless in sctp_transport_hold.
    After we get one transport from hashtable, we will hold it only when
    this transport's refcnt is not 0, so that we can make sure t->asoc
    cannot be freed before we hold the asoc again.

    Note that sctp association is not freed using RCU so we can't use
    atomic_add_unless() with it as it may just be too late for that either.

    Fixes: 4f0087812648 ("sctp: apply rhashtable api to send/recv path")
    Reported-by: Vlad Yasevich
    Signed-off-by: Xin Long
    Signed-off-by: Marcelo Ricardo Leitner
    Signed-off-by: David S. Miller

    Xin Long
     

26 Jan, 2016

4 commits

  • The code within wait_event_interruptible() is called with
    !TASK_RUNNING, so mustn't call any functions that can sleep,
    like mutex_lock().

    Since we re-check the list_empty() in a loop after the wait,
    it's safe to simply use list_empty() without locking.

    This bug has existed forever, but was only discovered now
    because all userspace implementations, including the default
    'rfkill' tool, use poll() or select() to get a readable fd
    before attempting to read.

    Cc: stable@vger.kernel.org
    Fixes: c64fb01627e24 ("rfkill: create useful userspace interface")
    Reported-by: Dmitry Vyukov
    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • During a sw scan ieee80211_iface_work ignores work items for all vifs.
    However after the scan complete work is requeued only for STA, ADHOC
    and MESH iftypes.

    This occasionally results in event processing getting delayed/not
    processed for iftype AP when it coexists with a STA. This can result
    in data halt and eventually disconnection on the AP interface.

    Cc: stable@vger.kernel.org
    Signed-off-by: Sachin Kulkarni
    Signed-off-by: Johannes Berg

    Sachin Kulkarni
     
  • When creating a SIT tunnel with ip tunnel, rtnl_link_ops is not set before
    ipip6_tunnel_create is called. When register_netdevice is called, there is
    no linkinfo attribute in the NEWLINK message because of that.

    Setting rtnl_link_ops before calling register_netdevice fixes that.

    Signed-off-by: Thadeu Lima de Souza Cascardo
    Signed-off-by: David S. Miller

    Thadeu Lima de Souza Cascardo
     
  • The ESP algorithms using CBC mode require echainiv. Hence INET*_ESP have
    to select CRYPTO_ECHAINIV in order to work properly. This solves the
    issues caused by a misconfiguration as described in [1].
    The original approach, patching crypto/Kconfig was turned down by
    Herbert Xu [2].

    [1] https://lists.strongswan.org/pipermail/users/2015-December/009074.html
    [2] http://marc.info/?l=linux-crypto-vger&m=145224655809562&w=2

    Signed-off-by: Thomas Egerer
    Acked-by: Herbert Xu
    Signed-off-by: David S. Miller

    Thomas Egerer
     

25 Jan, 2016

4 commits

  • This patch extends commit b93d6471748d ("sctp: implement the sender side
    for SACK-IMMEDIATELY extension") as it didn't white list
    SCTP_SACK_IMMEDIATELY on sctp_msghdr_parse(), causing it to be
    understood as an invalid flag and returning -EINVAL to the application.

    Note that the actual handling of the flag is already there in
    sctp_datamsg_from_user().

    https://tools.ietf.org/html/rfc7053#section-7

    Fixes: b93d6471748d ("sctp: implement the sender side for SACK-IMMEDIATELY extension")
    Signed-off-by: Marcelo Ricardo Leitner
    Acked-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Marcelo Ricardo Leitner
     
  • Dmitry reported a struct pid leak detected by a syzkaller program.

    Bug happens in unix_stream_recvmsg() when we break the loop when a
    signal is pending, without properly releasing scm.

    Fixes: b3ca9b02b007 ("net: fix multithreaded signal handling in unix recv routines")
    Reported-by: Dmitry Vyukov
    Signed-off-by: Eric Dumazet
    Cc: Rainer Weikusat
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • Pull 9p updates from Eric Van Hensbergen:
    "Sorry for the last minute pull request, there's was a change that
    didn't get pulled into for-next until two weeks ago and I wanted to
    give it some bake time.

    Summary:

    Rework and error handling fixes, primarily in the fscatch and fd
    transports"

    * tag 'for-linus-4.5-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs:
    fs/9p: use fscache mutex rather than spinlock
    9p: trans_fd, bail out if recv fcall if missing
    9p: trans_fd, read rework to use p9_parse_header
    net/9p: Add device name details on error

    Linus Torvalds
     
  • Pull Ceph updates from Sage Weil:
    "The two main changes are aio support in CephFS, and a series that
    fixes several issues in the authentication key timeout/renewal code.

    On top of that are a variety of cleanups and minor bug fixes"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
    libceph: remove outdated comment
    libceph: kill off ceph_x_ticket_handler::validity
    libceph: invalidate AUTH in addition to a service ticket
    libceph: fix authorizer invalidation, take 2
    libceph: clear messenger auth_retry flag if we fault
    libceph: fix ceph_msg_revoke()
    libceph: use list_for_each_entry_safe
    ceph: use i_size_{read,write} to get/set i_size
    ceph: re-send AIO write request when getting -EOLDSNAP error
    ceph: Asynchronous IO support
    ceph: Avoid to propagate the invalid page point
    ceph: fix double page_unlock() in page_mkwrite()
    rbd: delete an unnecessary check before rbd_dev_destroy()
    libceph: use list_next_entry instead of list_entry_next
    ceph: ceph_frag_contains_value can be boolean
    ceph: remove unused functions in ceph_frag.h

    Linus Torvalds
     

24 Jan, 2016

2 commits

  • Pull rdma updates from Doug Ledford:
    "Initial roundup of 4.5 merge window patches

    - Remove usage of ib_query_device and instead store attributes in
    ib_device struct

    - Move iopoll out of block and into lib, rename to irqpoll, and use
    in several places in the rdma stack as our new completion queue
    polling library mechanism. Update the other block drivers that
    already used iopoll to use the new mechanism too.

    - Replace the per-entry GID table locks with a single GID table lock

    - IPoIB multicast cleanup

    - Cleanups to the IB MR facility

    - Add support for 64bit extended IB counters

    - Fix for netlink oops while parsing RDMA nl messages

    - RoCEv2 support for the core IB code

    - mlx4 RoCEv2 support

    - mlx5 RoCEv2 support

    - Cross Channel support for mlx5

    - Timestamp support for mlx5

    - Atomic support for mlx5

    - Raw QP support for mlx5

    - MAINTAINERS update for mlx4/mlx5

    - Misc ocrdma, qib, nes, usNIC, cxgb3, cxgb4, mlx4, mlx5 updates

    - Add support for remote invalidate to the iSER driver (pushed
    through the RDMA tree due to dependencies, acknowledged by nab)

    - Update to NFSoRDMA (pushed through the RDMA tree due to
    dependencies, acknowledged by Bruce)"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: (169 commits)
    IB/mlx5: Unify CQ create flags check
    IB/mlx5: Expose Raw Packet QP to user space consumers
    {IB, net}/mlx5: Move the modify QP operation table to mlx5_ib
    IB/mlx5: Support setting Ethernet priority for Raw Packet QPs
    IB/mlx5: Add Raw Packet QP query functionality
    IB/mlx5: Add create and destroy functionality for Raw Packet QP
    IB/mlx5: Refactor mlx5_ib_qp to accommodate other QP types
    IB/mlx5: Allocate a Transport Domain for each ucontext
    net/mlx5_core: Warn on unsupported events of QP/RQ/SQ
    net/mlx5_core: Add RQ and SQ event handling
    net/mlx5_core: Export transport objects
    IB/mlx5: Expose CQE version to user-space
    IB/mlx5: Add CQE version 1 support to user QPs and SRQs
    IB/mlx5: Fix data validation in mlx5_ib_alloc_ucontext
    IB/sa: Fix netlink local service GFP crash
    IB/srpt: Remove redundant wc array
    IB/qib: Improve ipoib UD performance
    IB/mlx4: Advertise RoCE v2 support
    IB/mlx4: Create and use another QP1 for RoCEv2
    IB/mlx4: Enable send of RoCE QP1 packets with IP/UDP headers
    ...

    Linus Torvalds
     
  • Pull final vfs updates from Al Viro:

    - The ->i_mutex wrappers (with small prereq in lustre)

    - a fix for too early freeing of symlink bodies on shmem (they need to
    be RCU-delayed) (-stable fodder)

    - followup to dedupe stuff merged this cycle

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    vfs: abort dedupe loop if fatal signals are pending
    make sure that freeing shmem fast symlinks is RCU-delayed
    wrappers for ->i_mutex access
    lustre: remove unused declaration

    Linus Torvalds
     

23 Jan, 2016

4 commits

  • This patch fixes incorrect handling of the 6lowpan packets that contain
    uncompressed IPv6 header.

    RFC4944 specifies a special dispatch for 6lowpan to carry uncompressed
    IPv6 header. This dispatch (1 byte long) has to be removed during
    reception and skb data pointer has to be moved. To correctly point in
    the beginning of the IPv6 header the dispatch byte has to be pulled off
    before packet can be processed by netif_rx_in().

    Test scenario: IPv6 packets are not correctly interpreted by the network
    layer when IPv6 header is not compressed (e.g. ICMPv6 Echo Reply is not
    propagated correctly to the ICMPv6 layer because the extra byte will make
    the header look corrupted).

    Similar approach is done for IEEE 802.15.4.

    Signed-off-by: Lukasz Duda
    Signed-off-by: Glenn Ruben Bakke
    Acked-by: Jukka Rissanen
    Signed-off-by: Johan Hedberg
    Cc: stable@vger.kernel.org # 4.4+

    Lukasz Duda
     
  • The fixes provided in this patch assigns a valid net_device structure to
    skb before dispatching it for further processing.

    Scenario #1:
    ============

    Bluetooth 6lowpan receives an uncompressed IPv6 header, and dispatches it
    to netif. The following error occurs:

    Null pointer dereference error #1 crash log:

    [ 845.854013] BUG: unable to handle kernel NULL pointer dereference at
    0000000000000048
    [ 845.855785] IP: [] enqueue_to_backlog+0x56/0x240
    ...
    [ 845.909459] Call Trace:
    [ 845.911678] [] netif_rx_internal+0x44/0xf0

    The first modification fixes the NULL pointer dereference error by
    assigning dev to the local_skb in order to set a valid net_device before
    processing the skb by netif_rx_ni().

    Scenario #2:
    ============

    Bluetooth 6lowpan receives an UDP compressed message which needs further
    decompression by nhc_udp. The following error occurs:

    Null pointer dereference error #2 crash log:

    [ 63.295149] BUG: unable to handle kernel NULL pointer dereference at
    0000000000000840
    [ 63.295931] IP: [] udp_uncompress+0x320/0x626
    [nhc_udp]

    The second modification fixes the NULL pointer dereference error by
    assigning dev to the local_skb in the case of a udp compressed packet.
    The 6lowpan udp_uncompress function expects that the net_device is set in
    the skb when checking lltype.

    Signed-off-by: Glenn Ruben Bakke
    Signed-off-by: Lukasz Duda
    Acked-by: Jukka Rissanen
    Signed-off-by: Johan Hedberg
    Cc: stable@vger.kernel.org # 4.4+

    Glenn Ruben Bakke
     
  • There are many locations that do

    if (memory_was_allocated_by_vmalloc)
    vfree(ptr);
    else
    kfree(ptr);

    but kvfree() can handle both kmalloc()ed memory and vmalloc()ed memory
    using is_vmalloc_addr(). Unless callers have special reasons, we can
    replace this branch with kvfree(). Please check and reply if you found
    problems.

    Signed-off-by: Tetsuo Handa
    Acked-by: Michal Hocko
    Acked-by: Jan Kara
    Acked-by: Russell King
    Reviewed-by: Andreas Dilger
    Acked-by: "Rafael J. Wysocki"
    Acked-by: David Rientjes
    Cc: "Luck, Tony"
    Cc: Oleg Drokin
    Cc: Boris Petkov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tetsuo Handa
     
  • parallel to mutex_{lock,unlock,trylock,is_locked,lock_nested},
    inode_foo(inode) being mutex_foo(&inode->i_mutex).

    Please, use those for access to ->i_mutex; over the coming cycle
    ->i_mutex will become rwsem, with ->lookup() done with it held
    only shared.

    Signed-off-by: Al Viro

    Al Viro
     

22 Jan, 2016

2 commits

  • Neal reported crashes with this stack trace :

    RIP: 0010:[] tcp_v4_send_ack+0x41/0x20f
    ...
    CR2: 0000000000000018 CR3: 000000044005c000 CR4: 00000000001427e0
    ...
    [] tcp_v4_reqsk_send_ack+0xa5/0xb4
    [] tcp_check_req+0x2ea/0x3e0
    [] tcp_rcv_state_process+0x850/0x2500
    [] tcp_v4_do_rcv+0x141/0x330
    [] sk_backlog_rcv+0x21/0x30
    [] tcp_recvmsg+0x75d/0xf90
    [] inet_recvmsg+0x80/0xa0
    [] sock_aio_read+0xee/0x110
    [] do_sync_read+0x6f/0xa0
    [] SyS_read+0x1e1/0x290
    [] system_call_fastpath+0x16/0x1b

    The problem here is the skb we provide to tcp_v4_send_ack() had to
    be parked in the backlog of a new TCP fastopen child because this child
    was owned by the user at the time an out of window packet arrived.

    Before queuing a packet, TCP has to set skb->dev to NULL as the device
    could disappear before packet is removed from the queue.

    Fix this issue by using the net pointer provided by the socket (being a
    timewait or a request socket).

    IPv6 is immune to the bug : tcp_v6_send_response() already gets the net
    pointer from the socket if provided.

    Fixes: 168a8f58059a ("tcp: TCP Fast Open Server - main code path")
    Reported-by: Neal Cardwell
    Signed-off-by: Eric Dumazet
    Cc: Jerry Chu
    Cc: Yuchung Cheng
    Acked-by: Neal Cardwell
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • MClientMount{,Ack} are long gone. The receipt of bare monmap doesn't
    actually indicate a mount success as we are yet to authenticate at that
    point in time.

    Signed-off-by: Ilya Dryomov

    Ilya Dryomov