05 Jan, 2012

1 commit


04 Jan, 2012

2 commits


31 Dec, 2011

2 commits

  • The sanity check (timeout < 0) never works; the dividend is unsigned
    and so is the division, which should have been a signed division.

    long timeout = (ct->timeout.expires - jiffies) / HZ;
    if (timeout < 0)
    timeout = 0;

    This patch converts the time values to signed for the division.

    Signed-off-by: Xi Wang
    Signed-off-by: Pablo Neira Ayuso

    Xi Wang
     
  • We should not forget to try for real server with port 0
    in the backup server when processing the sync message. We should
    do it in all cases because the backup server can use different
    forwarding method.

    Signed-off-by: Julian Anastasov
    Signed-off-by: Simon Horman
    Signed-off-by: Pablo Neira Ayuso

    Julian Anastasov
     

28 Dec, 2011

1 commit


25 Dec, 2011

4 commits


24 Dec, 2011

2 commits


23 Dec, 2011

7 commits

  • "! --connbytes 23:42" should match if the packet/byte count is not in range.

    As there is no explict "invert match" toggle in the match structure,
    userspace swaps the from and to arguments
    (i.e., as if "--connbytes 42:23" were given).

    However, "what = 42" will always be false.

    Change things so we use "||" in case "from" is larger than "to".

    This change may look like it breaks backwards compatibility when "to" is 0.
    However, older iptables binaries will refuse "connbytes 42:0",
    and current releases treat it to mean "! --connbytes 0:42",
    so we should be fine.

    Signed-off-by: Florian Westphal
    Signed-off-by: Pablo Neira Ayuso

    Florian Westphal
     
  • skb->truesize might be big even for a small packet.

    Its even bigger after commit 87fb4b7b533 (net: more accurate skb
    truesize) and big MTU.

    We should allow queueing at least one packet per receiver, even with a
    low RCVBUF setting.

    Reported-by: Michal Simek
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • Setting a large rps_flow_cnt like (1 << 30) on 32-bit platform will
    cause a kernel oops due to insufficient bounds checking.

    if (count > 1<<< 30) * 8 will overflow
    32 bits.

    This patch replaces the magic number (1 << 30) with a symbolic bound.

    Suggested-by: Eric Dumazet
    Signed-off-by: Xi Wang
    Signed-off-by: David S. Miller

    Xi Wang
     
  • Chris Boot reported crashes occurring in ipv6_select_ident().

    [ 461.457562] RIP: 0010:[] []
    ipv6_select_ident+0x31/0xa7

    [ 461.578229] Call Trace:
    [ 461.580742]
    [ 461.582870] [] ? udp6_ufo_fragment+0x124/0x1a2
    [ 461.589054] [] ? ipv6_gso_segment+0xc0/0x155
    [ 461.595140] [] ? skb_gso_segment+0x208/0x28b
    [ 461.601198] [] ? ipv6_confirm+0x146/0x15e
    [nf_conntrack_ipv6]
    [ 461.608786] [] ? nf_iterate+0x41/0x77
    [ 461.614227] [] ? dev_hard_start_xmit+0x357/0x543
    [ 461.620659] [] ? nf_hook_slow+0x73/0x111
    [ 461.626440] [] ? br_parse_ip_options+0x19a/0x19a
    [bridge]
    [ 461.633581] [] ? dev_queue_xmit+0x3af/0x459
    [ 461.639577] [] ? br_dev_queue_push_xmit+0x72/0x76
    [bridge]
    [ 461.646887] [] ? br_nf_post_routing+0x17d/0x18f
    [bridge]
    [ 461.653997] [] ? nf_iterate+0x41/0x77
    [ 461.659473] [] ? br_flood+0xfa/0xfa [bridge]
    [ 461.665485] [] ? nf_hook_slow+0x73/0x111
    [ 461.671234] [] ? br_flood+0xfa/0xfa [bridge]
    [ 461.677299] [] ?
    nf_bridge_update_protocol+0x20/0x20 [bridge]
    [ 461.684891] [] ? nf_ct_zone+0xa/0x17 [nf_conntrack]
    [ 461.691520] [] ? br_flood+0xfa/0xfa [bridge]
    [ 461.697572] [] ? NF_HOOK.constprop.8+0x3c/0x56
    [bridge]
    [ 461.704616] [] ?
    nf_bridge_push_encap_header+0x1c/0x26 [bridge]
    [ 461.712329] [] ? br_nf_forward_finish+0x8a/0x95
    [bridge]
    [ 461.719490] [] ?
    nf_bridge_pull_encap_header+0x1c/0x27 [bridge]
    [ 461.727223] [] ? br_nf_forward_ip+0x1c0/0x1d4 [bridge]
    [ 461.734292] [] ? nf_iterate+0x41/0x77
    [ 461.739758] [] ? __br_deliver+0xa0/0xa0 [bridge]
    [ 461.746203] [] ? nf_hook_slow+0x73/0x111
    [ 461.751950] [] ? __br_deliver+0xa0/0xa0 [bridge]
    [ 461.758378] [] ? NF_HOOK.constprop.4+0x56/0x56
    [bridge]

    This is caused by bridge netfilter special dst_entry (fake_rtable), a
    special shared entry, where attaching an inetpeer makes no sense.

    Problem is present since commit 87c48fa3b46 (ipv6: make fragment
    identifications less predictable)

    Introduce DST_NOPEER dst flag and make sure ipv6_select_ident() and
    __ip_select_ident() fallback to the 'no peer attached' handling.

    Reported-by: Chris Boot
    Tested-by: Chris Boot
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • Userspace may not provide TCA_OPTIONS, in fact tc currently does
    so not do so if no arguments are specified on the command line.
    Return EINVAL instead of panicing.

    Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Thomas Graf
     
  • Commit 618f9bc74a039da76 (net: Move mtu handling down to the protocol
    depended handlers) forgot the bridge netfilter case, adding a NULL
    dereference in ip_fragment().

    Reported-by: Chris Boot
    CC: Steffen Klassert
    Signed-off-by: Eric Dumazet
    Acked-by: Steffen Klassert
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • Signed-off-by: Stephen Rothwell
    Acked-by: Eric Dumazet
    Acked-by: David Miller
    Signed-off-by: Linus Torvalds

    Stephen Rothwell
     

22 Dec, 2011

4 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
    net: Add a flow_cache_flush_deferred function
    ipv4: reintroduce route cache garbage collector
    net: have ipconfig not wait if no dev is available
    sctp: Do not account for sizeof(struct sk_buff) in estimated rwnd
    asix: new device id
    davinci-cpdma: fix locking issue in cpdma_chan_stop
    sctp: fix incorrect overflow check on autoclose
    r8169: fix Config2 MSIEnable bit setting.
    llc: llc_cmsg_rcv was getting called after sk_eat_skb.
    net: bpf_jit: fix an off-one bug in x86_64 cond jump target
    iwlwifi: update SCD BC table for all SCD queues
    Revert "Bluetooth: Revert: Fix L2CAP connection establishment"
    Bluetooth: Clear RFCOMM session timer when disconnecting last channel
    Bluetooth: Prevent uninitialized data access in L2CAP configuration
    iwlwifi: allow to switch to HT40 if not associated
    iwlwifi: tx_sync only on PAN context
    mwifiex: avoid double list_del in command cancel path
    ath9k: fix max phy rate at rate control init
    nfc: signedness bug in __nci_request()
    iwlwifi: do not set the sequence control bit is not needed

    Linus Torvalds
     
  • flow_cach_flush() might sleep but can be called from
    atomic context via the xfrm garbage collector. So add
    a flow_cache_flush_deferred() function and use this if
    the xfrm garbage colector is invoked from within the
    packet path.

    Signed-off-by: Steffen Klassert
    Acked-by: Timo Teräs
    Signed-off-by: David S. Miller

    Steffen Klassert
     
  • Commit 2c8cec5c10b (ipv4: Cache learned PMTU information in inetpeer)
    removed IP route cache garbage collector a bit too soon, as this gc was
    responsible for expired routes cleanup, releasing their neighbour
    reference.

    As pointed out by Robert Gladewitz, recent kernels can fill and exhaust
    their neighbour cache.

    Reintroduce the garbage collection, since we'll have to wait our
    neighbour lookups become refcount-less to not depend on this stuff.

    Reported-by: Robert Gladewitz
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • …wireless into for-davem

    John W. Linville
     

21 Dec, 2011

3 commits

  • * 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
    NFS: Fix a regression in nfs_file_llseek()
    NFSv4: Do not accept delegated opens when a delegation recall is in effect
    NFSv4: Ensure correct locking when accessing the 'lock_states' list
    NFSv4.1: Ensure that we handle _all_ SEQUENCE status bits.
    NFSv4: Don't error if we handled it in nfs4_recovery_handle_error
    SUNRPC: Ensure we always bump the backlog queue in xprt_free_slot
    SUNRPC: Fix the execution time statistics in the face of RPC restarts

    Linus Torvalds
     
  • previous commit 3fb72f1e6e6165c5f495e8dc11c5bbd14c73385c
    makes IP-Config wait for carrier on at least one network device.

    Before waiting (predefined value 120s), check that at least one device
    was successfully brought up. Otherwise (e.g. buggy bootloader
    which does not set the MAC address) there is no point in waiting
    for carrier.

    Cc: Micha Nelissen
    Cc: Holger Brunck
    Signed-off-by: Gerlando Falauto
    Signed-off-by: David S. Miller

    Gerlando Falauto
     
  • When checking whether a DATA chunk fits into the estimated rwnd a
    full sizeof(struct sk_buff) is added to the needed chunk size. This
    quickly exhausts the available rwnd space and leads to packets being
    sent which are much below the PMTU limit. This can lead to much worse
    performance.

    The reason for this behaviour was to avoid putting too much memory
    pressure on the receiver. The concept is not completely irational
    because a Linux receiver does in fact clone an skb for each DATA chunk
    delivered. However, Linux also reserves half the available socket
    buffer space for data structures therefore usage of it is already
    accounted for.

    When proposing to change this the last time it was noted that this
    behaviour was introduced to solve a performance issue caused by rwnd
    overusage in combination with small DATA chunks.

    Trying to reproduce this I found that with the sk_buff overhead removed,
    the performance would improve significantly unless socket buffer limits
    are increased.

    The following numbers have been gathered using a patched iperf
    supporting SCTP over a live 1 Gbit ethernet network. The -l option
    was used to limit DATA chunk sizes. The numbers listed are based on
    the average of 3 test runs each. Default values have been used for
    sk_(r|w)mem.

    Chunk
    Size Unpatched No Overhead
    -------------------------------------
    4 15.2 Kbit [!] 12.2 Mbit [!]
    8 35.8 Kbit [!] 26.0 Mbit [!]
    16 95.5 Kbit [!] 54.4 Mbit [!]
    32 106.7 Mbit 102.3 Mbit
    64 189.2 Mbit 188.3 Mbit
    128 331.2 Mbit 334.8 Mbit
    256 537.7 Mbit 536.0 Mbit
    512 766.9 Mbit 766.6 Mbit
    1024 810.1 Mbit 808.6 Mbit

    Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Thomas Graf
     

20 Dec, 2011

3 commits


19 Dec, 2011

4 commits


17 Dec, 2011

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
    ipv6: Check dest prefix length on original route not copied one in rt6_alloc_cow().
    sch_gred: should not use GFP_KERNEL while holding a spinlock
    ipip, sit: copy parms.name after register_netdevice
    ipv6: Fix for adding multicast route for loopback device automatically.
    ssb: fix init regression with SoCs
    rtl8192{ce,cu,de,se}: avoid problems because of possible ERFOFF -> ERFSLEEP transition
    mac80211: fix another race in aggregation start
    fsl_pq_mdio: Clean up tbi address configuration
    ppp: fix pptp double release_sock in pptp_bind()
    net/fec: fix the use of pdev->id
    ath9k: fix check for antenna diversity support
    batman-adv: delete global entry in case of roaming
    batman-adv: in case of roaming mark the client with TT_CLIENT_ROAM
    Bluetooth: Correct version check in hci_setup
    btusb: fix a memory leak in btusb_send_frame()
    Bluetooth: bnep: Fix module reference
    Bluetooth: cmtp: Fix module reference
    Bluetooth: btmrvl: support Marvell Bluetooth device SD8797

    Linus Torvalds
     

16 Dec, 2011

1 commit


14 Dec, 2011

2 commits


13 Dec, 2011

3 commits

  • gred_change_vq() is called under sch_tree_lock(sch).

    This means a spinlock is held, and we are not allowed to sleep in this
    context.

    We might pre-allocate memory using GFP_KERNEL before taking spinlock,
    but this is not suitable for stable material.

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

    Eric Dumazet
     
  • Same fix as 731abb9cb2 for ipip and sit tunnel.
    Commit 1c5cae815d removed an explicit call to dev_alloc_name in
    ipip_tunnel_locate and ipip6_tunnel_locate, because register_netdevice
    will now create a valid name, however the tunnel keeps a copy of the
    name in the private parms structure. Fix this by copying the name back
    after register_netdevice has successfully returned.

    This shows up if you do a simple tunnel add, followed by a tunnel show:

    $ sudo ip tunnel add mode ipip remote 10.2.20.211
    $ ip tunnel
    tunl0: ip/ip remote any local any ttl inherit nopmtudisc
    tunl%d: ip/ip remote 10.2.20.211 local any ttl inherit
    $ sudo ip tunnel add mode sit remote 10.2.20.212
    $ ip tunnel
    sit0: ipv6/ip remote any local any ttl 64 nopmtudisc 6rd-prefix 2002::/16
    sit%d: ioctl 89f8 failed: No such device
    sit%d: ipv6/ip remote 10.2.20.212 local any ttl inherit

    Cc: stable@vger.kernel.org
    Signed-off-by: Ted Feng
    Signed-off-by: David S. Miller

    Ted Feng
     
  • There is no obvious reason to add a default multicast route for loopback
    devices, otherwise there would be a route entry whose dst.error set to
    -ENETUNREACH that would blocking all multicast packets.

    ====================

    [ more detailed explanation ]

    The problem is that the resulting routing table depends on the sequence
    of interface's initialization and in some situation, that would block all
    muticast packets. Suppose there are two interfaces on my computer
    (lo and eth0), if we initailize 'lo' before 'eth0', the resuting routing
    table(for multicast) would be

    # ip -6 route show | grep ff00::
    unreachable ff00::/8 dev lo metric 256 error -101
    ff00::/8 dev eth0 metric 256

    When sending multicasting packets, routing subsystem will return the first
    route entry which with a error set to -101(ENETUNREACH).

    I know the kernel will set the default ipv6 address for 'lo' when it is up
    and won't set the default multicast route for it, but there is no reason to
    stop 'init' program from setting address for 'lo', and that is exactly what
    systemd did.

    I am sure there is something wrong with kernel or systemd, currently I preferred
    kernel caused this problem.

    ====================

    Signed-off-by: Li Wei
    Signed-off-by: David S. Miller

    Li Wei