05 Mar, 2008

2 commits

  • From: Stephen Hemminger

    Based upon a patch by Marcel Wappler:

    This patch fixes a DHCP issue of the kernel: some DHCP servers
    (i.e. in the Linksys WRT54Gv5) are very strict about the contents
    of the DHCPDISCOVER packet they receive from clients.

    Table 5 in RFC2131 page 36 requests the fields 'ciaddr' and
    'siaddr' MUST be set to '0'. These DHCP servers ignore Linux
    kernel's DHCP discovery packets with these two fields set to
    '255.255.255.255' (in contrast to popular DHCP clients, such as
    'dhclient' or 'udhcpc'). This leads to a not booting system.

    Signed-off-by: David S. Miller

    Stephen Hemminger
     
  • Now the ESP uses the AEAD interface even for algorithms which are
    not combined mode, we need to select CONFIG_CRYPTO_AUTHENC as
    otherwise only combined mode algorithms will work.

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

    Herbert Xu
     

04 Mar, 2008

1 commit

  • It makes fackets_out to grow too slowly compared with the
    real write queue.

    This shouldn't cause those BUG_TRAP(packets packets_out)
    to trigger but how knows how such inconsistent fackets_out
    affects here and there around TCP when everything is nowadays
    assuming accurate fackets_out. So lets see if this silences
    them all.

    Reported by Guillaume Chazarain .

    Signed-off-by: Ilpo Järvinen
    Signed-off-by: David S. Miller

    Ilpo Järvinen
     

29 Feb, 2008

3 commits


27 Feb, 2008

2 commits

  • Four tunnel drivers (ip_gre, ipip, ip6_tunnel and sit) can receive a
    pre-defined name for a device from the userspace. Since these drivers
    call the register_netdevice() (rtnl_lock, is held), which does _not_
    generate the device's name, this name may contain a '%' character.

    Not sure how bad is this to have a device with a '%' in its name, but
    all the other places either use the register_netdev(), which call the
    dev_alloc_name(), or explicitly call the dev_alloc_name() before
    registering, i.e. do not allow for such names.

    This had to be prior to the commit 34cc7b, but I forgot to number the
    patches and this one got lost, sorry.

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

    Pavel Emelyanov
     
  • This bug did bite at least one user, who did have to resort to rebooting
    the system after an "ifconfig eth0 127.0.0.1" typo.

    Deleting the address and adding a new is a less intrusive workaround.
    But I still beleive this is a bug that should be fixed. Some way or
    another.

    Another possibility would be to remove the scope mangling based on
    address. This will always be incomplete (are 127/8 the only address
    space with host scope requirements?)

    We set the scope to RT_SCOPE_HOST if an IPv4 interface is configured
    with a loopback address (127/8). The scope is never reset, and will
    remain set to RT_SCOPE_HOST after changing the address. This patch
    resets the scope if the address is changed again, to restore normal
    functionality.

    Signed-off-by: Bjorn Mork
    Signed-off-by: David S. Miller

    Bjorn Mork
     

24 Feb, 2008

1 commit

  • Use the added dev_alloc_name() call to create tunnel device name,
    rather than iterate in a hand-made loop with an artificial limit.

    Thanks Patrick for noticing this.

    [ The way this works is, when the device is actually registered,
    the generic code noticed the '%' in the name and invokes
    dev_alloc_name() to fully resolve the name. -DaveM ]

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

    Pavel Emelyanov
     

20 Feb, 2008

3 commits

  • http://bugzilla.kernel.org/show_bug.cgi?id=9920
    The function skb_make_writable returns true or false.

    Signed-off-by: Joonwoo Park
    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Joonwoo Park
     
  • As reported by Tomas Simonaitis ,
    inserting new data in skbs queued over {ip,ip6,nfnetlink}_queue
    triggers a SKB_LINEAR_ASSERT in skb_put().

    Going back through the git history, it seems this bug is present since
    at least 2.6.12-rc2, probably even since the removal of
    skb_linearize() for netfilter.

    Linearize non-linear skbs through skb_copy_expand() when enlarging
    them. Tested by Thomas, fixes bugzilla #9933.

    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     
  • Unless I miss a guaranteed relation between between "f" and
    "new_fa->fa_info" this patch is required for fixing a NULL dereference
    introduced by commit a6501e080c318f8d4467679d17807f42b3a33cd5 ("[IPV4]
    FIB_HASH: Reduce memory needs and speedup lookups") and spotted by the
    Coverity checker.

    Eric Dumazet says:

    Hum, you are right, kmem_cache_free() doesnt allow a NULL
    object, like kfree() does.

    Signed-off-by: Adrian Bunk
    Signed-off-by: David S. Miller

    Adrian Bunk
     

18 Feb, 2008

3 commits


14 Feb, 2008

2 commits


13 Feb, 2008

5 commits

  • Al Viro spotted a bogus use of u64 on the input sequence number which
    is big-endian. This patch fixes it by giving the input sequence number
    its own member in the xfrm_skb_cb structure.

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

    Herbert Xu
     
  • Frank Blaschka provided the bug report and the initial suggested fix
    for this bug. He also validated this version of this fix.

    The problem is that the access to neigh->arp_queue is inconsistent, we
    grab references when dropping the lock lock to call
    neigh->ops->solicit() but this does not prevent other threads of
    control from trying to send out that packet at the same time causing
    corruptions because both code paths believe they have exclusive access
    to the skb.

    The best option seems to be to hold the write lock on neigh->lock
    during the ->solicit() call. I looked at all of the ndisc_ops
    implementations and this seems workable. The only case that needs
    special care is the IPV4 ARP implementation of arp_solicit(). It
    wants to take neigh->lock as a reader to protect the header entry in
    neigh->ha during the emission of the soliciation. We can simply
    remove the read lock calls to take care of that since holding the lock
    as a writer at the caller providers a superset of the protection
    afforded by the existing read locking.

    The rest of the ->solicit() implementations don't care whether the
    neigh is locked or not.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Use key/offset caching to change /proc/net/route (use by iputils route)
    from O(n^2) to O(n). This improves performance from 30sec with 160,000
    routes to 1sec.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     
  • This fixes possible problems when trie_firstleaf() returns NULL
    to trie_leafindex().

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     
  • Various RFCs have all sorts of things to say about the CS field of the
    DSCP value. In particular they try to make the distinction between
    values that should be used by "user applications" and things like
    routing daemons.

    This seems to have influenced the CAP_NET_ADMIN check which exists for
    IP_TOS socket option settings, but in fact it has an off-by-one error
    so it wasn't allowing CS5 which is meant for "user applications" as
    well.

    Further adding to the inconsistency and brokenness here, IPV6 does not
    validate the DSCP values specified for the IPV6_TCLASS socket option.

    The real actual uses of these TOS values are system specific in the
    final analysis, and these RFC recommendations are just that, "a
    recommendation". In fact the standards very purposefully use
    "SHOULD" and "SHOULD NOT" when describing how these values can be
    used.

    In the final analysis the only clean way to provide consistency here
    is to remove the CAP_NET_ADMIN check. The alternatives just don't
    work out:

    1) If we add the CAP_NET_ADMIN check to ipv6, this can break existing
    setups.

    2) If we just fix the off-by-one error in the class comparison in
    IPV4, certain DSCP values can be used in IPV6 but not IPV4 by
    default. So people will just ask for a sysctl asking to
    override that.

    I checked several other freely available kernel trees and they
    do not make any privilege checks in this area like we do. For
    the BSD stacks, this goes back all the way to Stevens Volume 2
    and beyond.

    Signed-off-by: David S. Miller

    David S. Miller
     

10 Feb, 2008

1 commit


08 Feb, 2008

2 commits

  • ip_route_me_harder() may call ip_route_input() with skbs that don't
    have skb->dev set for skbs rerouted in LOCAL_OUT and TCP resets
    generated by the REJECT target, resulting in a crash when dereferencing
    skb->dev->nd_net. Since ip_route_input() has an input device argument,
    it seems correct to use that one anyway.

    Bug introduced in b5921910a1 (Routing cache virtualization).

    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     
  • The ->move operation has two bugs:

    - It is called with the same extension as source and destination,
    so it doesn't update the new extension.

    - The address of the old extension is calculated incorrectly,
    instead of (void *)ct->ext + ct->ext->offset[i] it uses
    ct->ext + ct->ext->offset[i].

    Fixes a crash on x86_64 reported by Chuck Ebbert
    and Thomas Woerner .

    Tested-by: Thomas Woerner

    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     

06 Feb, 2008

3 commits

  • No available servers is more an error message than something informational. It
    should also be rate-limited, else we're going to flood our logs on a busy
    director, if all real servers are out of order with a weight of zero.

    Signed-off-by: Sven Wegener
    Acked-by: Simon Horman
    Signed-off-by: David S. Miller

    Sven Wegener
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (21 commits)
    [PKT_SCHED]: vlan tag match
    [NET]: Add if_addrlabel.h to sanitized headers.
    [NET] rtnetlink.c: remove no longer used functions
    [ICMP]: Restore pskb_pull calls in receive function
    [INET]: Fix accidentally broken inet(6)_hash_connect's port offset calculations.
    [NET]: Remove further references to net-modules.txt
    bluetooth rfcomm tty: destroy before tty_close()
    bluetooth: blacklist another Broadcom BCM2035 device
    drivers/bluetooth/btsdio.c: fix double-free
    drivers/bluetooth/bpa10x.c: fix memleak
    bluetooth: uninlining
    bluetooth: hidp_process_hid_control remove unnecessary parameter dealing
    tun: impossible to deassert IFF_ONE_QUEUE or IFF_NO_PI
    hamradio: fix dmascc section mismatch
    [SCTP]: Fix kernel panic while received AUTH chunk with BAD shared key identifier
    [SCTP]: Fix kernel panic while received AUTH chunk while enabled auth
    [IPV4]: Formatting fix for /proc/net/fib_trie.
    [IPV6]: Fix sysctl compilation error.
    [NET_SCHED]: Add #ifdef CONFIG_NET_EMATCH in net/sched/cls_flow.c (latest git broken build)
    [IPV4]: Fix compile error building without CONFIG_FS_PROC
    ...

    Linus Torvalds
     
  • Add a new set of configuration functions to the NetLabel/LSM API so that
    LSMs can perform their own configuration of the NetLabel subsystem without
    relying on assistance from userspace.

    Signed-off-by: Paul Moore
    Signed-off-by: Casey Schaufler
    Reviewed-by: James Morris
    Cc: Chris Wright
    Cc: Stephen Smalley
    Cc: Casey Schaufler
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paul Moore
     

05 Feb, 2008

4 commits


03 Feb, 2008

1 commit

  • This way we can remove TCP and DCCP specific versions of

    sk->sk_prot->get_port: both v4 and v6 use inet_csk_get_port
    sk->sk_prot->hash: inet_hash is directly used, only v6 need
    a specific version to deal with mapped sockets
    sk->sk_prot->unhash: both v4 and v6 use inet_hash directly

    struct inet_connection_sock_af_ops also gets a new member, bind_conflict, so
    that inet_csk_get_port can find the per family routine.

    Now only the lookup routines receive as a parameter a struct inet_hashtable.

    With this we further reuse code, reducing the difference among INET transport
    protocols.

    Eventually work has to be done on UDP and SCTP to make them share this
    infrastructure and get as a bonus inet_diag interfaces so that iproute can be
    used with these protocols.

    net-2.6/net/ipv4/inet_hashtables.c:
    struct proto | +8
    struct inet_connection_sock_af_ops | +8
    2 structs changed
    __inet_hash_nolisten | +18
    __inet_hash | -210
    inet_put_port | +8
    inet_bind_bucket_create | +1
    __inet_hash_connect | -8
    5 functions changed, 27 bytes added, 218 bytes removed, diff: -191

    net-2.6/net/core/sock.c:
    proto_seq_show | +3
    1 function changed, 3 bytes added, diff: +3

    net-2.6/net/ipv4/inet_connection_sock.c:
    inet_csk_get_port | +15
    1 function changed, 15 bytes added, diff: +15

    net-2.6/net/ipv4/tcp.c:
    tcp_set_state | -7
    1 function changed, 7 bytes removed, diff: -7

    net-2.6/net/ipv4/tcp_ipv4.c:
    tcp_v4_get_port | -31
    tcp_v4_hash | -48
    tcp_v4_destroy_sock | -7
    tcp_v4_syn_recv_sock | -2
    tcp_unhash | -179
    5 functions changed, 267 bytes removed, diff: -267

    net-2.6/net/ipv6/inet6_hashtables.c:
    __inet6_hash | +8
    1 function changed, 8 bytes added, diff: +8

    net-2.6/net/ipv4/inet_hashtables.c:
    inet_unhash | +190
    inet_hash | +242
    2 functions changed, 432 bytes added, diff: +432

    vmlinux:
    16 functions changed, 485 bytes added, 492 bytes removed, diff: -7

    /home/acme/git/net-2.6/net/ipv6/tcp_ipv6.c:
    tcp_v6_get_port | -31
    tcp_v6_hash | -7
    tcp_v6_syn_recv_sock | -9
    3 functions changed, 47 bytes removed, diff: -47

    /home/acme/git/net-2.6/net/dccp/proto.c:
    dccp_destroy_sock | -7
    dccp_unhash | -179
    dccp_hash | -49
    dccp_set_state | -7
    dccp_done | +1
    5 functions changed, 1 bytes added, 242 bytes removed, diff: -241

    /home/acme/git/net-2.6/net/dccp/ipv4.c:
    dccp_v4_get_port | -31
    dccp_v4_request_recv_sock | -2
    2 functions changed, 33 bytes removed, diff: -33

    /home/acme/git/net-2.6/net/dccp/ipv6.c:
    dccp_v6_get_port | -31
    dccp_v6_hash | -7
    dccp_v6_request_recv_sock | +5
    3 functions changed, 5 bytes added, 38 bytes removed, diff: -33

    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: David S. Miller

    Arnaldo Carvalho de Melo
     

01 Feb, 2008

7 commits