16 Jul, 2008

1 commit


11 Jul, 2008

1 commit


10 Jul, 2008

1 commit

  • When a conntrack entry is destroyed in process context and destruction
    is interrupted by packet processing and the packet is an attempt to
    reopen a closed connection, TCP conntrack tries to kill the old entry
    itself and returns NF_REPEAT to pass the packet through the hook
    again. This may lead to an endless loop: TCP conntrack repeatedly
    finds the old entry, but can not kill it itself since destruction
    is already in progress, but destruction in process context can not
    complete since TCP conntrack is keeping the CPU busy.

    Drop the packet in TCP conntrack if we can't kill the connection
    ourselves to avoid this.

    Reported by: hemao77@gmail.com [ Kernel bugzilla #11058 ]
    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     

01 Jul, 2008

1 commit

  • Lost connections was reported by Thomas Bätzler (running 2.6.25 kernel) on
    the netfilter mailing list (see the thread "Weird nat/conntrack Problem
    with PASV FTP upload"). He provided tcpdump recordings which helped to
    find a long lingering bug in conntrack.

    In TCP connection tracking, checking the lower bound of valid ACK could
    lead to mark valid packets as INVALID because:

    - We have got a "higher or equal" inequality, but the test checked
    the "higher" condition only; fixed.
    - If the packet contains a SACK option, it could occur that the ACK
    value was before the left edge of our (S)ACK "window": if a previous
    packet from the other party intersected the right edge of the window
    of the receiver, we could move forward the window parameters beyond
    accepting a valid ack. Therefore in this patch we check the rightmost
    SACK edge instead of the ACK value in the lower bound of valid (S)ACK
    test.

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

    Jozsef Kadlecsik
     

23 Jun, 2008

1 commit


18 Jun, 2008

3 commits

  • The H.245 helper is not registered/unregistered, but assigned to
    connections manually from the Q.931 helper. This means on unload
    existing expectations and connections using the helper are not
    cleaned up, leading to the following oops on module unload:

    CPU 0 Unable to handle kernel paging request at virtual address c00a6828, epc == 802224dc, ra == 801d4e7c
    Oops[#1]:
    Cpu 0
    $ 0 : 00000000 00000000 00000004 c00a67f0
    $ 4 : 802a5ad0 81657e00 00000000 00000000
    $ 8 : 00000008 801461c8 00000000 80570050
    $12 : 819b0280 819b04b0 00000006 00000000
    $16 : 802a5a60 80000000 80b46000 80321010
    $20 : 00000000 00000004 802a5ad0 00000001
    $24 : 00000000 802257a8
    $28 : 802a4000 802a59e8 00000004 801d4e7c
    Hi : 0000000b
    Lo : 00506320
    epc : 802224dc ip_conntrack_help+0x38/0x74 Tainted: P
    ra : 801d4e7c nf_iterate+0xbc/0x130
    Status: 1000f403 KERNEL EXL IE
    Cause : 00800008
    BadVA : c00a6828
    PrId : 00019374
    Modules linked in: ip_nat_pptp ip_conntrack_pptp ath_pktlog wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_xauth ath_pci ath_dev ath_dfs ath_rate_atheros wlan ath_hal ip_nat_tftp ip_conntrack_tftp ip_nat_ftp ip_conntrack_ftp pppoe ppp_async ppp_deflate ppp_mppe pppox ppp_generic slhc
    Process swapper (pid: 0, threadinfo=802a4000, task=802a6000)
    Stack : 801e7d98 00000004 802a5a60 80000000 801d4e7c 801d4e7c 802a5ad0 00000004
    00000000 00000000 801e7d98 00000000 00000004 802a5ad0 00000000 00000010
    801e7d98 80b46000 802a5a60 80320000 80000000 801d4f8c 802a5b00 00000002
    80063834 00000000 80b46000 802a5a60 801e7d98 80000000 802ba854 00000000
    81a02180 80b7e260 81a021b0 819b0000 819b0000 80570056 00000000 00000001
    ...
    Call Trace:
    [] ip_finish_output+0x0/0x23c
    [] nf_iterate+0xbc/0x130
    [] nf_iterate+0xbc/0x130
    [] ip_finish_output+0x0/0x23c
    [] ip_finish_output+0x0/0x23c
    [] nf_hook_slow+0x9c/0x1a4

    One way to fix this would be to split helper cleanup from the unregistration
    function and invoke it for the H.245 helper, but since ctnetlink needs to be
    able to find the helper for synchonization purposes, a better fix is to
    register it normally and make sure its not assigned to connections during
    helper lookup. The missing l3num initialization is enough for this, this
    patch changes it to use AF_UNSPEC to make it more explicit though.

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

    Patrick McHardy
     
  • Properly free h323_buffer when helper registration fails.

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

    Patrick McHardy
     
  • Fix three ct_extend/NAT extension related races:

    - When cleaning up the extension area and removing it from the bysource hash,
    the nat->ct pointer must not be set to NULL since it may still be used in
    a RCU read side

    - When replacing a NAT extension area in the bysource hash, the nat->ct
    pointer must be assigned before performing the replacement

    - When reallocating extension storage in ct_extend, the old memory must
    not be freed immediately since it may still be used by a RCU read side

    Possibly fixes https://bugzilla.redhat.com/show_bug.cgi?id=449315
    and/or http://bugzilla.kernel.org/show_bug.cgi?id=10875

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

    Patrick McHardy
     

16 Jun, 2008

1 commit


12 Jun, 2008

2 commits

  • When creation of a new conntrack entry in ctnetlink fails after having
    set up the NAT mappings, the conntrack has an extension area allocated
    that is not getting properly destroyed when freeing the conntrack again.
    This means the NAT extension is still in the bysource hash, causing a
    crash when walking over the hash chain the next time:

    BUG: unable to handle kernel paging request at 00120fbd
    IP: [] nf_nat_setup_info+0x221/0x58a
    *pde = 00000000
    Oops: 0000 [#1] PREEMPT SMP

    Pid: 2795, comm: conntrackd Not tainted (2.6.26-rc5 #1)
    EIP: 0060:[] EFLAGS: 00010206 CPU: 1
    EIP is at nf_nat_setup_info+0x221/0x58a
    EAX: 00120fbd EBX: 00120fbd ECX: 00000001 EDX: 00000000
    ESI: 0000019e EDI: e853bbb4 EBP: e853bbc8 ESP: e853bb78
    DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    Process conntrackd (pid: 2795, ti=e853a000 task=f7de10f0 task.ti=e853a000)
    Stack: 00000000 e853bc2c e85672ec 00000008 c0561084 63c1db4a 00000000 00000000
    00000000 0002e109 61d2b1c3 00000000 00000000 00000000 01114e22 61d2b1c3
    00000000 00000000 f7444674 e853bc04 00000008 c038e728 0000000a f7444674
    Call Trace:
    [] nla_parse+0x5c/0xb0
    [] ctnetlink_change_status+0x190/0x1c6
    [] ctnetlink_new_conntrack+0x189/0x61f
    [] update_curr+0x3d/0x52
    [] nfnetlink_rcv_msg+0xc1/0xd8
    [] nfnetlink_rcv_msg+0x18/0xd8
    [] nfnetlink_rcv_msg+0x0/0xd8
    [] netlink_rcv_skb+0x2d/0x71
    [] nfnetlink_rcv+0x19/0x24
    [] netlink_unicast+0x1b3/0x216
    ...

    Move invocation of the extension destructors to nf_conntrack_free()
    to fix this problem.

    Fixes http://bugzilla.kernel.org/show_bug.cgi?id=10875

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

    Patrick McHardy
     
  • The message "nf_log_packet: can't log since no backend logging module loaded
    in! Please either load one, or disable logging explicitly" was displayed for
    each logged packet when no userspace application is listening to nflog events.
    The message seems to warn for a problem with a kernel module missing but as
    said before this is not the case. I thus propose to suppress the message (I
    don't see any reason to flood the log because a user application has crashed.)

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

    Eric Leblond
     

05 Jun, 2008

1 commit

  • In xt_connlimit match module, the counter of an IP is decreased when
    the TCP packet is go through the chain with ip_conntrack state TW.
    Well, it's very natural that the server and client close the socket
    with FIN packet. But when the client/server close the socket with RST
    packet(using so_linger), the counter for this connection still exsit.
    The following patch can fix it which is based on linux-2.6.25.4

    Signed-off-by: Dong Wei
    Acked-by: Jan Engelhardt
    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Dong Wei
     

29 May, 2008

1 commit


22 May, 2008

1 commit


19 May, 2008

1 commit


15 May, 2008

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (73 commits)
    net: Fix typo in net/core/sock.c.
    ppp: Do not free not yet unregistered net device.
    netfilter: xt_iprange: module aliases for xt_iprange
    netfilter: ctnetlink: dump conntrack ID in event messages
    irda: Fix a misalign access issue. (v2)
    sctp: Fix use of uninitialized pointer
    cipso: Relax too much careful cipso hash function.
    tcp FRTO: work-around inorder receivers
    tcp FRTO: Fix fallback to conventional recovery
    New maintainer for Intel ethernet adapters
    DM9000: Use delayed work to update MII PHY state
    DM9000: Update and fix driver debugging messages
    DM9000: Add __devinit and __devexit attributes to probe and remove
    sky2: fix simple define thinko
    [netdrvr] sfc: sfc: Add self-test support
    [netdrvr] sfc: Increment rx_reset when reported as driver event
    [netdrvr] sfc: Remove unused macro EFX_XAUI_RETRAIN_MAX
    [netdrvr] sfc: Fix code formatting
    [netdrvr] sfc: Remove kernel-doc comments for removed members of struct efx_nic
    [netdrvr] sfc: Remove garbage from comment
    ...

    Linus Torvalds
     

14 May, 2008

2 commits

  • Using iptables 1.3.8 with kernel 2.6.25, rules which include '-m
    iprange' don't automatically pull in xt_iprange module. Below patch
    adds module aliases to fix that. Patch against latest -git, but seems
    like a good candidate for -stable also.

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

    Phil Oester
     
  • Conntrack ID is not put (anymore ?) in event messages. This causes
    current ulogd2 code to fail because it uses the ID to build a hash in
    userspace. This hash is used to be able to output the starting time of
    a connection.

    Conntrack ID can be used in userspace application to maintain an easy
    match between kernel connections list and userspace one. It may worth
    to add it if there is no performance related issue.

    [ Patrick: it was never included in events, but really should be ]

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

    Eric Leblond
     

09 May, 2008

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (32 commits)
    net: Added ASSERT_RTNL() to dev_open() and dev_close().
    can: Fix can_send() handling on dev_queue_xmit() failures
    netns: Fix arbitrary net_device-s corruptions on net_ns stop.
    netfilter: Kconfig: default DCCP/SCTP conntrack support to the protocol config values
    netfilter: nf_conntrack_sip: restrict RTP expect flushing on error to last request
    macvlan: Fix memleak on device removal/crash on module removal
    net/ipv4: correct RFC 1122 section reference in comment
    tcp FRTO: SACK variant is errorneously used with NewReno
    e1000e: don't return half-read eeprom on error
    ucc_geth: Don't use RX clock as TX clock.
    cxgb3: Use CAP_SYS_RAWIO for firmware
    pcnet32: delete non NAPI code from driver.
    fs_enet: Fix a memory leak in fs_enet_mdio_probe
    [netdrvr] eexpress: IPv6 fails - multicast problems
    3c59x: use netstats in net_device structure
    3c980-TX needs EXTRA_PREAMBLE
    fix warning in drivers/net/appletalk/cops.c
    e1000e: Add support for BM PHYs on ICH9
    uli526x: fix endianness issues in the setup frame
    uli526x: initialize the hardware prior to requesting interrupts
    ...

    Linus Torvalds
     

08 May, 2008

2 commits


04 May, 2008

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (47 commits)
    rose: Wrong list_lock argument in rose_node seqops
    netns: Fix reassembly timer to use the right namespace
    netns: Fix device renaming for sysfs
    bnx2: Update version to 1.7.5.
    bnx2: Update RV2P firmware for 5709.
    bnx2: Zero out context memory for 5709.
    bnx2: Fix register test on 5709.
    bnx2: Fix remote PHY initial link state.
    bnx2: Refine remote PHY locking.
    bridge: forwarding table information for >256 devices
    tg3: Update version to 3.92
    tg3: Add link state reporting to UMP firmware
    tg3: Fix ethtool loopback test for 5761 BX devices
    tg3: Fix 5761 NVRAM sizes
    tg3: Use constant 500KHz MI clock on adapters with a CPMU
    hci_usb.h: fix hard-to-trigger race
    dccp: ccid2.c, ccid3.c use clamp(), clamp_t()
    net: remove NR_CPUS arrays in net/core/dev.c
    net: use get/put_unaligned_* helpers
    bluetooth: use get/put_unaligned_* helpers
    ...

    Linus Torvalds
     

02 May, 2008

3 commits


01 May, 2008

1 commit

  • Rename div64_64 to div64_u64 to make it consistent with the other divide
    functions, so it clearly includes the type of the divide. Move its definition
    to math64.h as currently no architecture overrides the generic implementation.
    They can still override it of course, but the duplicated declarations are
    avoided.

    Signed-off-by: Roman Zippel
    Cc: Avi Kivity
    Cc: Russell King
    Cc: Geert Uytterhoeven
    Cc: Ralf Baechle
    Cc: David Howells
    Cc: Jeff Dike
    Cc: Ingo Molnar
    Cc: "David S. Miller"
    Cc: Patrick McHardy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel
     

30 Apr, 2008

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (53 commits)
    tcp: Overflow bug in Vegas
    [IPv4] UFO: prevent generation of chained skb destined to UFO device
    iwlwifi: move the selects to the tristate drivers
    ipv4: annotate a few functions __init in ipconfig.c
    atm: ambassador: vcc_sf semaphore to mutex
    MAINTAINERS: The socketcan-core list is subscribers-only.
    netfilter: nf_conntrack: padding breaks conntrack hash on ARM
    ipv4: Update MTU to all related cache entries in ip_rt_frag_needed()
    sch_sfq: use del_timer_sync() in sfq_destroy()
    net: Add compat support for getsockopt (MCAST_MSFILTER)
    net: Several cleanups for the setsockopt compat support.
    ipvs: fix oops in backup for fwmark conn templates
    bridge: kernel panic when unloading bridge module
    bridge: fix error handling in br_add_if()
    netfilter: {nfnetlink,ip,ip6}_queue: fix skb_over_panic when enlarging packets
    netfilter: x_tables: fix net namespace leak when reading /proc/net/xxx_tables_names
    netfilter: xt_TCPOPTSTRIP: signed tcphoff for ipv6_skip_exthdr() retval
    tcp: Limit cwnd growth when deferring for GSO
    tcp: Allow send-limited cwnd to grow up to max_burst when gso disabled
    [netdrvr] gianfar: Determine TBIPA value dynamically
    ...

    Linus Torvalds
     

29 Apr, 2008

5 commits

  • Some drivers have duplicated unlikely() macros. IS_ERR() already has
    unlikely() in itself.

    This patch cleans up such pointless code.

    Signed-off-by: Hirofumi Nakagawa
    Acked-by: David S. Miller
    Acked-by: Jeff Garzik
    Cc: Paul Clements
    Cc: Richard Purdie
    Cc: Alessandro Zummo
    Cc: David Brownell
    Cc: James Bottomley
    Cc: Michael Halcrow
    Cc: Anton Altaparmakov
    Cc: Al Viro
    Cc: Carsten Otte
    Cc: Patrick McHardy
    Cc: Paul Mundt
    Cc: Jaroslav Kysela
    Cc: Takashi Iwai
    Acked-by: Mike Frysinger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hirofumi Nakagawa
     
  • commit 0794935e "[NETFILTER]: nf_conntrack: optimize hash_conntrack()"
    results in ARM platforms hashing uninitialised padding. This padding
    doesn't exist on other architectures.

    Fix this by replacing NF_CT_TUPLE_U_BLANK() with memset() to ensure
    everything is initialised. There were only 4 bytes that
    NF_CT_TUPLE_U_BLANK() wasn't clearing anyway (or 12 bytes on ARM).

    Signed-off-by: Philip Craig
    Signed-off-by: David S. Miller

    Philip Craig
     
  • While reinjecting *bigger* modified versions of IPv6 packets using
    libnetfilter_queue, things work fine on a 2.6.24 kernel (2.6.22 too)
    but I get the following on recents kernels (2.6.25, trace below is
    against today's net-2.6 git tree):

    skb_over_panic: text:c04fddb0 len:696 put:632 head:f7592c00 data:f7592c00 tail:0xf7592eb8 end:0xf7592e80 dev:eth0
    ------------[ cut here ]------------
    invalid opcode: 0000 [#1] PREEMPT
    Process sendd (pid: 3657, ti=f6014000 task=f77c31d0 task.ti=f6014000)
    Stack: c071e638 c04fddb0 000002b8 00000278 f7592c00 f7592c00 f7592eb8 f7592e80
    f763c000 f6bc5200 f7592c40 f6015c34 c04cdbfc f6bc5200 00000278 f6015c60
    c04fddb0 00000020 f72a10c0 f751b420 00000001 0000000a 000002b8 c065582c
    Call Trace:
    [] ? nfqnl_recv_verdict+0x1c0/0x2e0
    [] ? skb_put+0x3c/0x40
    [] ? nfqnl_recv_verdict+0x1c0/0x2e0
    [] ? nfnetlink_rcv_msg+0xf5/0x160
    [] ? nfnetlink_rcv_msg+0x1e/0x160
    [] ? nfnetlink_rcv_msg+0x0/0x160
    [] ? netlink_rcv_skb+0x77/0xa0
    [] ? nfnetlink_rcv+0x1c/0x30
    [] ? netlink_unicast+0x243/0x2b0
    [] ? memcpy_fromiovec+0x4a/0x70
    [] ? netlink_sendmsg+0x1c6/0x270
    [] ? sock_sendmsg+0xc4/0xf0
    [] ? set_next_entity+0x1d/0x50
    [] ? autoremove_wake_function+0x0/0x40
    [] ? __wake_up_common+0x3e/0x70
    [] ? n_tty_receive_buf+0x34f/0x1280
    [] ? __wake_up+0x68/0x70
    [] ? copy_from_user+0x37/0x70
    [] ? verify_iovec+0x2c/0x90
    [] ? sys_sendmsg+0x10a/0x230
    [] ? __dequeue_entity+0x2a/0xa0
    [] ? set_next_entity+0x1d/0x50
    [] ? pty_write+0x47/0x60
    [] ? tty_default_put_char+0x1b/0x20
    [] ? __wake_up+0x49/0x70
    [] ? tty_ldisc_deref+0x39/0x90
    [] ? tty_write+0x1a0/0x1b0
    [] ? sys_socketcall+0x7f/0x260
    [] ? sysenter_past_esp+0x6a/0x91
    [] ? snd_intel8x0m_probe+0x270/0x6e0
    =======================
    Code: 00 00 89 5c 24 14 8b 98 9c 00 00 00 89 54 24 0c 89 5c 24 10 8b 40 50 89 4c 24 04 c7 04 24 38 e6 71 c0 89 44 24 08 e8 c4 46 c5 ff 0b eb fe 55 89 e5 56 89 d6 53 89 c3 83 ec 0c 8b 40 50 39 d0
    EIP: [] skb_over_panic+0x5c/0x60 SS:ESP 0068:f6015bf8

    Looking at the code, I ended up in nfq_mangle() function (called by
    nfqnl_recv_verdict()) which performs a call to skb_copy_expand() due to
    the increased size of data passed to the function. AFAICT, it should ask
    for 'diff' instead of 'diff - skb_tailroom(e->skb)'. Because the
    resulting sk_buff has not enough space to support the skb_put(skb, diff)
    call a few lines later, this results in the call to skb_over_panic().

    The patch below asks for allocation of a copy with enough space for
    mangled packet and the same amount of headroom as old sk_buff. While
    looking at how the regression appeared (e2b58a67), I noticed the same
    pattern in ipq_mangle_ipv6() and ipq_mangle_ipv4(). The patch corrects
    those locations too.

    Tested with bigger reinjected IPv6 packets (nfqnl_mangle() path), things
    are ok (2.6.25 and today's net-2.6 git tree).

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

    Arnaud Ebalard
     
  • The seq_open_net() call should be accompanied with seq_release_net() one.

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

    Pavel Emelyanov
     
  • if tcphoff remains unsigned, a negative ipv6_skip_exthdr() return value will
    go unnoticed,

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

    Roel Kluin
     

20 Apr, 2008

1 commit


14 Apr, 2008

7 commits