22 Jul, 2008

11 commits

  • Introduced by a258860e (netfilter: ctnetlink: add full support for SCTP to ctnetlink):

    net/netfilter/nf_conntrack_proto_sctp.c:483:2: warning: cast from restricted type
    net/netfilter/nf_conntrack_proto_sctp.c:483:2: warning: incorrect type in argument 1 (different base types)
    net/netfilter/nf_conntrack_proto_sctp.c:483:2: expected unsigned int [unsigned] [usertype] x
    net/netfilter/nf_conntrack_proto_sctp.c:483:2: got restricted unsigned int const
    net/netfilter/nf_conntrack_proto_sctp.c:483:2: warning: cast from restricted type
    net/netfilter/nf_conntrack_proto_sctp.c:483:2: warning: cast from restricted type
    net/netfilter/nf_conntrack_proto_sctp.c:483:2: warning: cast from restricted type
    net/netfilter/nf_conntrack_proto_sctp.c:483:2: warning: cast from restricted type
    net/netfilter/nf_conntrack_proto_sctp.c:487:2: warning: cast from restricted type
    net/netfilter/nf_conntrack_proto_sctp.c:487:2: warning: incorrect type in argument 1 (different base types)
    net/netfilter/nf_conntrack_proto_sctp.c:487:2: expected unsigned int [unsigned] [usertype] x
    net/netfilter/nf_conntrack_proto_sctp.c:487:2: got restricted unsigned int const
    net/netfilter/nf_conntrack_proto_sctp.c:487:2: warning: cast from restricted type
    net/netfilter/nf_conntrack_proto_sctp.c:487:2: warning: cast from restricted type
    net/netfilter/nf_conntrack_proto_sctp.c:487:2: warning: cast from restricted type
    net/netfilter/nf_conntrack_proto_sctp.c:487:2: warning: cast from restricted type
    net/netfilter/nf_conntrack_proto_sctp.c:532:42: warning: incorrect type in assignment (different base types)
    net/netfilter/nf_conntrack_proto_sctp.c:532:42: expected restricted unsigned int
    net/netfilter/nf_conntrack_proto_sctp.c:532:42: got unsigned int
    net/netfilter/nf_conntrack_proto_sctp.c:534:39: warning: incorrect type in assignment (different base types)
    net/netfilter/nf_conntrack_proto_sctp.c:534:39: expected restricted unsigned int
    net/netfilter/nf_conntrack_proto_sctp.c:534:39: got unsigned int

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

    Patrick McHardy
     
  • According to RFC2327, the connection information is optional
    in the session description since it can be specified in the
    media description instead.

    My provider does exactly that and does not provide any connection
    information in the session description. As a result the new
    kernel drops all invite responses.

    This patch makes it optional as documented.

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

    Herbert Xu
     
  • Signed-off-by: Jan Engelhardt
    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Jan Engelhardt
     
  • This patch adds some fields to NFLOG to be able to send the complete
    hardware header with all necessary informations.
    It sends to userspace:
    * the type of hardware link
    * the lenght of hardware header
    * the hardware header

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

    Eric Leblond
     
  • Fix netfilter xt_time's time_mt()'s use of do_div() on an s64 by using
    div_s64() instead.

    This was introduced by patch ee4411a1b1e0b679c99686629b5eab5a072ce49f
    ("[NETFILTER]: x_tables: add xt_time match").

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

    David Howells
     
  • Initially netfilter has had 64bit counters for conntrack-based accounting, but
    it was changed in 2.6.14 to save memory. Unfortunately in-kernel 64bit counters are
    still required, for example for "connbytes" extension. However, 64bit counters
    waste a lot of memory and it was not possible to enable/disable it runtime.

    This patch:
    - reimplements accounting with respect to the extension infrastructure,
    - makes one global version of seq_print_acct() instead of two seq_print_counters(),
    - makes it possible to enable it at boot time (for CONFIG_SYSCTL/CONFIG_SYSFS=n),
    - makes it possible to enable/disable it at runtime by sysctl or sysfs,
    - extends counters from 32bit to 64bit,
    - renames ip_conntrack_counter -> nf_conn_counter,
    - enables accounting code unconditionally (no longer depends on CONFIG_NF_CT_ACCT),
    - set initial accounting enable state based on CONFIG_NF_CT_ACCT
    - removes buggy IPCT_COUNTER_FILLING event handling.

    If accounting is enabled newly created connections get additional acct extend.
    Old connections are not changed as it is not possible to add a ct_extend area
    to confirmed conntrack. Accounting is performed for all connections with
    acct extend regardless of a current state of "net.netfilter.nf_conntrack_acct".

    Signed-off-by: Krzysztof Piotr Oledzki
    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Krzysztof Piotr Oledzki
     
  • Signed-off-by: Changli Gao
    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Changli Gao
     
  • This reverts commit a0c80b80e0fb48129e4e9d6a9ede914f9ff1850d.

    After discussions with Jamal and Herbert on netdev, we should
    provide at least minimal prioritization at the qdisc level
    even in multiqueue situations.

    Signed-off-by: David S. Miller

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

    Linus Torvalds
     
  • Based upon feedback from Eric Dumazet and Andi Kleen.

    Cure several deficiencies in simple_tx_hash() by using
    jhash + reciprocol multiply.

    1) Eliminates expensive modulus operation.

    2) Makes hash less attackable by using random seed.

    3) Eliminates endianness hash distribution issues.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Removed unused variable 'skb' in the dev_deactivate_queue function

    Signed-off-by: Daniel Lezcano
    Signed-off-by: David S. Miller

    Daniel Lezcano
     

21 Jul, 2008

7 commits

  • * 'for-2.6.27' of git://linux-nfs.org/~bfields/linux: (51 commits)
    nfsd: nfs4xdr.c do-while is not a compound statement
    nfsd: Use C99 initializers in fs/nfsd/nfs4xdr.c
    lockd: Pass "struct sockaddr *" to new failover-by-IP function
    lockd: get host reference in nlmsvc_create_block() instead of callers
    lockd: minor svclock.c style fixes
    lockd: eliminate duplicate nlmsvc_lookup_host call from nlmsvc_lock
    lockd: eliminate duplicate nlmsvc_lookup_host call from nlmsvc_testlock
    lockd: nlm_release_host() checks for NULL, caller needn't
    file lock: reorder struct file_lock to save space on 64 bit builds
    nfsd: take file and mnt write in nfs4_upgrade_open
    nfsd: document open share bit tracking
    nfsd: tabulate nfs4 xdr encoding functions
    nfsd: dprint operation names
    svcrdma: Change WR context get/put to use the kmem cache
    svcrdma: Create a kmem cache for the WR contexts
    svcrdma: Add flush_scheduled_work to module exit function
    svcrdma: Limit ORD based on client's advertised IRD
    svcrdma: Remove unused wait q from svcrdma_xprt structure
    svcrdma: Remove unneeded spin locks from __svc_rdma_free
    svcrdma: Add dma map count and WARN_ON
    ...

    Linus Torvalds
     
  • Reported by Linus.

    Signed-off-by: David S. Miller
    Signed-off-by: Linus Torvalds

    David Miller
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
    pkt_sched: Fix build with NET_SCHED disabled.

    Linus Torvalds
     
  • The stab bits can't be referenced uniless the full
    packet scheduler layer is enabled.

    Reported by Stephen Rothwell.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (1232 commits)
    iucv: Fix bad merging.
    net_sched: Add size table for qdiscs
    net_sched: Add accessor function for packet length for qdiscs
    net_sched: Add qdisc_enqueue wrapper
    highmem: Export totalhigh_pages.
    ipv6 mcast: Omit redundant address family checks in ip6_mc_source().
    net: Use standard structures for generic socket address structures.
    ipv6 netns: Make several "global" sysctl variables namespace aware.
    netns: Use net_eq() to compare net-namespaces for optimization.
    ipv6: remove unused macros from net/ipv6.h
    ipv6: remove unused parameter from ip6_ra_control
    tcp: fix kernel panic with listening_get_next
    tcp: Remove redundant checks when setting eff_sacks
    tcp: options clean up
    tcp: Fix MD5 signatures for non-linear skbs
    sctp: Update sctp global memory limit allocations.
    sctp: remove unnecessary byteshifting, calculate directly in big-endian
    sctp: Allow only 1 listening socket with SO_REUSEADDR
    sctp: Do not leak memory on multiple listen() calls
    sctp: Support ipv6only AF_INET6 sockets.
    ...

    Linus Torvalds
     
  • Move the line disciplines towards a conventional ->ops arrangement. For
    the moment the actual 'tty_ldisc' struct in the tty is kept as part of
    the tty struct but this can then be changed if it turns out that when it
    all settles down we want to refcount ldiscs separately to the tty.

    Pull the ldisc code out of /proc and put it with our ldisc code.

    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • Noticed by Stephen Rothwell.

    Signed-off-by: David S. Miller

    David S. Miller
     

20 Jul, 2008

7 commits


19 Jul, 2008

15 commits

  • David S. Miller
     
  • Signed-off-by: Denis V. Lunev
    Signed-off-by: David S. Miller

    Denis V. Lunev
     
  • # BUG: unable to handle kernel NULL pointer dereference at
    0000000000000038
    IP: [] listening_get_next+0x50/0x1b3
    PGD 11e4b9067 PUD 11d16c067 PMD 0
    Oops: 0000 [1] SMP
    last sysfs file: /sys/devices/system/cpu/cpu3/cache/index2/shared_cpu_map
    CPU 3
    Modules linked in: bridge ipv6 button battery ac loop dm_mod tg3 ext3
    jbd edd fan thermal processor thermal_sys hwmon sg sata_svw libata dock
    serverworks sd_mod scsi_mod ide_disk ide_core [last unloaded: freq_table]
    Pid: 3368, comm: slpd Not tainted 2.6.26-rc2-mm1-lxc4 #1
    RIP: 0010:[] []
    listening_get_next+0x50/0x1b3
    RSP: 0018:ffff81011e1fbe18 EFLAGS: 00010246
    RAX: 0000000000000000 RBX: ffff8100be0ad3c0 RCX: ffff8100619f50c0
    RDX: ffffffff82475be0 RSI: ffff81011d9ae6c0 RDI: ffff8100be0ad508
    RBP: ffff81011f4f1240 R08: 00000000ffffffff R09: ffff8101185b6780
    R10: 000000000000002d R11: ffffffff820fdbfa R12: ffff8100be0ad3c8
    R13: ffff8100be0ad6a0 R14: ffff8100be0ad3c0 R15: ffffffff825b8ce0
    FS: 00007f6a0ebd16d0(0000) GS:ffff81011f424540(0000)
    knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    CR2: 0000000000000038 CR3: 000000011dc20000 CR4: 00000000000006e0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    Process slpd (pid: 3368, threadinfo ffff81011e1fa000, task
    ffff81011f4b8660)
    Stack: 00000000000002ee ffff81011f5a57c0 ffff81011f4f1240
    ffff81011e1fbe90
    0000000000001000 0000000000000000 00007fff16bf2590 ffffffff821ed9c8
    ffff81011f5a57c0 ffff81011d9ae6c0 000000000000041a ffffffff820b0abd
    Call Trace:
    [] ? tcp_seq_next+0x34/0x7e
    [] ? seq_read+0x1aa/0x29d
    [] ? proc_reg_read+0x73/0x8e
    [] ? vfs_read+0xaa/0x152
    [] ? sys_read+0x45/0x6e
    [] ? system_call_after_swapgs+0x7b/0x80

    Code: 31 a9 25 00 e9 b5 00 00 00 ff 45 20 83 7d 0c 01 75 79 4c 8b 75 10
    48 8b 0e eb 1d 48 8b 51 20 0f b7 45 08 39 02 75 0e 48 8b 41 28 39
    78 38 0f 84 93 00 00 00 48 8b 09 48 85 c9 75 de 8b 55 1c
    RIP [] listening_get_next+0x50/0x1b3
    RSP
    CR2: 0000000000000038

    This kernel panic appears with CONFIG_NET_NS=y.

    How to reproduce ?

    On the buggy host (host A)
    * ip addr add 1.2.3.4/24 dev eth0

    On a remote host (host B)
    * ip addr add 1.2.3.5/24 dev eth0
    * iptables -A INPUT -p tcp -s 1.2.3.4 -j DROP
    * ssh 1.2.3.4

    On host A:
    * netstat -ta or cat /proc/net/tcp

    This bug happens when reading /proc/net/tcp[6] when there is a req_sock
    at the SYN_RECV state.

    When a SYN is received the minisock is created and the sk field is set to
    NULL. In the listening_get_next function, we try to look at the field
    req->sk->sk_net.

    When looking at how to fix this bug, I noticed that is useless to do
    the check for the minisock belonging to the namespace. A minisock belongs
    to a listen point and this one is per namespace, so when browsing the
    minisock they are always per namespace.

    Signed-off-by: Daniel Lezcano
    Signed-off-by: David S. Miller

    Daniel Lezcano
     
  • Remove redundant checks when setting eff_sacks and make the number of SACKs a
    compile time constant. Now that the options code knows how many SACK blocks can
    fit in the header, we don't need to have the SACK code guessing at it.

    Signed-off-by: Adam Langley
    Signed-off-by: David S. Miller

    Adam Langley
     
  • This should fix the following bugs:
    * Connections with MD5 signatures produce invalid packets whenever SACK
    options are included
    * MD5 signatures are counted twice in the MSS calculations

    Behaviour changes:
    * A SYN with MD5 + SACK + TS elicits a SYNACK with MD5 + SACK

    This is because we can't fit any SACK blocks in a packet with MD5 + TS
    options. There was discussion about disabling SACK rather than TS in
    order to fit in better with old, buggy kernels, but that was deemed to
    be unnecessary.

    * SYNs with MD5 don't include a TS option

    See above.

    Additionally, it removes a bunch of duplicated logic for calculating options,
    which should help avoid these sort of issues in the future.

    Signed-off-by: Adam Langley
    Signed-off-by: David S. Miller

    Adam Langley
     
  • Currently, the MD5 code assumes that the SKBs are linear and, in the case
    that they aren't, happily goes off and hashes off the end of the SKB and
    into random memory.

    Reported by Stephen Hemminger in [1]. Advice thanks to Stephen and Evgeniy
    Polyakov. Also includes a couple of missed route_caps from Stephen's patch
    in [2].

    [1] http://marc.info/?l=linux-netdev&m=121445989106145&w=2
    [2] http://marc.info/?l=linux-netdev&m=121459157816964&w=2

    Signed-off-by: Adam Langley
    Acked-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Adam Langley
     
  • Update sctp global memory limit allocations to be the same as TCP.

    Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Vlad Yasevich
     
  • Signed-off-by: Harvey Harrison
    Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Harvey Harrison
     
  • When multiple socket bind to the same port with SO_REUSEADDR,
    only 1 can be listining.

    Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Vlad Yasevich
     
  • SCTP permits multiple listen call and on subsequent calls
    we leak he memory allocated for the crypto transforms.

    Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Vlad Yasevich
     
  • Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Vlad Yasevich
     
  • valgrind reports uninizialized memory accesses when running
    sctp inside the network simulation cradle simulator:

    Conditional jump or move depends on uninitialised value(s)
    at 0x570E34A: sctp_assoc_sync_pmtu (associola.c:1324)
    by 0x57427DA: sctp_packet_transmit (output.c:403)
    by 0x5710EFF: sctp_outq_flush (outqueue.c:824)
    by 0x5710B88: sctp_outq_uncork (outqueue.c:701)
    by 0x5745262: sctp_cmd_interpreter (sm_sideeffect.c:1548)
    by 0x57444B7: sctp_side_effects (sm_sideeffect.c:976)
    by 0x5744460: sctp_do_sm (sm_sideeffect.c:945)
    by 0x572157D: sctp_primitive_ASSOCIATE (primitive.c:94)
    by 0x5725C04: __sctp_connect (socket.c:1094)
    by 0x57297DC: sctp_connect (socket.c:3297)

    Conditional jump or move depends on uninitialised value(s)
    at 0x575D3A5: mod_timer (timer.c:630)
    by 0x5752B78: sctp_cmd_hb_timers_start (sm_sideeffect.c:555)
    by 0x5754133: sctp_cmd_interpreter (sm_sideeffect.c:1448)
    by 0x5753607: sctp_side_effects (sm_sideeffect.c:976)
    by 0x57535B0: sctp_do_sm (sm_sideeffect.c:945)
    by 0x571E9AE: sctp_endpoint_bh_rcv (endpointola.c:474)
    by 0x573347F: sctp_inq_push (inqueue.c:104)
    by 0x572EF93: sctp_rcv (input.c:256)
    by 0x5689623: ip_local_deliver_finish (ip_input.c:230)
    by 0x5689759: ip_local_deliver (ip_input.c:268)
    by 0x5689CAC: ip_rcv_finish (dst.h:246)

    #1 is due to "if (t->pmtu_pending)".
    8a4794914f9cf2681235ec2311e189fe307c28c7 "[SCTP] Flag a pmtu change request"
    suggests it should be initialized to 0.

    #2 is the heartbeat timer 'expires' value, which is uninizialised, but
    test by mod_timer().
    T3_rtx_timer seems to be affected by the same problem, so initialize it, too.

    Signed-off-by: Florian Westphal
    Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Florian Westphal
     
  • This puts CONFIG_PROC_FS defines around the proc init/exit functions
    and also avoids compiling proc.c if procfs is not supported.
    Also make SCTP_DBG_OBJCNT depend on procfs.

    Signed-off-by: Florian Westphal
    Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Florian Westphal
     
  • Some of the metrics (RTT, RTTVAR and RTAX_RTO_MIN) are stored in
    kernel units (jiffies) and this leaks out through the netlink API to
    user space where the units for jiffies are unknown.

    This patches changes the kernel to convert to/from milliseconds. This
    changes the ABI, but milliseconds seemed like the most natural unit
    for these parameters. Values available via syscall in
    /proc/net/rt_cache and netlink will be in milliseconds.

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

    Stephen Hemminger
     
  • Like noop_qdisc, it needs a dummy backpointer and
    explicit qdisc->q.lock initialization.

    Based upon a report by Stephen Hemminger.

    Signed-off-by: David S. Miller

    David S. Miller