20 Jul, 2011

2 commits


17 Jul, 2011

2 commits

  • Another regression fix considering incomming l2cap connections with
    defer_setup enabled. In situations when incomming connection is
    extracted with l2cap_sock_accept, it's bt_sock info will have
    'parent' member zerroed, but 'parent' may be used unconditionally
    in l2cap_conn_start() and l2cap_security_cfm() when defer_setup
    is enabled.

    Backtrace:
    [] (l2cap_security_cfm+0x0/0x2ac [bluetooth]) from [] (hci_event_pac
    ket+0xc2c/0x4aa4 [bluetooth])
    [] (hci_event_packet+0x0/0x4aa4 [bluetooth]) from [] (hci_rx_task+0x
    cc/0x27c [bluetooth])
    [] (hci_rx_task+0x0/0x27c [bluetooth]) from [] (tasklet_action+0xa0/
    0x15c)
    [] (tasklet_action+0x0/0x15c) from [] (__do_softirq+0x98/0x130)
    r7:00000101 r6:00000018 r5:00000001 r4:efc46000
    [] (__do_softirq+0x0/0x130) from [] (do_softirq+0x4c/0x58)
    [] (do_softirq+0x0/0x58) from [] (run_ksoftirqd+0xb0/0x1b4)
    r4:efc46000 r3:00000001
    [] (run_ksoftirqd+0x0/0x1b4) from [] (kthread+0x84/0x8c)
    r7:00000000 r6:c008f530 r5:efc47fc4 r4:efc41f08
    [] (kthread+0x0/0x8c) from [] (do_exit+0x0/0x5f0)

    Signed-off-by: Ilia Kolomisnky
    Signed-off-by: Gustavo F. Padovan
    Signed-off-by: David S. Miller

    Ilia Kolomisnky
     
  • Caused by the following commit, partially revert it.

    commit 9fa7e4f76f3658ba1f44fbdb95c77e7df3f53f95
    Author: Gustavo F. Padovan
    Date: Thu Jun 30 16:11:30 2011 -0300

    Bluetooth: Fix regression with incoming L2CAP connections

    PTS test A2DP/SRC/SRC_SET/TC_SRC_SET_BV_02_I revealed that
    ( probably after the df3c3931e commit ) the l2cap connection
    could not be established in case when the "Auth Complete" HCI
    event does not arive before the initiator send "Configuration
    request", in which case l2cap replies with "Command rejected"
    since the channel is still in BT_CONNECT2 state.

    Signed-off-by: Luiz Augusto von Dentz
    Signed-off-by: Gustavo F. Padovan
    Signed-off-by: David S. Miller

    Gustavo F. Padovan
     

15 Jul, 2011

2 commits

  • There is no software fallback implemented for SCTP or FCoE checksumming,
    and so it should not be passed on by software devices like bridge or bonding.

    For VLAN devices, this is different. First, the driver for underlying device
    should be prepared to get offloaded packets even when the feature is disabled
    (especially if it advertises it in vlan_features). Second, devices under
    VLANs do not get replaced without tearing down the VLAN first.

    This fixes a mess I accidentally introduced while converting bonding to
    ndo_fix_features.

    NETIF_F_SOFT_FEATURES are removed from BOND_VLAN_FEATURES because they
    are unused as of commit 712ae51afd.

    Signed-off-by: Michał Mirosław
    Signed-off-by: David S. Miller

    Michał Mirosław
     
  • Packets to devices without NETIF_F_SCTP_CSUM (including NETIF_F_NO_CSUM)
    should be properly checksummed because the packets can be diverted or
    rerouted after construction. This still leaves packets diverted from
    NETIF_F_SCTP_CSUM-enabled devices with broken checksums. Fixing this
    needs implementing software offload fallback in networking core.

    For users of sctp_checksum_disable, skb->ip_summed should be left as
    CHECKSUM_NONE and not CHECKSUM_UNNECESSARY as per include/linux/skbuff.h.

    Signed-off-by: Michał Mirosław
    Signed-off-by: David S. Miller

    Michał Mirosław
     

14 Jul, 2011

1 commit


13 Jul, 2011

1 commit

  • Because struct rpcbind_args *map was declared static, if two
    threads entered this method at the same time, the values
    assigned to map could be sent two two differen tasks.
    This could cause all sorts of problems, include use-after-free
    and double-free of memory.

    Fix this by removing the static declaration so that the map
    pointer is on the stack.

    Signed-off-by: Ben Greear
    Cc: stable@kernel.org
    Signed-off-by: Trond Myklebust

    Ben Greear
     

09 Jul, 2011

2 commits


08 Jul, 2011

7 commits

  • Upon "ip xfrm state update ..", xfrm_add_sa() takes an extra reference on
    the user-supplied SA and forgets to drop the reference when
    xfrm_state_update() returns 0. This leads to a memory leak as the
    parameter SA is never freed. This change attempts to fix the leak by
    calling __xfrm_state_put() when xfrm_state_update() updates a valid SA
    (err = 0). The parameter SA is added to the gc list when the final
    reference is dropped by xfrm_add_sa() upon completion.

    Signed-off-by: Tushar Gohad
    Acked-by: Herbert Xu
    Signed-off-by: David S. Miller

    Tushar Gohad
     
  • …wireless-2.6 into for-davem

    John W. Linville
     
  • Since rpc_killall_tasks may modify the rpc_task's tk_action field
    without any locking, we need to be careful when dereferencing it.

    Reported-by: Ben Greear
    Tested-by: Ben Greear
    Signed-off-by: Trond Myklebust
    Cc: stable@kernel.org

    Trond Myklebust
     
  • When initiating a graceful shutdown while having data chunks
    on the retransmission queue with a peer which is in zero
    window mode the shutdown is never completed because the
    retransmission error count is reset periodically by the
    following two rules:

    - Do not timeout association while doing zero window probe.
    - Reset overall error count when a heartbeat request has
    been acknowledged.

    The graceful shutdown will wait for all outstanding TSN to
    be acknowledged before sending the SHUTDOWN request. This
    never happens due to the peer's zero window not acknowledging
    the continuously retransmitted data chunks. Although the
    error counter is incremented for each failed retransmission,
    the receiving of the SACK announcing the zero window clears
    the error count again immediately. Also heartbeat requests
    continue to be sent periodically. The peer acknowledges these
    requests causing the error counter to be reset as well.

    This patch changes behaviour to only reset the overall error
    counter for the above rules while not in shutdown. After
    reaching the maximum number of retransmission attempts, the
    T5 shutdown guard timer is scheduled to give the receiver
    some additional time to recover. The timer is stopped as soon
    as the receiver acknowledges any data.

    The issue can be easily reproduced by establishing a sctp
    association over the loopback device, constantly queueing
    data at the sender while not reading any at the receiver.
    Wait for the window to reach zero, then initiate a shutdown
    by killing both processes simultaneously. The association
    will never be freed and the chunks on the retransmission
    queue will be retransmitted indefinitely.

    Signed-off-by: Thomas Graf
    Acked-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Thomas Graf
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (31 commits)
    sctp: fix missing send up SCTP_SENDER_DRY_EVENT when subscribe it
    net: refine {udp|tcp|sctp}_mem limits
    vmxnet3: round down # of queues to power of two
    net: sh_eth: fix the parameter for the ETHER of SH7757
    net: sh_eth: fix cannot work half-duplex mode
    net: vlan: enable soft features regardless of underlying device
    vmxnet3: fix starving rx ring whenoc_skb kb fails
    bridge: Always flood broadcast packets
    greth: greth_set_mac_add would corrupt the MAC address.
    net: bind() fix error return on wrong address family
    natsemi: silence dma-debug warnings
    net: 8139too: Initial necessary vlan_features to support vlan
    Fix call trace when interrupts are disabled while sleeping function kzalloc is called
    qlge:Version change to v1.00.00.29
    qlge: Fix printk priority so chip fatal errors are always reported.
    qlge:Fix crash caused by mailbox execution on wedged chip.
    xfrm4: Don't call icmp_send on local error
    ipv4: Don't use ufo handling on later transformed packets
    xfrm: Remove family arg from xfrm_bundle_ok
    ipv6: Don't put artificial limit on routing table size.
    ...

    Linus Torvalds
     
  • Unlike CCMP, the presence or absence of the QoS
    field doesn't change the encryption, only the
    TID is used. When no QoS field is present, zero
    is used as the TID value. This means that it is
    possible for an attacker to take a QoS packet
    with TID 0 and replay it as a non-QoS packet.

    Unfortunately, mac80211 uses different IVs for
    checking the validity of the packet's TKIP IV
    when it checks TID 0 and when it checks non-QoS
    packets. This means it is vulnerable to this
    replay attack.

    To fix this, use the same replay counter for
    TID 0 and non-QoS packets by overriding the
    rx->queue value to 0 if it is 16 (non-QoS).

    This is a minimal fix for now. I caused this
    issue in

    commit 1411f9b531f0a910cd1c85a337737c1e6ffbae6a
    Author: Johannes Berg
    Date: Thu Jul 10 10:11:02 2008 +0200

    mac80211: fix RX sequence number check

    while fixing a sequence number issue (there,
    a separate counter needs to be used).

    Cc: stable@kernel.org
    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     
  • We were not allocating memory for the IEs passed in the scheduled_scan
    request and this was causing memory corruption (buffer overflow).

    Signed-off-by: Luciano Coelho
    Signed-off-by: John W. Linville

    Luciano Coelho
     

07 Jul, 2011

2 commits

  • We forgot to send up SCTP_SENDER_DRY_EVENT notification when
    user app subscribes to this event, and there is no data to be
    sent or retransmit.

    This is required by the Socket API and used by the DTLS/SCTP
    implementation.

    Reported-by: Michael Tüxen
    Signed-off-by: Wei Yongjun
    Tested-by: Robin Seggelmann
    Signed-off-by: David S. Miller

    Wei Yongjun
     
  • Current tcp/udp/sctp global memory limits are not taking into account
    hugepages allocations, and allow 50% of ram to be used by buffers of a
    single protocol [ not counting space used by sockets / inodes ...]

    Lets use nr_free_buffer_pages() and allow a default of 1/8 of kernel ram
    per protocol, and a minimum of 128 pages.
    Heavy duty machines sysadmins probably need to tweak limits anyway.

    References: https://bugzilla.stlinux.com/show_bug.cgi?id=38032
    Reported-by: starlight
    Suggested-by: Andrew Morton
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

06 Jul, 2011

5 commits

  • If gso/gro feature of underlying device is turned off,
    then new created vlan device never can turn gso/gro on.

    Although underlying device don't support TSO, we still
    should use software segments for vlan device.

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

    Shan Wei
     
  • As is_multicast_ether_addr returns true on broadcast packets as
    well, we need to explicitly exclude broadcast packets so that
    they're always flooded. This wasn't an issue before as broadcast
    packets were considered to be an unregistered multicast group,
    which were always flooded. However, as we now only flood such
    packets to router ports, this is no longer acceptable.

    Reported-by: Michael Guntsche
    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
    ceph: fix sync and dio writes across stripe boundaries
    libceph: fix page calculation for non-page-aligned io
    ceph: fix page alignment corrections

    Linus Torvalds
     
  • There was a deadlock when rfkill-blocking a wireless interface,
    because we were locking the rdev mutex on NETDEV_GOING_DOWN to stop
    sched_scans that were eventually running. The rfkill block code was
    already holding a mutex under rdev:

    kernel: =======================================================
    kernel: [ INFO: possible circular locking dependency detected ]
    kernel: 3.0.0-rc1-00049-g1fa7b6a #57
    kernel: -------------------------------------------------------
    kernel: kworker/0:1/4525 is trying to acquire lock:
    kernel: (&rdev->mtx){+.+.+.}, at: [] cfg80211_netdev_notifier_call+0x131/0x5b0
    kernel:
    kernel: but task is already holding lock:
    kernel: (&rdev->devlist_mtx){+.+.+.}, at: [] cfg80211_rfkill_set_block+0x4f/0xa0
    kernel:
    kernel: which lock already depends on the new lock.

    To fix this, add a new mutex specifically for sched_scan, to protect
    the sched_scan_req element in the rdev struct, instead of using the
    global rdev mutex.

    Reported-by: Duane Griffin
    Signed-off-by: Luciano Coelho
    Signed-off-by: John W. Linville

    Luciano Coelho
     
  • John W. Linville
     

05 Jul, 2011

1 commit

  • Hi,

    Reinhard Max also pointed out that the error should EAFNOSUPPORT according
    to POSIX.

    The Linux manpages have it as EINVAL, some other OSes (Minix, HPUX, perhaps BSD) use
    EAFNOSUPPORT. Windows uses WSAEFAULT according to MSDN.

    Other protocols error values in their af bind() methods in current mainline git as far
    as a brief look shows:
    EAFNOSUPPORT: atm, appletalk, l2tp, llc, phonet, rxrpc
    EINVAL: ax25, bluetooth, decnet, econet, ieee802154, iucv, netlink, netrom, packet, rds, rose, unix, x25,
    No check?: can/raw, ipv6/raw, irda, l2tp/l2tp_ip

    Ciao, Marcus

    Signed-off-by: Marcus Meissner
    Cc: Reinhard Max
    Signed-off-by: David S. Miller

    Marcus Meissner
     

02 Jul, 2011

5 commits

  • Calling icmp_send() on a local message size error leads to
    an incorrect update of the path mtu. So use ip_local_error()
    instead to notify the socket about the error.

    Signed-off-by: Steffen Klassert
    Signed-off-by: David S. Miller

    Steffen Klassert
     
  • We might call ip_ufo_append_data() for packets that will be IPsec
    transformed later. This function should be used just for real
    udp packets. So we check for rt->dst.header_len which is only
    nonzero on IPsec handling and call ip_ufo_append_data() just
    if rt->dst.header_len is zero.

    Signed-off-by: Steffen Klassert
    Signed-off-by: David S. Miller

    Steffen Klassert
     
  • The family arg is not used any more, so remove it.

    Signed-off-by: Steffen Klassert
    Signed-off-by: David S. Miller

    Steffen Klassert
     
  • IPV6, unlike IPV4, doesn't have a routing cache.

    Routing table entries, as well as clones made in response
    to route lookup requests, all live in the same table. And
    all of these things are together collected in the destination
    cache table for ipv6.

    This means that routing table entries count against the garbage
    collection limits, even though such entries cannot ever be reclaimed
    and are added explicitly by the administrator (rather than being
    created in response to lookups).

    Therefore it makes no sense to count ipv6 routing table entries
    against the GC limits.

    Add a DST_NOCOUNT destination cache entry flag, and skip the counting
    if it is set. Use this flag bit in ipv6 when adding routing table
    entries.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • This blows away any flags already set in the entry.

    Signed-off-by: David S. Miller

    David S. Miller
     

01 Jul, 2011

5 commits

  • David S. Miller
     
  • If the remote device is not present, the connections attemp fails and
    the struct hci_conn was not freed

    Signed-off-by: Tomas Targownik
    Signed-off-by: Gustavo F. Padovan

    Tomas Targownik
     
  • PTS test A2DP/SRC/SRC_SET/TC_SRC_SET_BV_02_I revealed that
    ( probably after the df3c3931e commit ) the l2cap connection
    could not be established in case when the "Auth Complete" HCI
    event does not arive before the initiator send "Configuration
    request", in which case l2cap replies with "Command rejected"
    since the channel is still in BT_CONNECT2 state.

    Based on patch from: Ilia Kolomisnky

    Signed-off-by: Gustavo F. Padovan

    Gustavo F. Padovan
     
  • Partial revert of commit aabf6f89. When the hidp session thread
    was converted from kernel_thread to kthread, the atomic/wakeups
    were replaced with kthread_stop. kthread_stop has blocking semantics
    which are inappropriate for the hidp session kthread. In addition,
    the kthread signals itself to terminate in hidp_process_hid_control()
    - it cannot do this with kthread_stop().

    Lastly, a wakeup can be lost if the wakeup happens between checking
    for the loop exit condition and setting the current state to
    TASK_INTERRUPTIBLE. (Without appropriate synchronization mechanisms,
    the task state should not be changed between the condition test and
    the yield - via schedule() - as this creates a race between the
    wakeup and resetting the state back to interruptible.)

    Signed-off-by: Peter Hurley
    Signed-off-by: Gustavo F. Padovan

    Peter Hurley
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (24 commits)
    usbnet: Remove over-broad module alias from zaurus.
    MAINTAINERS: drop Michael from bfin_mac driver
    net/can: activate bit-timing calculation and netlink based drivers by default
    rionet: fix NULL pointer dereference in rionet_remove
    net+crypto: Use vmalloc for zlib inflate buffers.
    netfilter: Fix ip_route_me_harder triggering ip_rt_bug
    ipv4: Fix IPsec slowpath fragmentation problem
    ipv4: Fix packet size calculation in __ip_append_data
    cxgb3: skb_record_rx_queue now records the queue index relative to the net_device.
    bridge: Only flood unregistered groups to routers
    qlge: Add maintainer.
    MAINTAINERS: mark socketcan-core lists as subscribers-only
    MAINTAINERS: Remove Sven Eckelmann from BATMAN ADVANCED
    r8169: fix wrong register use.
    net/usb/kalmia: signedness bug in kalmia_bind()
    net/usb: kalmia: Various fixes for better support of non-x86 architectures.
    rtl8192cu: Fix missing firmware load
    udp/recvmsg: Clear MSG_TRUNC flag when starting over for a new packet
    ipv6/udp: Use the correct variable to determine non-blocking condition
    netconsole: fix build when CONFIG_NETCONSOLE_DYNAMIC is turned on
    ...

    Linus Torvalds
     

30 Jun, 2011

1 commit


29 Jun, 2011

2 commits

  • Avoid creating input routes with ip_route_me_harder.
    It does not work for locally generated packets. Instead,
    restrict sockets to provide valid saddr for output route (or
    unicast saddr for transparent proxy). For other traffic
    allow saddr to be unicast or local but if callers forget
    to check saddr type use 0 for the output route.

    The resulting handling should be:

    - REJECT TCP:
    - in INPUT we can provide addr_type = RTN_LOCAL but
    better allow rejecting traffic delivered with
    local route (no IP address => use RTN_UNSPEC to
    allow also RTN_UNICAST).
    - FORWARD: RTN_UNSPEC => allow RTN_LOCAL/RTN_UNICAST
    saddr, add fix to ignore RTN_BROADCAST and RTN_MULTICAST
    - OUTPUT: RTN_UNSPEC

    - NAT, mangle, ip_queue, nf_ip_reroute: RTN_UNSPEC in LOCAL_OUT

    - IPVS:
    - use RTN_LOCAL in LOCAL_OUT and FORWARD after SNAT
    to restrict saddr to be local

    Signed-off-by: Julian Anastasov
    Signed-off-by: David S. Miller

    Julian Anastasov
     
  • A remote user can provide a small value for the command size field in
    the command header of an l2cap configuration request, resulting in an
    integer underflow when subtracting the size of the configuration request
    header. This results in copying a very large amount of data via
    memcpy() and destroying the kernel heap. Check for underflow.

    Signed-off-by: Dan Rosenberg
    Cc: stable
    Signed-off-by: Gustavo F. Padovan

    Dan Rosenberg
     

28 Jun, 2011

2 commits

  • ip_append_data() builds packets based on the mtu from dst_mtu(rt->dst.path).
    On IPsec the effective mtu is lower because we need to add the protocol
    headers and trailers later when we do the IPsec transformations. So after
    the IPsec transformations the packet might be too big, which leads to a
    slowpath fragmentation then. This patch fixes this by building the packets
    based on the lower IPsec mtu from dst_mtu(&rt->dst) and adapts the exthdr
    handling to this.

    Signed-off-by: Steffen Klassert
    Signed-off-by: David S. Miller

    Steffen Klassert
     
  • Git commit 59104f06 (ip: take care of last fragment in ip_append_data)
    added a check to see if we exceed the mtu when we add trailer_len.
    However, the mtu is already subtracted by the trailer length when the
    xfrm transfomation bundles are set up. So IPsec packets with mtu
    size get fragmented, or if the DF bit is set the packets will not
    be send even though they match the mtu perfectly fine. This patch
    actually reverts commit 59104f06.

    Signed-off-by: Steffen Klassert
    Signed-off-by: David S. Miller

    Steffen Klassert