13 Apr, 2014

3 commits

  • Pull yet more networking updates from David Miller:

    1) Various fixes to the new Redpine Signals wireless driver, from
    Fariya Fatima.

    2) L2TP PPP connect code takes PMTU from the wrong socket, fix from
    Dmitry Petukhov.

    3) UFO and TSO packets differ in whether they include the protocol
    header in gso_size, account for that in skb_gso_transport_seglen().
    From Florian Westphal.

    4) If VLAN untagging fails, we double free the SKB in the bridging
    output path. From Toshiaki Makita.

    5) Several call sites of sk->sk_data_ready() were referencing an SKB
    just added to the socket receive queue in order to calculate the
    second argument via skb->len. This is dangerous because the moment
    the skb is added to the receive queue it can be consumed in another
    context and freed up.

    It turns out also that none of the sk->sk_data_ready()
    implementations even care about this second argument.

    So just kill it off and thus fix all these use-after-free bugs as a
    side effect.

    6) Fix inverted test in tcp_v6_send_response(), from Lorenzo Colitti.

    7) pktgen needs to do locking properly for LLTX devices, from Daniel
    Borkmann.

    8) xen-netfront driver initializes TX array entries in RX loop :-) From
    Vincenzo Maffione.

    9) After refactoring, some tunnel drivers allow a tunnel to be
    configured on top itself. Fix from Nicolas Dichtel.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (46 commits)
    vti: don't allow to add the same tunnel twice
    gre: don't allow to add the same tunnel twice
    drivers: net: xen-netfront: fix array initialization bug
    pktgen: be friendly to LLTX devices
    r8152: check RTL8152_UNPLUG
    net: sun4i-emac: add promiscuous support
    net/apne: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO
    net: ipv6: Fix oif in TCP SYN+ACK route lookup.
    drivers: net: cpsw: enable interrupts after napi enable and clearing previous interrupts
    drivers: net: cpsw: discard all packets received when interface is down
    net: Fix use after free by removing length arg from sk_data_ready callbacks.
    Drivers: net: hyperv: Address UDP checksum issues
    Drivers: net: hyperv: Negotiate suitable ndis version for offload support
    Drivers: net: hyperv: Allocate memory for all possible per-pecket information
    bridge: Fix double free and memory leak around br_allowed_ingress
    bonding: Remove debug_fs files when module init fails
    i40evf: program RSS LUT correctly
    i40evf: remove open-coded skb_cow_head
    ixgb: remove open-coded skb_cow_head
    igbvf: remove open-coded skb_cow_head
    ...

    Linus Torvalds
     
  • Before the patch, it was possible to add two times the same tunnel:
    ip l a vti1 type vti remote 10.16.0.121 local 10.16.0.249 key 41
    ip l a vti2 type vti remote 10.16.0.121 local 10.16.0.249 key 41

    It was possible, because ip_tunnel_newlink() calls ip_tunnel_find() with the
    argument dev->type, which was set only later (when calling ndo_init handler
    in register_netdevice()). Let's set this type in the setup handler, which is
    called before newlink handler.

    Introduced by commit b9959fd3b0fa ("vti: switch to new ip tunnel code").

    CC: Cong Wang
    CC: Steffen Klassert
    Signed-off-by: Nicolas Dichtel
    Signed-off-by: David S. Miller

    Nicolas Dichtel
     
  • Before the patch, it was possible to add two times the same tunnel:
    ip l a gre1 type gre remote 10.16.0.121 local 10.16.0.249
    ip l a gre2 type gre remote 10.16.0.121 local 10.16.0.249

    It was possible, because ip_tunnel_newlink() calls ip_tunnel_find() with the
    argument dev->type, which was set only later (when calling ndo_init handler
    in register_netdevice()). Let's set this type in the setup handler, which is
    called before newlink handler.

    Introduced by commit c54419321455 ("GRE: Refactor GRE tunneling code.").

    CC: Pravin B Shelar
    Signed-off-by: Nicolas Dichtel
    Signed-off-by: David S. Miller

    Nicolas Dichtel
     

12 Apr, 2014

5 commits

  • Similarly to commit 43279500deca ("packet: respect devices with
    LLTX flag in direct xmit"), we can basically apply the very same
    to pktgen. This will help testing against LLTX devices such as
    dummy driver (or others), which only have a single netdevice txq
    and would otherwise require locking their txq from pktgen side
    while e.g. in dummy case, we would not need any locking. Fix this
    by making use of HARD_TX_{UN,}LOCK API, so that NETIF_F_LLTX will
    be respected.

    Signed-off-by: Daniel Borkmann
    Signed-off-by: Jesper Dangaard Brouer
    Cc: Eric Dumazet
    Signed-off-by: David S. Miller

    Daniel Borkmann
     
  • Pull 9p changes from Eric Van Hensbergen:
    "A bunch of updates and cleanup within the transport layer,
    particularly with a focus on RDMA"

    * tag 'for-linus-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs:
    9pnet_rdma: check token type before int conversion
    9pnet: trans_fd : allocate struct p9_trans_fd and struct p9_conn together.
    9pnet: p9_client->conn field is unused. Remove it.
    9P: Get rid of REQ_STATUS_FLSH
    9pnet_rdma: add cancelled()
    9pnet_rdma: update request status during send
    9P: Add cancelled() to the transport functions.
    net: Mark function as static in 9p/client.c
    9P: Add memory barriers to protect request fields over cb/rpc threads handoff

    Linus Torvalds
     
  • net-next commit 9c76a11, ipv6: tcp_ipv6 policy route issue, had
    a boolean logic error that caused incorrect behaviour for TCP
    SYN+ACK when oif-based rules are in use. Specifically:

    1. If a SYN comes in from a global address, and sk_bound_dev_if
    is not set, the routing lookup has oif set to the interface
    the SYN came in on. Instead, it should have oif unset,
    because for global addresses, the incoming interface doesn't
    necessarily have any bearing on the interface the SYN+ACK is
    sent out on.
    2. If a SYN comes in from a link-local address, and
    sk_bound_dev_if is set, the routing lookup has oif set to the
    interface the SYN came in on. Instead, it should have oif set
    to sk_bound_dev_if, because that's what the application
    requested.

    Signed-off-by: Lorenzo Colitti
    Acked-by: Hannes Frederic Sowa
    Signed-off-by: David S. Miller

    Lorenzo Colitti
     
  • Several spots in the kernel perform a sequence like:

    skb_queue_tail(&sk->s_receive_queue, skb);
    sk->sk_data_ready(sk, skb->len);

    But at the moment we place the SKB onto the socket receive queue it
    can be consumed and freed up. So this skb->len access is potentially
    to freed up memory.

    Furthermore, the skb->len can be modified by the consumer so it is
    possible that the value isn't accurate.

    And finally, no actual implementation of this callback actually uses
    the length argument. And since nobody actually cared about it's
    value, lots of call sites pass arbitrary values in such as '0' and
    even '1'.

    So just remove the length argument from the callback, that way there
    is no confusion whatsoever and all of these use-after-free cases get
    fixed as a side effect.

    Based upon a patch by Eric Dumazet and his suggestion to audit this
    issue tree-wide.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • br_allowed_ingress() has two problems.

    1. If br_allowed_ingress() is called by br_handle_frame_finish() and
    vlan_untag() in br_allowed_ingress() fails, skb will be freed by both
    vlan_untag() and br_handle_frame_finish().

    2. If br_allowed_ingress() is called by br_dev_xmit() and
    br_allowed_ingress() fails, the skb will not be freed.

    Fix these two problems by freeing the skb in br_allowed_ingress()
    if it fails.

    Signed-off-by: Toshiaki Makita
    Signed-off-by: David S. Miller

    Toshiaki Makita
     

11 Apr, 2014

1 commit

  • In case of tcp, gso_size contains the tcpmss.

    For UFO (udp fragmentation offloading) skbs, gso_size is the fragment
    payload size, i.e. we must not account for udp header size.

    Otherwise, when using virtio drivers, a to-be-forwarded UFO GSO packet
    will be needlessly fragmented in the forward path, because we think its
    individual segments are too large for the outgoing link.

    Fixes: fe6cc55f3a9a053 ("net: ip, ipv6: handle gso skbs in forwarding path")
    Cc: Eric Dumazet
    Reported-by: Tobias Brunner
    Signed-off-by: Florian Westphal
    Signed-off-by: David S. Miller

    Florian Westphal
     

10 Apr, 2014

2 commits

  • When l2tp driver tries to get PMTU for the tunnel destination, it uses
    the pointer to struct sock that represents PPPoX socket, while it
    should use the pointer that represents UDP socket of the tunnel.

    Signed-off-by: Dmitry Petukhov
    Signed-off-by: David S. Miller

    Dmitry Petukhov
     
  • In function sctp_wake_up_waiters(), we need to involve a test
    if the association is declared dead. If so, we don't have any
    reference to a possible sibling association anymore and need
    to invoke sctp_write_space() instead, and normally walk the
    socket's associations and notify them of new wmem space. The
    reason for special casing is that otherwise, we could run
    into the following issue when a sctp_primitive_SEND() call
    from sctp_sendmsg() fails, and tries to flush an association's
    outq, i.e. in the following way:

    sctp_association_free()
    `-> list_del(&asoc->asocs) base.dead = true
    sctp_outq_free(&asoc->outqueue)
    `-> __sctp_outq_teardown()
    `-> sctp_chunk_free()
    `-> consume_skb()
    `-> sctp_wfree()
    `-> sctp_wake_up_waiters() ep->sndbuf_policy=0

    Therefore, only walk the list in an 'optimized' way if we find
    that the current association is still active. We could also use
    list_del_init() in addition when we call sctp_association_free(),
    but as Vlad suggests, we want to trap such bugs and thus leave
    it poisoned as is.

    Why is it safe to resolve the issue by testing for asoc->base.dead?
    Parallel calls to sctp_sendmsg() are protected under socket lock,
    that is lock_sock()/release_sock(). Only within that path under
    lock held, we're setting skb/chunk owner via sctp_set_owner_w().
    Eventually, chunks are freed directly by an association still
    under that lock. So when traversing association list on destruction
    time from sctp_wake_up_waiters() via sctp_wfree(), a different
    CPU can't be running sctp_wfree() while another one calls
    sctp_association_free() as both happens under the same lock.
    Therefore, this can also not race with setting/testing against
    asoc->base.dead as we are guaranteed for this to happen in order,
    under lock. Further, Vlad says: the times we check asoc->base.dead
    is when we've cached an association pointer for later processing.
    In between cache and processing, the association may have been
    freed and is simply still around due to reference counts. We check
    asoc->base.dead under a lock, so it should always be safe to check
    and not race against sctp_association_free(). Stress-testing seems
    fine now, too.

    Fixes: cd253f9f357d ("net: sctp: wake up all assocs if sndbuf policy is per socket")
    Signed-off-by: Daniel Borkmann
    Cc: Vlad Yasevich
    Acked-by: Neil Horman
    Acked-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Daniel Borkmann
     

09 Apr, 2014

4 commits

  • Pull nfsd updates from Bruce Fields:
    "Highlights:
    - server-side nfs/rdma fixes from Jeff Layton and Tom Tucker
    - xdr fixes (a larger xdr rewrite has been posted but I decided it
    would be better to queue it up for 3.16).
    - miscellaneous fixes and cleanup from all over (thanks especially to
    Kinglong Mee)"

    * 'for-3.15' of git://linux-nfs.org/~bfields/linux: (36 commits)
    nfsd4: don't create unnecessary mask acl
    nfsd: revert v2 half of "nfsd: don't return high mode bits"
    nfsd4: fix memory leak in nfsd4_encode_fattr()
    nfsd: check passed socket's net matches NFSd superblock's one
    SUNRPC: Clear xpt_bc_xprt if xs_setup_bc_tcp failed
    NFSD/SUNRPC: Check rpc_xprt out of xs_setup_bc_tcp
    SUNRPC: New helper for creating client with rpc_xprt
    NFSD: Free backchannel xprt in bc_destroy
    NFSD: Clear wcc data between compound ops
    nfsd: Don't return NFS4ERR_STALE_STATEID for NFSv4.1+
    nfsd4: fix nfs4err_resource in 4.1 case
    nfsd4: fix setclientid encode size
    nfsd4: remove redundant check from nfsd4_check_resp_size
    nfsd4: use more generous NFS4_ACL_MAX
    nfsd4: minor nfsd4_replay_cache_entry cleanup
    nfsd4: nfsd4_replay_cache_entry should be static
    nfsd4: update comments with obsolete function name
    rpc: Allow xdr_buf_subsegment to operate in-place
    NFSD: Using free_conn free connection
    SUNRPC: fix memory leak of peer addresses in XPRT
    ...

    Linus Torvalds
     
  • Pull more networking updates from David Miller:

    1) If a VXLAN interface is created with no groups, we can crash on
    reception of packets. Fix from Mike Rapoport.

    2) Missing includes in CPTS driver, from Alexei Starovoitov.

    3) Fix string validations in isdnloop driver, from YOSHIFUJI Hideaki
    and Dan Carpenter.

    4) Missing irq.h include in bnxw2x, enic, and qlcnic drivers. From
    Josh Boyer.

    5) AF_PACKET transmit doesn't statistically count TX drops, from Daniel
    Borkmann.

    6) Byte-Queue-Limit enabled drivers aren't handled properly in
    AF_PACKET transmit path, also from Daniel Borkmann.

    Same problem exists in pktgen, and Daniel fixed it there too.

    7) Fix resource leaks in driver probe error paths of new sxgbe driver,
    from Francois Romieu.

    8) Truesize of SKBs can gradually get more and more corrupted in NAPI
    packet recycling path, fix from Eric Dumazet.

    9) Fix uniprocessor netfilter build, from Florian Westphal. In the
    longer term we should perhaps try to find a way for ARRAY_SIZE() to
    work even with zero sized array elements.

    10) Fix crash in netfilter conntrack extensions due to mis-estimation of
    required extension space. From Andrey Vagin.

    11) Since we commit table rule updates before trying to copy the
    counters back to userspace (it's the last action we perform), we
    really can't signal the user copy with an error as we are beyond the
    point from which we can unwind everything. This causes all kinds of
    use after free crashes and other mysterious behavior.

    From Thomas Graf.

    12) Restore previous behvaior of div/mod by zero in BPF filter
    processing. From Daniel Borkmann.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (38 commits)
    net: sctp: wake up all assocs if sndbuf policy is per socket
    isdnloop: several buffer overflows
    netdev: remove potentially harmful checks
    pktgen: fix xmit test for BQL enabled devices
    net/at91_ether: avoid NULL pointer dereference
    tipc: Let tipc_release() return 0
    at86rf230: fix MAX_CSMA_RETRIES parameter
    mac802154: fix duplicate #include headers
    sxgbe: fix duplicate #include headers
    net: filter: be more defensive on div/mod by X==0
    netfilter: Can't fail and free after table replacement
    xen-netback: Trivial format string fix
    net: bcmgenet: Remove unnecessary version.h inclusion
    net: smc911x: Remove unused local variable
    bonding: Inactive slaves should keep inactive flag's value
    netfilter: nf_tables: fix wrong format in request_module()
    netfilter: nf_tables: set names cannot be larger than 15 bytes
    netfilter: nf_conntrack: reserve two bytes for nf_ct_ext->len
    netfilter: Add {ipt,ip6t}_osf aliases for xt_osf
    netfilter: x_tables: allow to use cgroup match for LOCAL_IN nf hooks
    ...

    Linus Torvalds
     
  • Pull second set of s390 patches from Martin Schwidefsky:
    "The second part of Heikos uaccess rework, the page table walker for
    uaccess is now a thing of the past (yay!)

    The code change to fix the theoretical TLB flush problem allows us to
    add a TLB flush optimization for zEC12, this machine has new
    instructions that allow to do CPU local TLB flushes for single pages
    and for all pages of a specific address space.

    Plus the usual bug fixing and some more cleanup"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
    s390/uaccess: rework uaccess code - fix locking issues
    s390/mm,tlb: optimize TLB flushing for zEC12
    s390/mm,tlb: safeguard against speculative TLB creation
    s390/irq: Use defines for external interruption codes
    s390/irq: Add defines for external interruption codes
    s390/sclp: add timeout for queued requests
    kvm/s390: also set guest pages back to stable on kexec/kdump
    lcs: Add missing destroy_timer_on_stack()
    s390/tape: Add missing destroy_timer_on_stack()
    s390/tape: Use del_timer_sync()
    s390/3270: fix crash with multiple reset device requests
    s390/bitops,atomic: add missing memory barriers
    s390/zcrypt: add length check for aligned data to avoid overflow in msg-type 6

    Linus Torvalds
     
  • SCTP charges chunks for wmem accounting via skb->truesize in
    sctp_set_owner_w(), and sctp_wfree() respectively as the
    reverse operation. If a sender runs out of wmem, it needs to
    wait via sctp_wait_for_sndbuf(), and gets woken up by a call
    to __sctp_write_space() mostly via sctp_wfree().

    __sctp_write_space() is being called per association. Although
    we assign sk->sk_write_space() to sctp_write_space(), which
    is then being done per socket, it is only used if send space
    is increased per socket option (SO_SNDBUF), as SOCK_USE_WRITE_QUEUE
    is set and therefore not invoked in sock_wfree().

    Commit 4c3a5bdae293 ("sctp: Don't charge for data in sndbuf
    again when transmitting packet") fixed an issue where in case
    sctp_packet_transmit() manages to queue up more than sndbuf
    bytes, sctp_wait_for_sndbuf() will never be woken up again
    unless it is interrupted by a signal. However, a still
    remaining issue is that if net.sctp.sndbuf_policy=0, that is
    accounting per socket, and one-to-many sockets are in use,
    the reclaimed write space from sctp_wfree() is 'unfairly'
    handed back on the server to the association that is the lucky
    one to be woken up again via __sctp_write_space(), while
    the remaining associations are never be woken up again
    (unless by a signal).

    The effect disappears with net.sctp.sndbuf_policy=1, that
    is wmem accounting per association, as it guarantees a fair
    share of wmem among associations.

    Therefore, if we have reclaimed memory in case of per socket
    accounting, wake all related associations to a socket in a
    fair manner, that is, traverse the socket association list
    starting from the current neighbour of the association and
    issue a __sctp_write_space() to everyone until we end up
    waking ourselves. This guarantees that no association is
    preferred over another and even if more associations are
    taken into the one-to-many session, all receivers will get
    messages from the server and are not stalled forever on
    high load. This setting still leaves the advantage of per
    socket accounting in touch as an association can still use
    up global limits if unused by others.

    Fixes: 4eb701dfc618 ("[SCTP] Fix SCTP sendbuffer accouting.")
    Signed-off-by: Daniel Borkmann
    Cc: Thomas Graf
    Cc: Neil Horman
    Cc: Vlad Yasevich
    Acked-by: Vlad Yasevich
    Acked-by: Neil Horman
    Signed-off-by: David S. Miller

    Daniel Borkmann
     

08 Apr, 2014

9 commits

  • Merge second patch-bomb from Andrew Morton:
    - the rest of MM
    - zram updates
    - zswap updates
    - exit
    - procfs
    - exec
    - wait
    - crash dump
    - lib/idr
    - rapidio
    - adfs, affs, bfs, ufs
    - cris
    - Kconfig things
    - initramfs
    - small amount of IPC material
    - percpu enhancements
    - early ioremap support
    - various other misc things

    * emailed patches from Andrew Morton : (156 commits)
    MAINTAINERS: update Intel C600 SAS driver maintainers
    fs/ufs: remove unused ufs_super_block_third pointer
    fs/ufs: remove unused ufs_super_block_second pointer
    fs/ufs: remove unused ufs_super_block_first pointer
    fs/ufs/super.c: add __init to init_inodecache()
    doc/kernel-parameters.txt: add early_ioremap_debug
    arm64: add early_ioremap support
    arm64: initialize pgprot info earlier in boot
    x86: use generic early_ioremap
    mm: create generic early_ioremap() support
    x86/mm: sparse warning fix for early_memremap
    lglock: map to spinlock when !CONFIG_SMP
    percpu: add preemption checks to __this_cpu ops
    vmstat: use raw_cpu_ops to avoid false positives on preemption checks
    slub: use raw_cpu_inc for incrementing statistics
    net: replace __this_cpu_inc in route.c with raw_cpu_inc
    modules: use raw_cpu_write for initialization of per cpu refcount.
    mm: use raw_cpu ops for determining current NUMA node
    percpu: add raw_cpu_ops
    slub: fix leak of 'name' in sysfs_slab_add
    ...

    Linus Torvalds
     
  • The RT_CACHE_STAT_INC macro triggers the new preemption checks
    for __this_cpu ops.

    I do not see any other synchronization that would allow the use of a
    __this_cpu operation here however in commit dbd2915ce87e ("[IPV4]:
    RT_CACHE_STAT_INC() warning fix") Andrew justifies the use of
    raw_smp_processor_id() here because "we do not care" about races. In
    the past we agreed that the price of disabling interrupts here to get
    consistent counters would be too high. These counters may be inaccurate
    due to race conditions.

    The use of __this_cpu op improves the situation already from what commit
    dbd2915ce87e did since the single instruction emitted on x86 does not
    allow the race to occur anymore. However, non x86 platforms could still
    experience a race here.

    Trace:

    __this_cpu_add operation in preemptible [00000000] code: avahi-daemon/1193
    caller is __this_cpu_preempt_check+0x38/0x60
    CPU: 1 PID: 1193 Comm: avahi-daemon Tainted: GF 3.12.0-rc4+ #187
    Call Trace:
    check_preemption_disabled+0xec/0x110
    __this_cpu_preempt_check+0x38/0x60
    __ip_route_output_key+0x575/0x8c0
    ip_route_output_flow+0x27/0x70
    udp_sendmsg+0x825/0xa20
    inet_sendmsg+0x85/0xc0
    sock_sendmsg+0x9c/0xd0
    ___sys_sendmsg+0x37c/0x390
    __sys_sendmsg+0x49/0x90
    SyS_sendmsg+0x12/0x20
    tracesys+0xe1/0xe6

    Signed-off-by: Christoph Lameter
    Acked-by: David S. Miller
    Acked-by: Ingo Molnar
    Cc: Eric Dumazet
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     
  • Pull CPU hotplug notifiers registration fixes from Rafael Wysocki:
    "The purpose of this single series of commits from Srivatsa S Bhat
    (with a small piece from Gautham R Shenoy) touching multiple
    subsystems that use CPU hotplug notifiers is to provide a way to
    register them that will not lead to deadlocks with CPU online/offline
    operations as described in the changelog of commit 93ae4f978ca7f ("CPU
    hotplug: Provide lockless versions of callback registration
    functions").

    The first three commits in the series introduce the API and document
    it and the rest simply goes through the users of CPU hotplug notifiers
    and converts them to using the new method"

    * tag 'cpu-hotplug-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (52 commits)
    net/iucv/iucv.c: Fix CPU hotplug callback registration
    net/core/flow.c: Fix CPU hotplug callback registration
    mm, zswap: Fix CPU hotplug callback registration
    mm, vmstat: Fix CPU hotplug callback registration
    profile: Fix CPU hotplug callback registration
    trace, ring-buffer: Fix CPU hotplug callback registration
    xen, balloon: Fix CPU hotplug callback registration
    hwmon, via-cputemp: Fix CPU hotplug callback registration
    hwmon, coretemp: Fix CPU hotplug callback registration
    thermal, x86-pkg-temp: Fix CPU hotplug callback registration
    octeon, watchdog: Fix CPU hotplug callback registration
    oprofile, nmi-timer: Fix CPU hotplug callback registration
    intel-idle: Fix CPU hotplug callback registration
    clocksource, dummy-timer: Fix CPU hotplug callback registration
    drivers/base/topology.c: Fix CPU hotplug callback registration
    acpi-cpufreq: Fix CPU hotplug callback registration
    zsmalloc: Fix CPU hotplug callback registration
    scsi, fcoe: Fix CPU hotplug callback registration
    scsi, bnx2fc: Fix CPU hotplug callback registration
    scsi, bnx2i: Fix CPU hotplug callback registration
    ...

    Linus Torvalds
     
  • Currently we're checking a variable for != NULL after actually
    dereferencing it, in netdev_lower_get_next_private*().

    It's counter-intuitive at best, and can lead to faulty usage (as it implies
    that the variable can be NULL), so fix it by removing the useless checks.

    Reported-by: Daniel Borkmann
    CC: "David S. Miller"
    CC: Eric Dumazet
    CC: Nicolas Dichtel
    CC: Jiri Pirko
    CC: stephen hemminger
    CC: Jerry Chu
    Signed-off-by: Veaceslav Falico
    Signed-off-by: David S. Miller

    Veaceslav Falico
     
  • Similarly as in commit 8e2f1a63f221 ("packet: fix packet_direct_xmit
    for BQL enabled drivers"), we test for __QUEUE_STATE_STACK_XOFF bit
    in pktgen's xmit, which would not fully fill the device's TX ring for
    BQL drivers that use netdev_tx_sent_queue(). Fix is to use, similarly
    as we do in packet sockets, netif_xmit_frozen_or_drv_stopped() test.

    Signed-off-by: Daniel Borkmann
    Cc: Eric Dumazet
    Signed-off-by: David S. Miller

    Daniel Borkmann
     
  • net/tipc/socket.c: In function ‘tipc_release’:
    net/tipc/socket.c:352: warning: ‘res’ is used uninitialized in this function

    Introduced by commit 24be34b5a0c9114541891d29dff1152bb1a8df34 ("tipc:
    eliminate upcall function pointers between port and socket"), which
    removed the sole initializer of "res".

    Just return 0 to fix it.

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: David S. Miller

    Geert Uytterhoeven
     
  • Pull Ceph updates from Sage Weil:
    "The biggest chunk is a series of patches from Ilya that add support
    for new Ceph osd and crush map features, including some new tunables,
    primary affinity, and the new encoding that is needed for erasure
    coding support. This brings things into parity with the server side
    and the looming firefly release. There is also support for allocation
    hints in RBD that help limit fragmentation on the server side.

    There is also a series of patches from Zheng fixing NFS reexport,
    directory fragmentation support, flock vs fnctl behavior, and some
    issues with clustered MDS.

    Finally, there are some miscellaneous fixes from Yunchuan Wen for
    fscache, Fabian Frederick for ACLs, and from me for fsync(dirfd)
    behavior"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client: (79 commits)
    ceph: skip invalid dentry during dcache readdir
    libceph: dump pool {read,write}_tier to debugfs
    libceph: output primary affinity values on osdmap updates
    ceph: flush cap release queue when trimming session caps
    ceph: don't grabs open file reference for aborted request
    ceph: drop extra open file reference in ceph_atomic_open()
    ceph: preallocate buffer for readdir reply
    libceph: enable PRIMARY_AFFINITY feature bit
    libceph: redo ceph_calc_pg_primary() in terms of ceph_calc_pg_acting()
    libceph: add support for osd primary affinity
    libceph: add support for primary_temp mappings
    libceph: return primary from ceph_calc_pg_acting()
    libceph: switch ceph_calc_pg_acting() to new helpers
    libceph: introduce apply_temps() helper
    libceph: introduce pg_to_raw_osds() and raw_to_up_osds() helpers
    libceph: ceph_can_shift_osds(pool) and pool type defines
    libceph: ceph_osd_{exists,is_up,is_down}(osd) definitions
    libceph: enable OSDMAP_ENC feature bit
    libceph: primary_affinity decode bits
    libceph: primary_affinity infrastructure
    ...

    Linus Torvalds
     
  • The commit e6278d92005e ("mac802154: use header operations to
    create/parse headers") included the header

    net/ieee802154_netdev.h

    which had been included by the commit b70ab2e87f17 ("ieee802154:
    enforce consistent endianness in the 802.15.4 stack"). Fix this
    duplicate #include by deleting the latter one as the required header
    has already been in place.

    Signed-off-by: Jean Sacren
    Cc: Alexander Smirnov
    Cc: Dmitry Eremin-Solenikov
    Cc: Phoebe Buckheister
    Cc: linux-zigbee-devel@lists.sourceforge.net
    Signed-off-by: David S. Miller

    Jean Sacren
     
  • The old interpreter behaviour was that we returned with 0
    whenever we found a division by 0 would take place. In the new
    interpreter we would currently just skip that instead and
    continue execution.

    It's true that a value of 0 as return might not be appropriate
    in all cases, but current users (socket filters -> drop
    packet, seccomp -> SECCOMP_RET_KILL, cls_bpf -> unclassified,
    etc) seem fine with that behaviour. Better this than undefined
    BPF program behaviour as it's expected that A contains the
    result of the division. In future, as more use cases open up,
    we could further adapt this return value to our needs, if
    necessary.

    So reintroduce return of 0 for division by 0 as in the old
    interpreter. Also in case of K which is guaranteed to be 32bit
    wide, sk_chk_filter() already takes care of preventing division
    by 0 invoked through K, so we can generally spare us these tests.

    Signed-off-by: Daniel Borkmann
    Reviewed-by: Alexei Starovoitov
    Signed-off-by: David S. Miller

    Daniel Borkmann
     

07 Apr, 2014

1 commit

  • Pull NFS client updates from Trond Myklebust:
    "Highlights include:

    - Stable fix for a use after free issue in the NFSv4.1 open code
    - Fix the SUNRPC bi-directional RPC code to account for TCP segmentation
    - Optimise usage of readdirplus when confronted with 'ls -l' situations
    - Soft mount bugfixes
    - NFS over RDMA bugfixes
    - NFSv4 close locking fixes
    - Various NFSv4.x client state management optimisations
    - Rename/unlink code cleanups"

    * tag 'nfs-for-3.15-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (28 commits)
    nfs: pass string length to pr_notice message about readdir loops
    NFSv4: Fix a use-after-free problem in open()
    SUNRPC: rpc_restart_call/rpc_restart_call_prepare should clear task->tk_status
    SUNRPC: Don't let rpc_delay() clobber non-timeout errors
    SUNRPC: Ensure call_connect_status() deals correctly with SOFTCONN tasks
    SUNRPC: Ensure call_status() deals correctly with SOFTCONN tasks
    NFSv4: Ensure we respect soft mount timeouts during trunking discovery
    NFSv4: Schedule recovery if nfs40_walk_client_list() is interrupted
    NFS: advertise only supported callback netids
    SUNRPC: remove KERN_INFO from dprintk() call sites
    SUNRPC: Fix large reads on NFS/RDMA
    NFS: Clean up: revert increase in READDIR RPC buffer max size
    SUNRPC: Ensure that call_bind times out correctly
    SUNRPC: Ensure that call_connect times out correctly
    nfs: emit a fsnotify_nameremove call in sillyrename codepath
    nfs: remove synchronous rename code
    nfs: convert nfs_rename to use async_rename infrastructure
    nfs: make nfs_async_rename non-static
    nfs: abstract out code needed to complete a sillyrename
    NFSv4: Clear the open state flags if the new stateid does not match
    ...

    Linus Torvalds
     

05 Apr, 2014

15 commits