19 Mar, 2010

1 commit


17 Mar, 2010

7 commits

  • Otherwise we get a warning from the call in br_forward().

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Without CONFIG_BRIDGE_IGMP_SNOOPING,
    BR_INPUT_SKB_CB(skb)->mrouters_only is not appropriately
    initialized, so we can see garbage.

    A clear option to fix this is to set it even without that
    config, but we cannot optimize out the branch.

    Let's introduce a macro that returns value of mrouters_only
    and let it return 0 without CONFIG_BRIDGE_IGMP_SNOOPING.

    Signed-off-by: YOSHIFUJI Hideaki
    Signed-off-by: David S. Miller

    YOSHIFUJI Hideaki / 吉藤英明
     
  • route: Fix caught BUG_ON during rt_secret_rebuild_oneshot()

    Call rt_secret_rebuild can cause BUG_ON(timer_pending(&net->ipv4.rt_secret_timer)) in
    add_timer as there is not any synchronization for call rt_secret_rebuild_oneshot()
    for the same net namespace.

    Also this issue affects to rt_secret_reschedule().

    Thus use mod_timer enstead.

    Signed-off-by: Vitaliy Gusev
    Acked-by: Neil Horman
    Signed-off-by: David S. Miller

    Vitaliy Gusev
     
  • Signed-off-by: YOSHIFUJI Hideaki
    Signed-off-by: David S. Miller

    YOSHIFUJI Hideaki / 吉藤英明
     
  • Signed-off-by: YOSHIFUJI Hideaki
    Signed-off-by: David S. Miller

    YOSHIFUJI Hideaki / 吉藤英明
     
  • Stanse found that one error path in netpoll_setup dereferences npinfo
    even though it is NULL. Avoid that by adding new label and go to that
    instead.

    Signed-off-by: Jiri Slaby
    Cc: Daniel Borkmann
    Cc: David S. Miller
    Acked-by: chavey@google.com
    Acked-by: Matt Mackall
    Signed-off-by: David S. Miller

    Jiri Slaby
     
  • So in the forward porting of various tipc packages, I was constantly
    getting this lockdep warning everytime I used tipc-config to set a network
    address for the protocol:

    [ INFO: possible circular locking dependency detected ]
    2.6.33 #1
    tipc-config/1326 is trying to acquire lock:
    (ref_table_lock){+.-...}, at: [] tipc_ref_discard+0x53/0xd4 [tipc]

    but task is already holding lock:
    (&(&entry->lock)->rlock#2){+.-...}, at: [] tipc_ref_lock+0x43/0x63 [tipc]

    which lock already depends on the new lock.

    the existing dependency chain (in reverse order) is:

    -> #1 (&(&entry->lock)->rlock#2){+.-...}:
    [] __lock_acquire+0xb67/0xd0f
    [] lock_acquire+0xdc/0x102
    [] _raw_spin_lock_bh+0x3b/0x6e
    [] tipc_ref_acquire+0xe8/0x11b [tipc]
    [] tipc_createport_raw+0x78/0x1b9 [tipc]
    [] tipc_createport+0x8b/0x125 [tipc]
    [] tipc_subscr_start+0xce/0x126 [tipc]
    [] process_signal_queue+0x47/0x7d [tipc]
    [] tasklet_action+0x8c/0xf4
    [] __do_softirq+0xf8/0x1cd
    [] call_softirq+0x1c/0x30
    [] _local_bh_enable_ip+0xb8/0xd7
    [] local_bh_enable_ip+0xe/0x10
    [] _raw_spin_unlock_bh+0x34/0x39
    [] spin_unlock_bh.clone.0+0x15/0x17 [tipc]
    [] tipc_k_signal+0x8d/0xb1 [tipc]
    [] tipc_core_start+0x8a/0xad [tipc]
    [] 0xffffffffa01b1087
    [] do_one_initcall+0x72/0x18a
    [] sys_init_module+0xd8/0x23a
    [] system_call_fastpath+0x16/0x1b

    -> #0 (ref_table_lock){+.-...}:
    [] __lock_acquire+0xa11/0xd0f
    [] lock_acquire+0xdc/0x102
    [] _raw_write_lock_bh+0x3b/0x6e
    [] tipc_ref_discard+0x53/0xd4 [tipc]
    [] tipc_deleteport+0x40/0x119 [tipc]
    [] release+0xeb/0x137 [tipc]
    [] sock_release+0x1f/0x6f
    [] sock_close+0x27/0x2b
    [] __fput+0x12a/0x1df
    [] fput+0x1a/0x1c
    [] filp_close+0x68/0x72
    [] sys_close+0xad/0xe7
    [] system_call_fastpath+0x16/0x1b

    Finally decided I should fix this. Its a straightforward inversion,
    tipc_ref_acquire takes two locks in this order:
    ref_table_lock
    entry->lock

    while tipc_deleteport takes them in this order:
    entry->lock (via tipc_port_lock())
    ref_table_lock (via tipc_ref_discard())

    when the same entry is referenced, we get the above warning. The fix is equally
    straightforward. Theres no real relation between the entry->lock and the
    ref_table_lock (they just are needed at the same time), so move the entry->lock
    aquisition in tipc_ref_acquire down, after we unlock ref_table_lock (this is
    safe since the ref_table_lock guards changes to the reference table, and we've
    already claimed a slot there. I've tested the below fix and confirmed that it
    clears up the lockdep issue

    Signed-off-by: Neil Horman
    CC: Allan Stephens
    Signed-off-by: David S. Miller

    Neil Horman
     

16 Mar, 2010

5 commits

  • From: Michael Braun

    bridge: Fix br_forward crash in promiscuous mode

    It's a linux-next kernel from 2010-03-12 on an x86 system and it
    OOPs in the bridge module in br_pass_frame_up (called by
    br_handle_frame_finish) because brdev cannot be dereferenced (its set to
    a non-null value).

    Adding some BUG_ON statements revealed that
    BR_INPUT_SKB_CB(skb)->brdev == br-dev
    (as set in br_handle_frame_finish first)
    only holds until br_forward is called.
    The next call to br_pass_frame_up then fails.

    Digging deeper it seems that br_forward either frees the skb or passes
    it to NF_HOOK which will in turn take care of freeing the skb. The
    same is holds for br_pass_frame_ip. So it seems as if two independent
    skb allocations are required. As far as I can see, commit
    b33084be192ee1e347d98bb5c9e38a53d98d35e2 ("bridge: Avoid unnecessary
    clone on forward path") removed skb duplication and so likely causes
    this crash. This crash does not happen on 2.6.33.

    I've therefore modified br_forward the same way br_flood has been
    modified so that the skb is not freed if skb0 is going to be used
    and I can confirm that the attached patch resolves the issue for me.

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

    Michael Braun
     
  • Since all callers of br_mdb_ip_get need to check whether the
    hash table is NULL, this patch moves the check into the function.

    This fixes the two callers (query/leave handler) that didn't
    check it.

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

    Herbert Xu
     
  • David S. Miller
     
  • dccp: fix panic caused by failed initialisation

    This fixes a kernel panic reported thanks to Andre Noll:

    if DCCP is compiled into the kernel and any out of the initialisation
    steps in net/dccp/proto.c:dccp_init() fail, a subsequent attempt to create
    a SOCK_DCCP socket will panic, since inet{,6}_create() are not prevented
    from creating DCCP sockets.

    This patch fixes the problem by propagating a failure in dccp_init() to
    dccp_v{4,6}_init_net(), and from there to dccp_v{4,6}_init(), so that the
    DCCP protocol is not made available if its initialisation fails.

    Signed-off-by: Gerrit Renker
    Signed-off-by: David S. Miller

    Gerrit Renker
     
  • Replace open-coded loop with for_each_set_bit().

    Signed-off-by: Akinobu Mita
    Cc: "David S. Miller"
    Signed-off-by: Andrew Morton
    Acked-by: Rémi Denis-Courmont
    Signed-off-by: David S. Miller

    Akinobu Mita
     

15 Mar, 2010

1 commit


14 Mar, 2010

4 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (108 commits)
    bridge: ensure to unlock in error path in br_multicast_query().
    drivers/net/tulip/eeprom.c: fix bogus "(null)" in tulip init messages
    sky2: Avoid rtnl_unlock without rtnl_lock
    ipv6: Send netlink notification when DAD fails
    drivers/net/tg3.c: change the field used with the TG3_FLAG_10_100_ONLY constant
    ipconfig: Handle devices which take some time to come up.
    mac80211: Fix memory leak in ieee80211_if_write()
    mac80211: Fix (dynamic) power save entry
    ipw2200: use kmalloc for large local variables
    ath5k: read eeprom IQ calibration values correctly for G mode
    ath5k: fix I/Q calibration (for real)
    ath5k: fix TSF reset
    ath5k: use fixed antenna for tx descriptors
    libipw: split ieee->networks into small pieces
    mac80211: Fix sta_mtx unlocking on insert STA failure path
    rt2x00: remove KSEG1ADDR define from rt2x00soc.h
    net: add ColdFire support to the smc91x driver
    asix: fix setting mac address for AX88772
    ipv6 ip6_tunnel: eliminate unused recursion field from ip6_tnl{}.
    net: Fix dev_mc_add()
    ...

    Linus Torvalds
     
  • Signed-off-by: YOSHIFUJI Hideaki
    Signed-off-by: David S. Miller

    YOSHIFUJI Hideaki
     
  • If we are managing IPv6 addresses using DHCP, it would be nice
    for user-space to be notified if an address configured through
    DHCP fails DAD. Otherwise user-space would have to poll to see
    whether DAD succeeds.

    This patch uses the existing notification mechanism and simply
    hooks it into the DAD failure code path.

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

    Herbert Xu
     
  • David S. Miller
     

13 Mar, 2010

4 commits

  • This patch changes the name of the new 9P protocol from 9p2010.L to
    9p2000.u. This is because we learnt that the name 9p2010 is already
    being used by others.

    Signed-off-by: Sripathi Kodi
    Signed-off-by: Eric Van Hensbergen

    Sripathi Kodi
     
  • This adds a new file for virtio 9P device. The file
    contain details of the mount device name that should
    be used to mount the 9P file system.

    Ex: /sys/devices/virtio-pci/virtio1/mount_tag file now
    contian the tag name to be used to mount the 9P file system.

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     
  • This patch use the tag name in the config space to identify the
    mount device. The the virtio device name depend on the enumeration
    order of the device and may not remain the same across multiple boots
    So we use the tag name which is set via qemu option to uniquely identify
    the mount device

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (56 commits)
    doc: fix typo in comment explaining rb_tree usage
    Remove fs/ntfs/ChangeLog
    doc: fix console doc typo
    doc: cpuset: Update the cpuset flag file
    Fix of spelling in arch/sparc/kernel/leon_kernel.c no longer needed
    Remove drivers/parport/ChangeLog
    Remove drivers/char/ChangeLog
    doc: typo - Table 1-2 should refer to "status", not "statm"
    tree-wide: fix typos "ass?o[sc]iac?te" -> "associate" in comments
    No need to patch AMD-provided drivers/gpu/drm/radeon/atombios.h
    devres/irq: Fix devm_irq_match comment
    Remove reference to kthread_create_on_cpu
    tree-wide: Assorted spelling fixes
    tree-wide: fix 'lenght' typo in comments and code
    drm/kms: fix spelling in error message
    doc: capitalization and other minor fixes in pnp doc
    devres: typo fix s/dev/devm/
    Remove redundant trailing semicolons from macros
    fix typo "definetly" -> "definitely" in comment
    tree-wide: s/widht/width/g typo in comments
    ...

    Fix trivial conflict in Documentation/laptops/00-INDEX

    Linus Torvalds
     

12 Mar, 2010

1 commit

  • Some network devices, particularly USB ones, take several seconds to
    fully init and appear in the device list.

    If the user turned ipconfig on, they are using it for NFS root or some
    other early booting purpose. So it makes no sense to just flat out
    fail immediately if the device isn't found.

    It also doesn't make sense to just jack up the initial wait to
    something crazy like 10 seconds.

    Instead, poll immediately, and then periodically once a second,
    waiting for a usable device to appear. Fail after 12 seconds.

    Signed-off-by: David S. Miller
    Tested-by: Christian Pellegrin

    David S. Miller
     

11 Mar, 2010

3 commits

  • Fix memory leak and use kmalloc() instead of kzalloc() as we are going
    to overwrite the allocated buffer.

    Signed-off-by: Eric Dumazet
    Signed-off-by: John W. Linville

    Eric Dumazet
     
  • Currently hardware with !IEEE80211_HW_PS_NULLFUNC_STACK and
    IEEE80211_HW_REPORTS_TX_ACK_STATUS will never enter PSM due to the
    conditions in the power save entry functions.

    Fix those conditions.

    Signed-off-by: Juuso Oikarinen
    Cc: stable@kernel.org
    Signed-off-by: John W. Linville

    Juuso Oikarinen
     
  • Commit 34e895075e21be3e21e71d6317440d1ee7969ad0 introduced sta_mtx
    locking into sta_info_insert() (now sta_info_insert_rcu), but forgot
    to unlock this mutex on one of the error paths. Fix this by adding
    the missing mutex_unlock() call for the case where STA insert fails
    due to an entry existing already. This may happen at least in AP mode
    when a STA roams between two BSSes (vifs).

    Signed-off-by: Jouni Malinen
    Signed-off-by: John W. Linville

    Jouni Malinen
     

10 Mar, 2010

3 commits

  • Commit 6e17d45a (net: add addr len check to dev_mc_add)
    added a bug in dev_mc_add(), since it can now exit with a lock
    imbalance.

    Signed-off-by: Eric Dumazet
    CC: Jiri Pirko
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • Annotates neigh_invalidate() with __releases() and __acquires() for
    sparse sake.

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

    Eric Dumazet
     
  • Commit d218d111 (tcp: Generalized TTL Security Mechanism) added a bug
    for TIMEWAIT sockets. We should not test min_ttl for TW sockets.

    Reported-by: Tetsuo Handa
    Signed-off-by: Eric Dumazet
    Acked-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Eric Dumazet
     

09 Mar, 2010

9 commits

  • Port commit 20deb48d16fdd07ce2fdc8d03ea317362217e085
    from git://tipc.cslab.ericsson.net/pub/git/people/allan/tipc.git

    Part of the large effort I'm trying to help with getting all the downstreamed
    code from windriver forward ported to the upstream tree

    Origional commit message
    Restore check to filter out inadverdently received messages
    This patch reimplements a check that allows TIPC to discard messages
    that are not intended for it. This check was present in TIPC 1.5/1.6,
    but was removed by accident during the development of TIPC 1.7; it has
    now been updated to account for new features present in TIPC 1.7 and
    reinserted into TIPC. The main benefit of this check is to filter
    out messages arriving from orphaned link endpoints, which can arise
    when a node exits the network and then re-enters it with a different
    TIPC network address (i.e. value).

    Signed-off-by: Neil Horman
    Origionally-authored-by: Allan Stephens
    Signed-off-by: David S. Miller

    Neil Horman
     
  • Remove htohl implementation from tipc

    I was working on forward porting the downstream commits for TIPC and ran accross this one:
    http://tipc.cslab.ericsson.net/cgi-bin/gitweb.cgi?p=people/allan/tipc.git;a=commitdiff;h=894279b9437b63cbb02405ad5b8e033b51e4e31e

    I was going to just take it, when I looked closer and noted what it was doing.
    This is basically a routine to byte swap fields of data in sent/received packets
    for tipc, dependent upon the receivers guessed endianness of the peer when a
    connection is established. Asside from just seeming silly to me, it appears to
    violate the latest RFC draft for tipc:
    http://tipc.sourceforge.net/doc/draft-spec-tipc-02.txt
    Which, according to section 4.2 and 4.3.3, requires that all fields of all
    commands be sent in network byte order. So instead of just taking this patch,
    instead I'm removing the htohl function and replacing the calls with calls to
    ntohl in the rx path and htonl in the send path.

    As part of this fix, I'm also changing the subscr_cancel function, which
    searches the list of subscribers, using a memcmp of the entire subscriber list,
    for the entry to tear down. unfortunately it memcmps the entire tipc_subscr
    structure which has several bits that are private to the local side, so nothing
    will ever match. section 5.2 of the draft spec indicates the
    tuple should uniquely identify a subscriber, so convert subscr_cancel to just
    match on those fields (properly endian swapped).

    I've tested this using the tipc test suite, and its passed without issue.

    Signed-off-by: Neil Horman
    Signed-off-by: David S. Miller

    Neil Horman
     
  • Use self documenting noinline_for_stack instead of duplicated comments.

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

    Eric Dumazet
     
  • (Applies on top of "Remove uses of NIPQUAD, use %pI4")

    Casts to void of snprintf are most uncommon in kernel source.
    9 use casts, 1301 do not.

    Remove the remaining uses in net/sunrpc/

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches
     
  • Originally submitted Jan 1, 2010
    http://patchwork.kernel.org/patch/71221/

    Convert NIPQUAD to the %pI4 format extension where possible
    Convert %02x%02x%02x%02x/NIPQUAD to %08x/ntohl

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches
     
  • Commit 4957faad (TCPCT part 1g: Responder Cookie => Initiator), part
    of TCP_COOKIE_TRANSACTION implementation, forgot to correctly size
    synack skb in case user data must be included.

    Many thanks to Mika Pentillä for spotting this error.

    Reported-by: Penttillä Mika
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • If NFSv4 client send a request before connect, or the old connection was broken
    because a ETIMEOUT error catched by call_status, ->send_request will return
    ENOSOCK, but rpc layer can not deal with it, so make sure ->send_request can
    translate ENOSOCK into ENOCONN.

    Signed-off-by: Bian Naimeng
    Signed-off-by: Trond Myklebust

    Bian Naimeng
     
  • We added an automatic route cache rebuilding in commit 1080d709fb9d8cd43
    but had to correct few bugs. One of the assumption of original patch,
    was that entries where kept sorted in a given way.

    This assumption is known to be wrong (commit 1ddbcb005c395518 gave an
    explanation of this and corrected a leak) and expensive to respect.

    Paweł Staszewski reported to me one of his machine got its routing cache
    disabled after few messages like :

    [ 2677.850065] Route hash chain too long!
    [ 2677.850080] Adjust your secret_interval!
    [82839.662993] Route hash chain too long!
    [82839.662996] Adjust your secret_interval!
    [155843.731650] Route hash chain too long!
    [155843.731664] Adjust your secret_interval!
    [155843.811881] Route hash chain too long!
    [155843.811891] Adjust your secret_interval!
    [155843.858209] vlan0811: 5 rebuilds is over limit, route caching
    disabled
    [155843.858212] Route hash chain too long!
    [155843.858213] Adjust your secret_interval!

    This is because rt_intern_hash() might be fooled when computing a chain
    length, because multiple entries with same keys can differ because of
    TOS (or mark/oif) bits.

    In the rare case the fast algorithm see a too long chain, and before
    taking expensive path, we call a helper function in order to not count
    duplicates of same routes, that only differ with tos/mark/oif bits. This
    helper works with data already in cpu cache and is not be very
    expensive, despite its O(N^2) implementation.

    Paweł Staszewski sucessfully tested this patch on his loaded router.

    Reported-and-tested-by: Paweł Staszewski
    Signed-off-by: Eric Dumazet
    Acked-by: Neil Horman
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • Commit 6b03a53a (tcp: use limited socket backlog) added the possibility
    of dropping frames when backlog queue is full.

    Commit d218d111 (tcp: Generalized TTL Security Mechanism) added the
    possibility of dropping frames when TTL is under a given limit.

    This patch adds new SNMP MIB entries, named TCPBacklogDrop and
    TCPMinTTLDrop, published in /proc/net/netstat in TcpExt: line

    netstat -s | egrep "TCPBacklogDrop|TCPMinTTLDrop"
    TCPBacklogDrop: 0
    TCPMinTTLDrop: 0

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

    Eric Dumazet
     

08 Mar, 2010

2 commits

  • Conflicts:
    Documentation/filesystems/proc.txt
    arch/arm/mach-u300/include/mach/debug-macro.S
    drivers/net/qlge/qlge_ethtool.c
    drivers/net/qlge/qlge_main.c
    drivers/net/typhoon.c

    Jiri Kosina
     
  • Constify struct sysfs_ops.

    This is part of the ops structure constification
    effort started by Arjan van de Ven et al.

    Benefits of this constification:

    * prevents modification of data that is shared
    (referenced) by many other structure instances
    at runtime

    * detects/prevents accidental (but not intentional)
    modification attempts on archs that enforce
    read-only kernel data at runtime

    * potentially better optimized code as the compiler
    can assume that the const data cannot be changed

    * the compiler/linker move const data into .rodata
    and therefore exclude them from false sharing

    Signed-off-by: Emese Revfy
    Acked-by: David Teigland
    Acked-by: Matt Domsch
    Acked-by: Maciej Sosnowski
    Acked-by: Hans J. Koch
    Acked-by: Pekka Enberg
    Acked-by: Jens Axboe
    Acked-by: Stephen Hemminger
    Signed-off-by: Greg Kroah-Hartman

    Emese Revfy