19 Feb, 2011

4 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (37 commits)
    net: deinit automatic LIST_HEAD
    net: dont leave active on stack LIST_HEAD
    net: provide default_advmss() methods to blackhole dst_ops
    tg3: Restrict phy ioctl access
    drivers/net: Call netif_carrier_off at the end of the probe
    ixgbe: work around for DDP last buffer size
    ixgbe: fix panic due to uninitialised pointer
    e1000e: flush all writebacks before unload
    e1000e: check down flag in tasks
    isdn: hisax: Use l2headersize() instead of dup (and buggy) func.
    arp_notify: unconditionally send gratuitous ARP for NETDEV_NOTIFY_PEERS.
    cxgb4vf: Use defined Mailbox Timeout
    cxgb4vf: Quiesce Virtual Interfaces on shutdown ...
    cxgb4vf: Behave properly when CONFIG_DEBUG_FS isn't defined ...
    cxgb4vf: Check driver parameters in the right place ...
    pch_gbe: Fix the MAC Address load issue.
    iwlwifi: Delete iwl3945_good_plcp_health.
    net/can/softing: make CAN_SOFTING_CS depend on CAN_SOFTING
    netfilter: nf_iterate: fix incorrect RCU usage
    pch_gbe: Fix the issue that the receiving data is not normal.
    ...

    Linus Torvalds
     
  • commit 9b5e383c11b08784 (net: Introduce
    unregister_netdevice_many()) left an active LIST_HEAD() in
    rollback_registered(), with possible memory corruption.

    Even if device is freed without touching its unreg_list (and therefore
    touching the previous memory location holding LISTE_HEAD(single), better
    close the bug for good, since its really subtle.

    (Same fix for default_device_exit_batch() for completeness)

    Reported-by: Michal Hocko
    Tested-by: Michal Hocko
    Reported-by: Eric W. Biderman
    Tested-by: Eric W. Biderman
    Signed-off-by: Linus Torvalds
    Signed-off-by: Eric Dumazet
    CC: Ingo Molnar
    CC: Octavian Purdila
    CC: stable [.33+]
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • Eric W. Biderman and Michal Hocko reported various memory corruptions
    that we suspected to be related to a LIST head located on stack, that
    was manipulated after thread left function frame (and eventually exited,
    so its stack was freed and reused).

    Eric Dumazet suggested the problem was probably coming from commit
    443457242beb (net: factorize
    sync-rcu call in unregister_netdevice_many)

    This patch fixes __dev_close() and dev_close() to properly deinit their
    respective LIST_HEAD(single) before exiting.

    References: https://lkml.org/lkml/2011/2/16/304
    References: https://lkml.org/lkml/2011/2/14/223

    Reported-by: Michal Hocko
    Tested-by: Michal Hocko
    Reported-by: Eric W. Biderman
    Tested-by: Eric W. Biderman
    Signed-off-by: Linus Torvalds
    Signed-off-by: Eric Dumazet
    CC: Ingo Molnar
    CC: Octavian Purdila
    Signed-off-by: David S. Miller

    Linus Torvalds
     
  • Commit 0dbaee3b37e118a (net: Abstract default ADVMSS behind an
    accessor.) introduced a possible crash in tcp_connect_init(), when
    dst->default_advmss() is called from dst_metric_advmss()

    Reported-by: George Spelvin
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

15 Feb, 2011

4 commits


14 Feb, 2011

2 commits


12 Feb, 2011

4 commits

  • As it turns out we never need to walk through the list of multicast
    groups subscribed by the bridge interface itself (the only time we'd
    want to do that is when we shut down the bridge, in which case we
    simply walk through all multicast groups), we don't really need to
    keep an hlist for mp->mglist.

    This means that we can replace it with just a single bit to indicate
    whether the bridge interface is subscribed to a group.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • In a couple of spots where we are supposed to modify the port
    group timer (p->timer) we instead modify the bridge interface
    group timer (mp->timer).

    The effect of this is mostly harmless. However, it can cause
    port subscriptions to be longer than they should be, thus making
    snooping less effective.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • The list mp->mglist is used to indicate whether a multicast group
    is active on the bridge interface itself as opposed to one of the
    constituent interfaces in the bridge.

    Unfortunately the operation that adds the mp->mglist node to the
    list neglected to check whether it has already been added. This
    leads to list corruption in the form of nodes pointing to itself.

    Normally this would be quite obvious as it would cause an infinite
    loop when walking the list. However, as this list is never actually
    walked (which means that we don't really need it, I'll get rid of
    it in a subsequent patch), this instead is hidden until we perform
    a delete operation on the affected nodes.

    As the same node may now be pointed to by more than one node, the
    delete operations can then cause modification of freed memory.

    This was observed in practice to cause corruption in 512-byte slabs,
    most commonly leading to crashes in jbd2.

    Thanks to Josef Bacik for pointing me in the right direction.

    Reported-by: Ian Page Hands
    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • Commit 5811662b15db018c740c57d037523683fd3e6123 ("net: use the macros
    defined for the members of flowi") accidentally removed the setting of
    IPPROTO_GRE from the struct flowi in ipgre_tunnel_xmit. This patch
    restores it.

    Signed-off-by: Steffen Klassert
    Acked-by: Changli Gao
    Signed-off-by: David S. Miller

    Steffen Klassert
     

11 Feb, 2011

2 commits

  • Commit 80c802f3073e84 (xfrm: cache bundles instead of policies for
    outgoing flows) introduced possible oopse when dst_alloc returns NULL.

    Signed-off-by: Hiroaki SHIMODA
    Signed-off-by: David S. Miller

    Hiroaki SHIMODA
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (34 commits)
    virtio_net: Add schedule check to napi_enable call
    x25: Do not reference freed memory.
    pch_can: fix tseg1/tseg2 setting issue
    isdn: hysdn: Kill (partially buggy) CVS regision log reporting.
    can: softing_cs needs slab.h
    pch_gbe: Fix the issue which a driver locks when rx offload is set by ethtool
    netfilter: nf_conntrack: set conntrack templates again if we return NF_REPEAT
    pch_can: fix module reload issue with MSI
    pch_can: fix rmmod issue
    pch_can: fix 800k comms issue
    net: Fix lockdep regression caused by initializing netdev queues too early.
    net/caif: Fix dangling list pointer in freed object on error.
    USB CDC NCM errata updates for cdc_ncm host driver
    CDC NCM errata updates for cdc.h
    ixgbe: update version string
    ixgbe: cleanup variable initialization
    ixgbe: limit VF access to network traffic
    ixgbe: fix for 82599 erratum on Header Splitting
    ixgbe: fix variable set but not used warnings by gcc 4.6
    e1000: add support for Marvell Alaska M88E1118R PHY
    ...

    Linus Torvalds
     

10 Feb, 2011

4 commits

  • In x25_link_free(), we destroy 'nb' before dereferencing
    'nb->dev'. Don't do this, because 'nb' might be freed
    by then.

    Reported-by: Randy Dunlap
    Tested-by: Randy Dunlap
    Signed-off-by: David S. Miller

    David S. Miller
     
  • David S. Miller
     
  • When suspending an associated system, and then resuming,
    the station vif is being reconfigured without taking the
    sdata->u.mgd.mtx lock, which results in the following warning:

    WARNING: at net/mac80211/mlme.c:101 ieee80211_ap_probereq_get+0x58/0xb8 [mac80211]()
    Modules linked in: wl12xx_sdio wl12xx firmware_class crc7 mac80211 cfg80211 [last unloaded: crc7]
    Backtrace:
    [] (dump_backtrace+0x0/0x118) from [] (dump_stack+0x20/0x24)
    r7:00000000 r6:bf12d6ec r5:bf154aac r4:00000065
    [] (dump_stack+0x0/0x24) from [] (warn_slowpath_common+0x5c/0x74)
    [] (warn_slowpath_common+0x0/0x74) from [] (warn_slowpath_null+0x2c/0x34)
    r9:000024ff r8:cd006460 r7:00000001 r6:00000000 r5:00000000
    r4:cf1394a0
    [] (warn_slowpath_null+0x0/0x34) from [] (ieee80211_ap_probereq_get+0x58/0xb8 [mac80211])
    [] (ieee80211_ap_probereq_get+0x0/0xb8 [mac80211]) from [] (wl1271_cmd_build_ap_probe_req+0x30/0xf8 [wl12xx])
    r4:cd007440
    [] (wl1271_cmd_build_ap_probe_req+0x0/0xf8 [wl12xx]) from [] (wl1271_op_bss_info_changed+0x4c4/0x808 [wl12xx])
    r5:cd007440 r4:000003b4
    [] (wl1271_op_bss_info_changed+0x0/0x808 [wl12xx]) from [] (ieee80211_bss_info_change_notify+0x1a4/0x1f8 [mac80211])
    [] (ieee80211_bss_info_change_notify+0x0/0x1f8 [mac80211]) from [] (ieee80211_reconfig+0x4d0/0x668 [mac80211])
    r8:cf0eeea4 r7:cd00671c r6:00000000 r5:cd006460 r4:cf1394a0
    [] (ieee80211_reconfig+0x0/0x668 [mac80211]) from [] (ieee80211_resume+0x60/0x70 [mac80211])
    [] (ieee80211_resume+0x0/0x70 [mac80211]) from [] (wiphy_resume+0x6c/0x7c [cfg80211])
    r5:cd006248 r4:cd006110
    [] (wiphy_resume+0x0/0x7c [cfg80211]) from [] (legacy_resume+0x38/0x70)
    r7:00000000 r6:00000000 r5:cd006248 r4:cd0062fc
    [] (legacy_resume+0x0/0x70) from [] (device_resume+0x168/0x1a0)
    r8:c04ca8d8 r7:cd00627c r6:00000010 r5:cd006248 r4:cd0062fc
    [] (device_resume+0x0/0x1a0) from [] (dpm_resume_end+0xf8/0x3bc)
    r7:00000000 r6:00000005 r5:cd006248 r4:cd0062fc
    [] (dpm_resume_end+0x0/0x3bc) from [] (suspend_devices_and_enter+0x1b0/0x204)
    [] (suspend_devices_and_enter+0x0/0x204) from [] (enter_state+0xf0/0x148)
    r7:c037e978 r6:00000003 r5:c043d807 r4:00000000
    [] (enter_state+0x0/0x148) from [] (state_store+0xa4/0xcc)
    r7:c037e978 r6:00000003 r5:00000003 r4:c043d807
    [] (state_store+0x0/0xcc) from [] (kobj_attr_store+0x20/0x24)
    [] (kobj_attr_store+0x0/0x24) from [] (sysfs_write_file+0x11c/0x150)
    [] (sysfs_write_file+0x0/0x150) from [] (vfs_write+0xc0/0x14c)
    [] (vfs_write+0x0/0x14c) from [] (sys_write+0x4c/0x78)
    r8:40126000 r7:00000004 r6:cf1a7c80 r5:00000000 r4:00000000
    [] (sys_write+0x0/0x78) from [] (ret_fast_syscall+0x0/0x30)
    r8:c00502c8 r7:00000004 r6:403525e8 r5:40126000 r4:00000004

    Signed-off-by: Eliad Peller
    Signed-off-by: John W. Linville

    Eliad Peller
     
  • John W. Linville
     

09 Feb, 2011

4 commits

  • The TCP tracking code has a special case that allows to return
    NF_REPEAT if we receive a new SYN packet while in TIME_WAIT state.

    In this situation, the TCP tracking code destroys the existing
    conntrack to start a new clean session.

    [DESTROY] tcp 6 src=192.168.0.2 dst=192.168.1.2 sport=38925 dport=8000 src=192.168.1.2 dst=192.168.1.100 sport=8000 dport=38925 [ASSURED]
    [NEW] tcp 6 120 SYN_SENT src=192.168.0.2 dst=192.168.1.2 sport=38925 dport=8000 [UNREPLIED] src=192.168.1.2 dst=192.168.1.100 sport=8000 dport=38925

    However, this is a problem for the iptables' CT target event filtering
    which will not work in this case since the conntrack template will not
    be there for the new session. To fix this, we reassign the conntrack
    template to the packet if we return NF_REPEAT.

    Signed-off-by: Pablo Neira Ayuso
    Signed-off-by: Patrick McHardy

    Pablo Neira Ayuso
     
  • In commit aa9421041128abb4d269ee1dc502ff65fb3b7d69 ("net: init ingress
    queue") we moved the allocation and lock initialization of the queues
    into alloc_netdev_mq() since register_netdevice() is way too late.

    The problem is that dev->type is not setup until the setup()
    callback is invoked by alloc_netdev_mq(), and the dev->type is
    what determines the lockdep class to use for the locks in the
    queues.

    Fix this by doing the queue allocation after the setup() callback
    runs.

    This is safe because the setup() callback is not allowed to make any
    state changes that need to be undone on error (memory allocations,
    etc.). It may, however, make state changes that are undone by
    free_netdev() (such as netif_napi_add(), which is done by the
    ipoib driver's setup routine).

    The previous code also leaked a reference to the &init_net namespace
    object on RX/TX queue allocation failures.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • rtnl_link_ops->setup(), and the "setup" callback passed to alloc_netdev*(),
    cannot make state changes which need to be undone on failure. There is
    no cleanup mechanism available at this point.

    So we have to add the caif private instance to the global list once we
    are sure that register_netdev() has succedded in ->newlink().

    Otherwise, if register_netdev() fails, the caller will invoke free_netdev()
    and we will have a reference to freed up memory on the chnl_net_list.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • David S. Miller
     

08 Feb, 2011

4 commits

  • David S. Miller
     
  • We access the data inside the skbs of two fragments directly using memmove
    during the merge. The data of the skb could span over multiple skb pages. An
    direct access without knowledge about the pages would lead to an invalid memory
    access.

    Signed-off-by: Sven Eckelmann
    [lindner_marek@yahoo.de: Move return from function to the end]
    Signed-off-by: Marek Lindner

    Sven Eckelmann
     
  • Originally x25_parse_facilities returned
    -1 for an error
    0 meaning 0 length facilities
    >0 the length of the facilities parsed.

    5ef41308f94dc ("x25: Prevent crashing when parsing bad X.25 facilities") introduced more
    error checking in x25_parse_facilities however used 0 to indicate bad parsing
    a6331d6f9a429 ("memory corruption in X.25 facilities parsing") followed this further for
    DTE facilities, again using 0 for bad parsing.

    The meaning of 0 got confused in the callers.
    If the facilities are messed up we can't determine where the data starts.
    So patch makes all parsing errors return -1 and ensures callers close and don't use the skb further.

    Reported-by: Andy Whitcroft
    Signed-off-by: Andrew Hendry
    Signed-off-by: David S. Miller

    andrew hendry
     
  • Using skb_header_cloned to check if it's safe to write to the skb is not
    enough - mac80211 also touches the tailroom of the skb.
    Initially this check was only used to increase a counter, however this
    commit changed the code to also skip skb data reallocation if no extra
    head/tailroom was needed:

    commit 4cd06a344db752f513437138953af191cbe9a691
    mac80211: skip unnecessary pskb_expand_head calls

    It added a regression at least with iwl3945, which is fixed by this patch.

    Reported-by: Dmitry Torokhov
    Signed-off-by: Felix Fietkau
    Tested-by: Dmitry Torokhov
    Signed-off-by: John W. Linville

    Felix Fietkau
     

05 Feb, 2011

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (68 commits)
    net: can: janz-ican3: world-writable sysfs termination file
    net: can: at91_can: world-writable sysfs files
    MAINTAINERS: update email ids of the be2net driver maintainers.
    bridge: Don't put partly initialized fdb into hash
    r8169: prevent RxFIFO induced loops in the irq handler.
    r8169: RxFIFO overflow oddities with 8168 chipsets.
    r8169: use RxFIFO overflow workaround for 8168c chipset.
    include/net/genetlink.h: Allow genlmsg_cancel to accept a NULL argument
    net: Provide compat support for SIOCGETMIFCNT_IN6 and SIOCGETSGCNT_IN6.
    net: Support compat SIOCGETVIFCNT ioctl in ipv4.
    net: Fix bug in compat SIOCGETSGCNT handling.
    niu: Fix races between up/down and get_stats.
    tcp_ecn is an integer not a boolean
    atl1c: Add missing PCI device ID
    s390: Fix possibly wrong size in strncmp (smsgiucv)
    s390: Fix wrong size in memcmp (netiucv)
    qeth: allow OSA CHPARM change in suspend state
    qeth: allow HiperSockets framesize change in suspend
    qeth: add more strict MTU checking
    qeth: show new mac-address if its setting fails
    ...

    Linus Torvalds
     
  • The fdb_create() puts a new fdb into hash with only addr set. This is
    not good, since there are callers, that search the hash w/o the lock
    and access all the other its fields.

    Applies to current netdev tree.

    Signed-off-by: Pavel Emelyanov
    Signed-off-by: David S. Miller

    Pavel Emelyanov
     

04 Feb, 2011

3 commits


03 Feb, 2011

3 commits

  • David S. Miller
     
  • Like Herbert's change from a few days ago:

    66c46d741e2e60f0e8b625b80edb0ab820c46d7a gro: Reset dev pointer on reuse

    this may not be necessary at this point, but we should still clean up
    the skb->skb_iif. If not we may end up with an invalid valid for
    skb->skb_iif when the skb is reused and the check is done in
    __netif_receive_skb.

    Signed-off-by: Andy Gospodarek
    Signed-off-by: David S. Miller

    Andy Gospodarek
     
  • When the off-channel TX is done with remain-on-channel
    offloaded to hardware, the reported cookie is wrong as
    in that case we shouldn't use the SKB as the cookie but
    need to instead use the corresponding r-o-c cookie
    (XOR'ed with 2 to prevent API mismatches).

    Fix this by keeping track of the hw_roc_skb pointer
    just for the status processing and use the correct
    cookie to report in this case. We can't use the
    hw_roc_skb pointer itself because it is NULL'ed when
    the frame is transmitted to prevent it being used
    twice.

    This fixes a bug where the P2P state machine in the
    supplicant gets stuck because it never gets a correct
    result for its transmitted frame.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

02 Feb, 2011

1 commit

  • This patch fixes a minor issue that two connection responses will be sent
    for one L2CAP connection request. If the L2CAP connection request is first
    blocked due to security reason and responded with reason "security block",
    the state of the connection remains BT_CONNECT2. If a pairing procedure
    completes successfully before the ACL connection is down, local host will
    send another connection complete response. See the following packets
    captured by hcidump.

    2010-12-07 22:21:24.928096 < ACL data: handle 12 flags 0x00 dlen 16
    0000: 0c 00 01 00 03 19 08 00 41 00 53 00 03 00 00 00 ........A.S.....
    ... ...

    2010-12-07 22:21:35.791747 > HCI Event: Auth Complete (0x06) plen 3
    status 0x00 handle 12
    ... ...

    2010-12-07 22:21:35.872372 > ACL data: handle 12 flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0054 scid 0x0040 result 0 status 0
    Connection successful

    Signed-off-by: Liang Bao
    Acked-by: Ville Tervo
    Signed-off-by: Gustavo F. Padovan

    Bao Liang
     

01 Feb, 2011

3 commits

  • For the following rule:

    iptables -I PREROUTING -t raw -j CT --ctevents assured

    The event delivered looks like the following:

    [UPDATE] tcp 6 src=192.168.0.2 dst=192.168.1.2 sport=37041 dport=80 src=192.168.1.2 dst=192.168.1.100 sport=80 dport=37041 [ASSURED]

    Note that the TCP protocol state is not included. For that reason
    the CT event filtering is not very useful for conntrackd.

    To resolve this issue, instead of conditionally setting the CT events
    bits based on the ctmask, we always set them and perform the filtering
    in the late stage, just before the delivery.

    Thus, the event delivered looks like the following:

    [UPDATE] tcp 6 432000 ESTABLISHED src=192.168.0.2 dst=192.168.1.2 sport=37041 dport=80 src=192.168.1.2 dst=192.168.1.100 sport=80 dport=37041 [ASSURED]

    Signed-off-by: Pablo Neira Ayuso
    Signed-off-by: Patrick McHardy

    Pablo Neira Ayuso
     
  • In 135367b "netfilter: xtables: change xt_target.checkentry return type",
    the type returned by checkentry was changed from boolean to int, but the
    return values where not adjusted.

    arptables: Input/output error

    This broke arptables with the mangle target since it returns true
    under success, which is interpreted by xtables as >0, thus
    returning EIO.

    Signed-off-by: Pablo Neira Ayuso
    Signed-off-by: Patrick McHardy

    Pablo Neira Ayuso
     
  • In my testing of 2.6.37 I was occassionally getting a warning about
    sysctl table entries being unregistered in the wrong order. Digging
    in it turns out this dates back to the last great sysctl reorg done
    where Al Viro introduced the requirement that sysctl directories
    needed to be created before and destroyed after the files in them.

    It turns out that in that great reorg /proc/sys/net/ipv6/neigh was
    overlooked. So this patch fixes that oversight and makes an annoying
    warning message go away.

    >------------[ cut here ]------------
    >WARNING: at kernel/sysctl.c:1992 unregister_sysctl_table+0x134/0x164()
    >Pid: 23951, comm: kworker/u:3 Not tainted 2.6.37-350888.2010AroraKernelBeta.fc14.x86_64 #1
    >Call Trace:
    > [] warn_slowpath_common+0x80/0x98
    > [] warn_slowpath_null+0x15/0x17
    > [] unregister_sysctl_table+0x134/0x164
    > [] ? kfree+0xc4/0xd1
    > [] neigh_sysctl_unregister+0x22/0x3a
    > [] addrconf_ifdown+0x33f/0x37b [ipv6]
    > [] ? skb_dequeue+0x5f/0x6b
    > [] addrconf_notify+0x69b/0x75c [ipv6]
    > [] ? ip6mr_device_event+0x98/0xa9 [ipv6]
    > [] notifier_call_chain+0x32/0x5e
    > [] raw_notifier_call_chain+0xf/0x11
    > [] call_netdevice_notifiers+0x45/0x4a
    > [] rollback_registered_many+0x118/0x201
    > [] unregister_netdevice_many+0x16/0x6d
    > [] default_device_exit_batch+0xa4/0xb8
    > [] ? cleanup_net+0x0/0x194
    > [] ops_exit_list+0x4e/0x56
    > [] cleanup_net+0xf4/0x194
    > [] process_one_work+0x187/0x280
    > [] worker_thread+0xff/0x19f
    > [] ? worker_thread+0x0/0x19f
    > [] kthread+0x7d/0x85
    > [] kernel_thread_helper+0x4/0x10
    > [] ? kthread+0x0/0x85
    > [] ? kernel_thread_helper+0x0/0x10
    >---[ end trace 8a7e9310b35e9486 ]---

    Signed-off-by: Eric W. Biederman
    Signed-off-by: David S. Miller

    Eric W. Biederman