10 Sep, 2010

1 commit


09 Sep, 2010

6 commits

  • David S. Miller
     
  • commit 30fff923 introduced in linux-2.6.33 (udp: bind() optimisation)
    added a secondary hash on UDP, hashed on (local addr, local port).

    Problem is that following sequence :

    fd = socket(...)
    connect(fd, &remote, ...)

    not only selects remote end point (address and port), but also sets
    local address, while UDP stack stored in secondary hash table the socket
    while its local address was INADDR_ANY (or ipv6 equivalent)

    Sequence is :
    - autobind() : choose a random local port, insert socket in hash tables
    [while local address is INADDR_ANY]
    - connect() : set remote address and port, change local address to IP
    given by a route lookup.

    When an incoming UDP frame comes, if more than 10 sockets are found in
    primary hash table, we switch to secondary table, and fail to find
    socket because its local address changed.

    One solution to this problem is to rehash datagram socket if needed.

    We add a new rehash(struct socket *) method in "struct proto", and
    implement this method for UDP v4 & v6, using a common helper.

    This rehashing only takes care of secondary hash table, since primary
    hash (based on local port only) is not changed.

    Reported-by: Krzysztof Piotr Oledzki
    Signed-off-by: Eric Dumazet
    Tested-by: Krzysztof Piotr Oledzki
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • Blackhole routes are used when xfrm_lookup() returns -EREMOTE (error
    triggered by IKE for example), hence this kind of route is always
    temporary and so we should check if a better route exists for next
    packets.
    Bug has been introduced by commit d11a4dc18bf41719c9f0d7ed494d295dd2973b92.

    Signed-off-by: Jianzhao Wang
    Signed-off-by: Nicolas Dichtel
    Signed-off-by: David S. Miller

    Jianzhao Wang
     
  • Hi,
    Here is one more of these warnings and a patch below:

    Sep 5 23:52:33 del kernel: [46044.244833] ===================================================
    Sep 5 23:52:33 del kernel: [46044.269681] [ INFO: suspicious rcu_dereference_check() usage. ]
    Sep 5 23:52:33 del kernel: [46044.277000] ---------------------------------------------------
    Sep 5 23:52:33 del kernel: [46044.285185] net/ipv4/fib_trie.c:1756 invoked rcu_dereference_check() without protection!
    Sep 5 23:52:33 del kernel: [46044.293627]
    Sep 5 23:52:33 del kernel: [46044.293632] other info that might help us debug this:
    Sep 5 23:52:33 del kernel: [46044.293634]
    Sep 5 23:52:33 del kernel: [46044.325333]
    Sep 5 23:52:33 del kernel: [46044.325335] rcu_scheduler_active = 1, debug_locks = 0
    Sep 5 23:52:33 del kernel: [46044.348013] 1 lock held by pppd/1717:
    Sep 5 23:52:33 del kernel: [46044.357548] #0: (rtnl_mutex){+.+.+.}, at: [] rtnl_lock+0xf/0x20
    Sep 5 23:52:33 del kernel: [46044.367647]
    Sep 5 23:52:33 del kernel: [46044.367652] stack backtrace:
    Sep 5 23:52:33 del kernel: [46044.387429] Pid: 1717, comm: pppd Not tainted 2.6.35.4.4a #3
    Sep 5 23:52:33 del kernel: [46044.398764] Call Trace:
    Sep 5 23:52:33 del kernel: [46044.409596] [] ? printk+0x18/0x1e
    Sep 5 23:52:33 del kernel: [46044.420761] [] lockdep_rcu_dereference+0xa9/0xb0
    Sep 5 23:52:33 del kernel: [46044.432229] [] trie_firstleaf+0x65/0x70
    Sep 5 23:52:33 del kernel: [46044.443941] [] fib_table_flush+0x14/0x170
    Sep 5 23:52:33 del kernel: [46044.455823] [] ? local_bh_enable_ip+0x62/0xd0
    Sep 5 23:52:33 del kernel: [46044.467995] [] ? _raw_spin_unlock_bh+0x2f/0x40
    Sep 5 23:52:33 del kernel: [46044.480404] [] ? fib_sync_down_dev+0x120/0x180
    Sep 5 23:52:33 del kernel: [46044.493025] [] fib_flush+0x2d/0x60
    Sep 5 23:52:33 del kernel: [46044.505796] [] fib_disable_ip+0x25/0x50
    Sep 5 23:52:33 del kernel: [46044.518772] [] fib_netdev_event+0x73/0xd0
    Sep 5 23:52:33 del kernel: [46044.531918] [] notifier_call_chain+0x2d/0x70
    Sep 5 23:52:33 del kernel: [46044.545358] [] raw_notifier_call_chain+0x1a/0x20
    Sep 5 23:52:33 del kernel: [46044.559092] [] call_netdevice_notifiers+0x27/0x60
    Sep 5 23:52:33 del kernel: [46044.573037] [] __dev_notify_flags+0x5c/0x80
    Sep 5 23:52:33 del kernel: [46044.586489] [] dev_change_flags+0x37/0x60
    Sep 5 23:52:33 del kernel: [46044.599394] [] devinet_ioctl+0x54d/0x630
    Sep 5 23:52:33 del kernel: [46044.612277] [] inet_ioctl+0x97/0xc0
    Sep 5 23:52:34 del kernel: [46044.625208] [] sock_ioctl+0x6f/0x270
    Sep 5 23:52:34 del kernel: [46044.638046] [] ? handle_mm_fault+0x420/0x6c0
    Sep 5 23:52:34 del kernel: [46044.650968] [] ? sock_ioctl+0x0/0x270
    Sep 5 23:52:34 del kernel: [46044.663865] [] vfs_ioctl+0x28/0xa0
    Sep 5 23:52:34 del kernel: [46044.676556] [] do_vfs_ioctl+0x6a/0x5c0
    Sep 5 23:52:34 del kernel: [46044.688989] [] ? up_read+0x16/0x30
    Sep 5 23:52:34 del kernel: [46044.701411] [] ? do_page_fault+0x1d6/0x3a0
    Sep 5 23:52:34 del kernel: [46044.714223] [] ? fget_light+0xf8/0x2f0
    Sep 5 23:52:34 del kernel: [46044.726601] [] ? sys_socketcall+0x208/0x2c0
    Sep 5 23:52:34 del kernel: [46044.739140] [] sys_ioctl+0x63/0x70
    Sep 5 23:52:34 del kernel: [46044.751967] [] syscall_call+0x7/0xb
    Sep 5 23:52:34 del kernel: [46044.764734] [] ? cookie_v6_check+0x3d0/0x630

    -------------->

    This patch fixes the warning:
    ===================================================
    [ INFO: suspicious rcu_dereference_check() usage. ]
    ---------------------------------------------------
    net/ipv4/fib_trie.c:1756 invoked rcu_dereference_check() without protection!

    other info that might help us debug this:

    rcu_scheduler_active = 1, debug_locks = 0
    1 lock held by pppd/1717:
    #0: (rtnl_mutex){+.+.+.}, at: [] rtnl_lock+0xf/0x20

    stack backtrace:
    Pid: 1717, comm: pppd Not tainted 2.6.35.4a #3
    Call Trace:
    [] ? printk+0x18/0x1e
    [] lockdep_rcu_dereference+0xa9/0xb0
    [] trie_firstleaf+0x65/0x70
    [] fib_table_flush+0x14/0x170
    ...

    Allow trie_firstleaf() to be called either under rcu_read_lock()
    protection or with RTNL held. The same annotation is added to
    node_parent_rcu() to prevent a similar warning a bit later.

    Followup of commits 634a4b20 and 4eaa0e3c.

    Signed-off-by: Jarek Poplawski
    Signed-off-by: David S. Miller

    Jarek Poplawski
     
  • - Do not create expectation when forwarding the PORT
    command to avoid blocking the connection. The problem is that
    nf_conntrack_ftp.c:help() tries to create the same expectation later in
    POST_ROUTING and drops the packet with "dropping packet" message after
    failure in nf_ct_expect_related.

    - Change ip_vs_update_conntrack to alter the conntrack
    for related connections from real server. If we do not alter the reply in
    this direction the next packet from client sent to vport 20 comes as NEW
    connection. We alter it but may be some collision happens for both
    conntracks and the second conntrack gets destroyed immediately. The
    connection stucks too.

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

    Julian Anastasov
     
  • The patch: "gro: fix different skb headrooms" in its part:
    "2) allocate a minimal skb for head of frag_list" is buggy. The copied
    skb has p->data set at the ip header at the moment, and skb_gro_offset
    is the length of ip + tcp headers. So, after the change the length of
    mac header is skipped. Later skb_set_mac_header() sets it into the
    NET_SKB_PAD area (if it's long enough) and ip header is misaligned at
    NET_SKB_PAD + NET_IP_ALIGN offset. There is no reason to assume the
    original skb was wrongly allocated, so let's copy it as it was.

    bugzilla : https://bugzilla.kernel.org/show_bug.cgi?id=16626
    fixes commit: 3d3be4333fdf6faa080947b331a6a19bce1a4f57

    Reported-by: Plamen Petrov
    Signed-off-by: Jarek Poplawski
    CC: Eric Dumazet
    Acked-by: Eric Dumazet
    Tested-by: Plamen Petrov
    Signed-off-by: David S. Miller

    Jarek Poplawski
     

08 Sep, 2010

7 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (26 commits)
    pkt_sched: Fix lockdep warning on est_tree_lock in gen_estimator
    ipvs: avoid oops for passive FTP
    Revert "sky2: don't do GRO on second port"
    gro: fix different skb headrooms
    bridge: Clear INET control block of SKBs passed into ip_fragment().
    3c59x: Remove incorrect locking; correct documented lock hierarchy
    sky2: don't do GRO on second port
    ipv4: minor fix about RPF in help of Kconfig
    xfrm_user: avoid a warning with some compiler
    net/sched/sch_hfsc.c: initialize parent's cl_cfmin properly in init_vf()
    pxa168_eth: fix a mdiobus leak
    net sched: fix kernel leak in act_police
    vhost: stop worker only if created
    MAINTAINERS: Add ehea driver as Supported
    ath9k_hw: fix parsing of HT40 5 GHz CTLs
    ath9k_hw: Fix EEPROM uncompress block reading on AR9003
    wireless: register wiphy rfkill w/o holding cfg80211_mutex
    netlink: Make NETLINK_USERSOCK work again.
    irda: Correctly clean up self->ias_obj on irda_bind() failure.
    wireless extensions: fix kernel heap content leak
    ...

    Linus Torvalds
     
  • Actually iterate over the next-hops to make sure we have
    a device match. Otherwise RP filtering is always elided
    when the route matched has multiple next-hops.

    Reported-by: Igor M Podlesny
    Signed-off-by: David S. Miller

    David S. Miller
     
  • We assumed that unix_autobind() never fails if kzalloc() succeeded.
    But unix_autobind() allows only 1048576 names. If /proc/sys/fs/file-max is
    larger than 1048576 (e.g. systems with more than 10GB of RAM), a local user can
    consume all names using fork()/socket()/bind().

    If all names are in use, those who call bind() with addr_len == sizeof(short)
    or connect()/sendmsg() with setsockopt(SO_PASSCRED) will continue

    while (1)
    yield();

    loop at unix_autobind() till a name becomes available.
    This patch adds a loop counter in order to give up after 1048576 attempts.

    Calling yield() for once per 256 attempts may not be sufficient when many names
    are already in use, for __unix_find_socket_byname() can take long time under
    such circumstance. Therefore, this patch also adds cond_resched() call.

    Note that currently a local user can consume 2GB of kernel memory if the user
    is allowed to create and autobind 1048576 UNIX domain sockets. We should
    consider adding some restriction for autobind operation.

    Signed-off-by: Tetsuo Handa
    Signed-off-by: David S. Miller

    Tetsuo Handa
     
  • This is an off by one. We would go past the end when we NUL terminate
    the "value" string at end of the function. The "value" buffer is
    allocated in irlan_client_parse_response() or
    irlan_provider_parse_command().

    CC: stable@kernel.org
    Signed-off-by: Dan Carpenter
    Signed-off-by: David S. Miller

    Dan Carpenter
     
  • RFC5722 prohibits reassembling IPv6 fragments when some data overlaps.

    Bug spotted by Zhang Zuotao .

    Signed-off-by: Nicolas Dichtel
    Signed-off-by: David S. Miller

    Nicolas Dichtel
     
  • RFC5722 prohibits reassembling fragments when some data overlaps.

    Bug spotted by Zhang Zuotao .

    Signed-off-by: Nicolas Dichtel
    Signed-off-by: David S. Miller

    Nicolas Dichtel
     
  • When a net device is implementing the select_queue callback and is part of
    a bridge, frames coming from the bridge already have a tx queue associated
    to the socket (introduced in commit a4ee3ce3293dc931fab19beb472a8bde1295aebe,
    "net: Use sk_tx_queue_mapping for connected sockets"). The call to
    sk_tx_queue_get will then return the tx queue used by the bridge instead
    of calling the select_queue callback.

    In case of mac80211 this broke QoS which is implemented by using the
    select_queue callback. Furthermore it introduced problems with rt2x00
    because frames with the same TID and RA sometimes appeared on different
    tx queues which the hw cannot handle correctly.

    Fix this by always calling select_queue first if it is available and only
    afterwards use the socket tx queue mapping.

    Signed-off-by: Helmut Schaa
    Signed-off-by: David S. Miller

    Helmut Schaa
     

03 Sep, 2010

2 commits

  • This patch fixes a lockdep warning:

    [ 516.287584] =========================================================
    [ 516.288386] [ INFO: possible irq lock inversion dependency detected ]
    [ 516.288386] 2.6.35b #7
    [ 516.288386] ---------------------------------------------------------
    [ 516.288386] swapper/0 just changed the state of lock:
    [ 516.288386] (&qdisc_tx_lock){+.-...}, at: [] est_timer+0x62/0x1b4
    [ 516.288386] but this lock took another, SOFTIRQ-unsafe lock in the past:
    [ 516.288386] (est_tree_lock){+.+...}
    [ 516.288386]
    [ 516.288386] and interrupts could create inverse lock ordering between them.
    ...

    So, est_tree_lock needs BH protection because it's taken by
    qdisc_tx_lock, which is used both in BH and process contexts.
    (Full warning with this patch at netdev, 02 Sep 2010.)

    Fixes commit: ae638c47dc040b8def16d05dc6acdd527628f231
    ("pkt_sched: gen_estimator: add a new lock")

    Signed-off-by: Jarek Poplawski
    Signed-off-by: David S. Miller

    Jarek Poplawski
     
  • Fix Passive FTP problem in ip_vs_ftp:

    - Do not oops in nf_nat_set_seq_adjust (adjust_tcp_sequence) when
    iptable_nat module is not loaded

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

    Julian Anastasov
     

02 Sep, 2010

7 commits

  • Packets entering GRO might have different headrooms, even for a given
    flow (because of implementation details in drivers, like copybreak).
    We cant force drivers to deliver packets with a fixed headroom.

    1) fix skb_segment()

    skb_segment() makes the false assumption headrooms of fragments are same
    than the head. When CHECKSUM_PARTIAL is used, this can give csum_start
    errors, and crash later in skb_copy_and_csum_dev()

    2) allocate a minimal skb for head of frag_list

    skb_gro_receive() uses netdev_alloc_skb(headroom + skb_gro_offset(p)) to
    allocate a fresh skb. This adds NET_SKB_PAD to a padding already
    provided by netdevice, depending on various things, like copybreak.

    Use alloc_skb() to allocate an exact padding, to reduce cache line
    needs:
    NET_SKB_PAD + NET_IP_ALIGN

    bugzilla : https://bugzilla.kernel.org/show_bug.cgi?id=16626

    Many thanks to Plamen Petrov, testing many debugging patches !
    With help of Jarek Poplawski.

    Reported-by: Plamen Petrov
    Signed-off-by: Eric Dumazet
    CC: Jarek Poplawski
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • In a similar vain to commit 17762060c25590bfddd68cc1131f28ec720f405f
    ("bridge: Clear IPCB before possible entry into IP stack")

    Any time we call into the IP stack we have to make sure the state
    there is as expected by the ipv4 code.

    With help from Eric Dumazet and Herbert Xu.

    Reported-by: Bandan Das
    Signed-off-by: David S. Miller

    David S. Miller
     
  • Signed-off-by: Nicolas Dichtel
    Signed-off-by: David S. Miller

    Nicolas Dichtel
     
  • Attached is a small patch to remove a warning ("warning: ISO C90 forbids
    mixed declarations and code" with gcc 4.3.2).

    Signed-off-by: Nicolas Dichtel
    Signed-off-by: David S. Miller

    Nicolas Dichtel
     
  • This patch fixes init_vf() function, so on each new backlog period parent's
    cl_cfmin is properly updated (including further propgation towards the root),
    even if the activated leaf has no upperlimit curve defined.

    Signed-off-by: Michal Soltys
    Signed-off-by: David S. Miller

    Michal Soltys
     
  • While reviewing commit 1c40be12f7d8ca1d387510d39787b12e512a7ce8, I
    audited other users of tc_action_ops->dump for information leaks.

    That commit covered almost all of them but act_police still had a leak.

    opt.limit and opt.capab aren't zeroed out before the structure is
    passed out.

    This patch uses the C99 initializers to zero everything unused out.

    Signed-off-by: Jeff Mahoney
    Acked-by: Jeff Mahoney
    Signed-off-by: David S. Miller

    Jeff Mahoney
     
  • David S. Miller
     

01 Sep, 2010

2 commits

  • Otherwise lockdep complains...

    https://bugzilla.kernel.org/show_bug.cgi?id=17311

    [ INFO: possible circular locking dependency detected ]
    2.6.36-rc2-git4 #12
    -------------------------------------------------------
    kworker/0:3/3630 is trying to acquire lock:
    (rtnl_mutex){+.+.+.}, at: [] rtnl_lock+0x12/0x14

    but task is already holding lock:
    (rfkill_global_mutex){+.+.+.}, at: []
    rfkill_switch_all+0x24/0x49 [rfkill]

    which lock already depends on the new lock.

    the existing dependency chain (in reverse order) is:

    -> #2 (rfkill_global_mutex){+.+.+.}:
    [] lock_acquire+0x120/0x15b
    [] __mutex_lock_common+0x54/0x52e
    [] mutex_lock_nested+0x34/0x39
    [] rfkill_register+0x2b/0x29c [rfkill]
    [] wiphy_register+0x1ae/0x270 [cfg80211]
    [] ieee80211_register_hw+0x1b4/0x3cf [mac80211]
    [] iwl_ucode_callback+0x9e9/0xae3 [iwlagn]
    [] request_firmware_work_func+0x54/0x6f
    [] kthread+0x8c/0x94
    [] kernel_thread_helper+0x4/0x10

    -> #1 (cfg80211_mutex){+.+.+.}:
    [] lock_acquire+0x120/0x15b
    [] __mutex_lock_common+0x54/0x52e
    [] mutex_lock_nested+0x34/0x39
    [] cfg80211_get_dev_from_ifindex+0x1b/0x7c [cfg80211]
    [] cfg80211_wext_giwscan+0x58/0x990 [cfg80211]
    [] ioctl_standard_iw_point+0x1a8/0x272
    [] ioctl_standard_call+0x91/0xa7
    [] T.723+0xbd/0x12c
    [] wext_handle_ioctl+0x31/0x6d
    [] dev_ioctl+0x63d/0x67a
    [] sock_ioctl+0x48/0x21d
    [] do_vfs_ioctl+0x4ba/0x509
    [] sys_ioctl+0x51/0x74
    [] system_call_fastpath+0x16/0x1b

    -> #0 (rtnl_mutex){+.+.+.}:
    [] __lock_acquire+0xa93/0xd9a
    [] lock_acquire+0x120/0x15b
    [] __mutex_lock_common+0x54/0x52e
    [] mutex_lock_nested+0x34/0x39
    [] rtnl_lock+0x12/0x14
    [] cfg80211_rfkill_set_block+0x1a/0x7b [cfg80211]
    [] rfkill_set_block+0x80/0xd5 [rfkill]
    [] __rfkill_switch_all+0x3f/0x6f [rfkill]
    [] rfkill_switch_all+0x38/0x49 [rfkill]
    [] rfkill_op_handler+0x105/0x136 [rfkill]
    [] process_one_work+0x248/0x403
    [] worker_thread+0x139/0x214
    [] kthread+0x8c/0x94
    [] kernel_thread_helper+0x4/0x10

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

    John W. Linville
     
  • Once we started enforcing the a nl_table[] entry exist for
    a protocol, NETLINK_USERSOCK stopped working. Add a dummy
    table entry so that it works again.

    Reported-by: Thomas Voegtle
    Tested-by: Thomas Voegtle
    Signed-off-by: David S. Miller

    David S. Miller
     

31 Aug, 2010

3 commits

  • If irda_open_tsap() fails, the irda_bind() code tries to destroy
    the ->ias_obj object by hand, but does so wrongly.

    In particular, it fails to a) release the hashbin attached to the
    object and b) reset the self->ias_obj pointer to NULL.

    Fix both problems by using irias_delete_object() and explicitly
    setting self->ias_obj to NULL, just as irda_release() does.

    Reported-by: Tavis Ormandy
    Signed-off-by: David S. Miller

    David S. Miller
     
  • Wireless extensions have an unfortunate, undocumented
    requirement which requires drivers to always fill
    iwp->length when returning a successful status. When
    a driver doesn't do this, it leads to a kernel heap
    content leak when userspace offers a larger buffer
    than would have been necessary.

    Arguably, this is a driver bug, as it should, if it
    returns 0, fill iwp->length, even if it separately
    indicated that the buffer contents was not valid.

    However, we can also at least avoid the memory content
    leak if the driver doesn't do this by setting the iwp
    length to max_tokens, which then reflects how big the
    buffer is that the driver may fill, regardless of how
    big the userspace buffer is.

    To illustrate the point, this patch also fixes a
    corresponding cfg80211 bug (since this requirement
    isn't documented nor was ever pointed out by anyone
    during code review, I don't trust all drivers nor
    all cfg80211 handlers to implement it correctly).

    Cc: stable@kernel.org [all the way back]
    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     
  • The new workqueue changes helped me find this bug
    that's been lingering since the changes to the work
    processing in mac80211 -- the work timer is never
    deleted properly. Do that to avoid having it fire
    after all data structures have been freed. It can't
    be re-armed because all it will do, if running, is
    schedule the work, but that gets flushed later and
    won't have anything to do since all work items are
    gone by now (by way of interface removal).

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

    Johannes Berg
     

29 Aug, 2010

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
    net/ipv4: Eliminate kstrdup memory leak
    net/caif/cfrfml.c: use asm/unaligned.h
    ax25: missplaced sock_put(sk)
    qlge: reset the chip before freeing the buffers
    l2tp: test for ethernet header in l2tp_eth_dev_recv()
    tcp: select(writefds) don't hang up when a peer close connection
    tcp: fix three tcp sysctls tuning
    tcp: Combat per-cpu skew in orphan tests.
    pxa168_eth: silence gcc warnings
    pxa168_eth: update call to phy_mii_ioctl()
    pxa168_eth: fix error handling in prope
    pxa168_eth: remove unneeded null check
    phylib: Fix race between returning phydev and calling adjust_link
    caif-driver: add HAS_DMA dependency
    3c59x: Fix deadlock between boomerang_interrupt and boomerang_start_tx
    qlcnic: fix poll implementation
    netxen: fix poll implementation
    bridge: netfilter: fix a memory leak

    Linus Torvalds
     

28 Aug, 2010

1 commit

  • The string clone is only used as a temporary copy of the argument val
    within the while loop, and so it should be freed before leaving the
    function. The call to strsep, however, modifies clone, so a pointer to the
    front of the string is kept in saved_clone, to make it possible to free it.

    The sematic match that finds this problem is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @r exists@
    local idexpression x;
    expression E;
    identifier l;
    statement S;
    @@

    *x= \(kasprintf\|kstrdup\)(...);
    ...
    if (x == NULL) S
    ... when != kfree(x)
    when != E = x
    if (...) {

    * return ...;
    }
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: David S. Miller

    Julia Lawall
     

27 Aug, 2010

3 commits

  • caif does not build on ia64 starting with 2.6.32-rc1. Using
    asm/unaligned.h instead of linux/unaligned/le_byteshift.h fixes the issue.

    include/linux/unaligned/le_byteshift.h:40:50: error: redefinition of 'get_unaligned_le16'
    include/linux/unaligned/le_byteshift.h:45:50: error: redefinition of 'get_unaligned_le32'
    include/linux/unaligned/le_byteshift.h:50:50: error: redefinition of 'get_unaligned_le64'
    include/linux/unaligned/le_byteshift.h:55:51: error: redefinition of 'put_unaligned_le16'
    include/linux/unaligned/le_byteshift.h:60:51: error: redefinition of 'put_unaligned_le32'
    include/linux/unaligned/le_byteshift.h:65:51: error: redefinition of 'put_unaligned_le64'
    include/linux/unaligned/le_struct.h:31:51: note: previous definition of 'put_unaligned_le64' was here

    Signed-off-by: Andrew Morton
    Signed-off-by: David S. Miller

    Jeff Mahoney
     
  • This patch moves a missplaced sock_put(sk) after
    bh_unlock_sock(sk)
    like in other parts of AX25 driver.

    Signed-off-by: Bernard Pidoux
    Signed-off-by: David S. Miller

    Bernard Pidoux F6BVP
     
  • close https://bugzilla.kernel.org/show_bug.cgi?id=16529

    Before calling dev_forward_skb(), we should make sure skb head contains
    at least an ethernet header, even if length included in upper layer said
    so. Use pskb_may_pull() to make sure this ethernet header is present in
    skb head.

    Reported-by: Thomas Heil
    Reported-by: Ian Campbell
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

26 Aug, 2010

2 commits

  • This issue come from ruby language community. Below test program
    hang up when only run on Linux.

    % uname -mrsv
    Linux 2.6.26-2-486 #1 Sat Dec 26 08:37:39 UTC 2009 i686
    % ruby -rsocket -ve '
    BasicSocket.do_not_reverse_lookup = true
    serv = TCPServer.open("127.0.0.1", 0)
    s1 = TCPSocket.open("127.0.0.1", serv.addr[1])
    s2 = serv.accept
    s2.close
    s1.write("a") rescue p $!
    s1.write("a") rescue p $!
    Thread.new {
    s1.write("a")
    }.join'
    ruby 1.9.3dev (2010-07-06 trunk 28554) [i686-linux]
    #
    [Hang Here]

    FreeBSD, Solaris, Mac doesn't. because Ruby's write() method call
    select() internally. and tcp_poll has a bug.

    SUS defined 'ready for writing' of select() as following.

    | A descriptor shall be considered ready for writing when a call to an output
    | function with O_NONBLOCK clear would not block, whether or not the function
    | would transfer data successfully.

    That said, EPIPE situation is clearly one of 'ready for writing'.

    We don't have read-side issue because tcp_poll() already has read side
    shutdown care.

    | if (sk->sk_shutdown & RCV_SHUTDOWN)
    | mask |= POLLIN | POLLRDNORM | POLLRDHUP;

    So, Let's insert same logic in write side.

    - reference url
    http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/31065
    http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/31068

    Signed-off-by: KOSAKI Motohiro
    Signed-off-by: David S. Miller

    KOSAKI Motohiro
     
  • As discovered by Anton Blanchard, current code to autotune
    tcp_death_row.sysctl_max_tw_buckets, sysctl_tcp_max_orphans and
    sysctl_max_syn_backlog makes little sense.

    The bigger a page is, the less tcp_max_orphans is : 4096 on a 512GB
    machine in Anton's case.

    (tcp_hashinfo.bhash_size * sizeof(struct inet_bind_hashbucket))
    is much bigger if spinlock debugging is on. Its wrong to select bigger
    limits in this case (where kernel structures are also bigger)

    bhash_size max is 65536, and we get this value even for small machines.

    A better ground is to use size of ehash table, this also makes code
    shorter and more obvious.

    Based on a patch from Anton, and another from David.

    Reported-and-tested-by: Anton Blanchard
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

25 Aug, 2010

1 commit

  • As reported by Anton Blanchard when we use
    percpu_counter_read_positive() to make our orphan socket limit checks,
    the check can be off by up to num_cpus_online() * batch (which is 32
    by default) which on a 128 cpu machine can be as large as the default
    orphan limit itself.

    Fix this by doing the full expensive sum check if the optimized check
    triggers.

    Reported-by: Anton Blanchard
    Signed-off-by: David S. Miller
    Acked-by: Eric Dumazet

    David S. Miller
     

24 Aug, 2010

3 commits

  • nf_bridge_alloc() always reset the skb->nf_bridge, so we should always
    put the old one.

    Signed-off-by: Changli Gao
    Signed-off-by: Bart De Schuymer
    Signed-off-by: David S. Miller

    Changli Gao
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (27 commits)
    netfilter: fix CONFIG_COMPAT support
    isdn/avm: fix build when PCMCIA is not enabled
    header: fix broken headers for user space
    e1000e: don't check for alternate MAC addr on parts that don't support it
    e1000e: disable ASPM L1 on 82573
    ll_temac: Fix poll implementation
    netxen: fix a race in netxen_nic_get_stats()
    qlnic: fix a race in qlcnic_get_stats()
    irda: fix a race in irlan_eth_xmit()
    net: sh_eth: remove unused variable
    netxen: update version 4.0.74
    netxen: fix inconsistent lock state
    vlan: Match underlying dev carrier on vlan add
    ibmveth: Fix opps during MTU change on an active device
    ehea: Fix synchronization between HW and SW send queue
    bnx2x: Update bnx2x version to 1.52.53-4
    bnx2x: Fix PHY locking problem
    rds: fix a leak of kernel memory
    netlink: fix compat recvmsg
    netfilter: fix userspace header warning
    ...

    Linus Torvalds
     
  • commit f3c5c1bfd430858d3a05436f82c51e53104feb6b
    (netfilter: xtables: make ip_tables reentrant) forgot to
    also compute the jumpstack size in the compat handlers.

    Result is that "iptables -I INPUT -j userchain" turns into -j DROP.

    Reported by Sebastian Roesner on #netfilter, closes
    http://bugzilla.netfilter.org/show_bug.cgi?id=669.

    Note: arptables change is compile-tested only.

    Signed-off-by: Florian Westphal
    Acked-by: Eric Dumazet
    Tested-by: Mikael Pettersson
    Signed-off-by: David S. Miller

    Florian Westphal
     

19 Aug, 2010

1 commit