From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261824AbVHAQGp (ORCPT ); Mon, 1 Aug 2005 12:06:45 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262226AbVHAQGp (ORCPT ); Mon, 1 Aug 2005 12:06:45 -0400 Received: from wproxy.gmail.com ([64.233.184.192]:47279 "EHLO wproxy.gmail.com") by vger.kernel.org with ESMTP id S261824AbVHAQFD (ORCPT ); Mon, 1 Aug 2005 12:05:03 -0400 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:date:from:to:cc:subject:message-id:mail-followup-to:references:mime-version:content-type:content-disposition:in-reply-to:x-message-flag:x-operating-system:x-editor:x-disclaimer:user-agent; b=lXIiIDcKteh4s5KNgU6iCR2bn54nkuvlrxUY9VGv1pfx3ymIEQXgFYXKq/Irb0i38hzLIchHqBYxKmW1Zm0V78AZ/FPkzOZNdG7ztoz8hnx1iZNDEx4tKbmShQXaCKGYjFKyFOQv7Vi+JZppH6ADduZRlccD0vx/N3QbRym2T2M= Date: Mon, 1 Aug 2005 18:05:38 +0200 From: Mattia Dongili To: Patrick McHardy Cc: Linux Kernel Mailing List , Netfilter Development Mailinglist , "David S. Miller" Subject: Re: BUG: atomic counter underflow at ip_conntrack_event_cache_init+0x91/0xb0 (with patch) Message-ID: <20050801160537.GA3850@inferi.kami.home> Mail-Followup-To: Patrick McHardy , Linux Kernel Mailing List , Netfilter Development Mailinglist , "David S. Miller" References: <20050801141327.GA3909@inferi.kami.home> <42EE3169.6070604@trash.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42EE3169.6070604@trash.net> X-Message-Flag: Cranky? Try Free Software instead! X-Operating-System: Linux 2.6.13-rc4-mm1-3 i686 X-Editor: Vim http://www.vim.org/ X-Disclaimer: Buh! User-Agent: Mutt/1.5.9i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 01, 2005 at 04:27:53PM +0200, Patrick McHardy wrote: > Mattia Dongili wrote: > > Hello, > > > > got this one while trying out 2.6.13-rc4-mm1 (not there in -r2-mm1), > > from a quick look it seems to me that ip_conntrack_{get,put} are not > > simmetric in updating the use count, thus simply adding this line might > > help (it does actually, but I'm not aware if there could be any drawback): > > > > --- include/linux/netfilter_ipv4/ip_conntrack.h.clean 2005-08-01 15:09:49.000000000 +0200 > > +++ include/linux/netfilter_ipv4/ip_conntrack.h 2005-08-01 15:08:52.000000000 +0200 > > @@ -298,6 +298,7 @@ static inline struct ip_conntrack * > > ip_conntrack_get(const struct sk_buff *skb, enum ip_conntrack_info *ctinfo) > > { > > *ctinfo = skb->nfctinfo; > > + nf_conntrack_get(skb->nfct); > > return (struct ip_conntrack *)skb->nfct; > > } > > This creates lots of refcnt leaks, which is probably why it makes the > underflow go away :) Please try this patch instead. this doesn't fix it actually, see dmesg below: ... ip_tables: (C) 2000-2002 Netfilter core team Netfilter messages via NETLINK v0.30. ip_conntrack version 2.3 (2044 buckets, 16352 max) - 252 bytes per conntrack e100: eth0: e100_watchdog: link up, 10Mbps, half-duplex BUG: atomic counter underflow at: [] ip_ct_iterate_cleanup+0xfa/0x100 [ip_conntrack] [] masq_inet_event+0x33/0x40 [ipt_MASQUERADE] [] device_cmp+0x0/0x40 [ipt_MASQUERADE] [] notifier_call_chain+0x2d/0x50 [] inet_del_ifa+0x93/0x1d0 [] devinet_ioctl+0x4af/0x5a0 [] inet_ioctl+0x66/0xb0 [] sock_ioctl+0xc9/0x230 [] do_ioctl+0x8e/0xa0 [] do_page_fault+0x188/0x613 [] vfs_ioctl+0x65/0x1f0 [] sys_ioctl+0x45/0x70 [] syscall_call+0x7/0xb Installing knfsd (copyright (C) 1996 okir@monad.swb.de). BUG: atomic counter underflow at: [] ip_conntrack_event_cache_init+0x91/0xb0 [ip_conntrack] [] ip_conntrack_in+0xd7/0x2f0 [ip_conntrack] [] dst_output+0x0/0x30 [] nf_iterate+0x78/0x90 [] dst_output+0x0/0x30 [] dst_output+0x0/0x30 [] nf_hook_slow+0x7e/0x150 [] dst_output+0x0/0x30 [] ip_queue_xmit+0x403/0x570 [] dst_output+0x0/0x30 [] submit_bio+0x62/0x100 [] mpage_bio_submit+0x23/0x40 [] do_mpage_readpage+0x1fc/0x3b0 [] tcp_v4_send_check+0x55/0x100 [] tcp_transmit_skb+0x478/0x720 [] tcp_connect+0x2c1/0x370 [] tcp_v4_connect+0x45e/0xb70 [] cache_alloc_refill+0x178/0x230 [] inet_stream_connect+0x8b/0x1b0 [] sys_connect+0x83/0xb0 [] sock_map_fd+0xf9/0x130 [] __sock_create+0xd9/0x260 [] copy_from_user+0x46/0x80 [] sys_socketcall+0xb1/0x260 [] sys_close+0x61/0xa0 [] do_page_fault+0x0/0x613 [] syscall_call+0x7/0xb BUG: atomic counter underflow at: [] ip_conntrack_event_cache_init+0x91/0xb0 [ip_conntrack] [] ip_conntrack_in+0xd7/0x2f0 [ip_conntrack] [] dst_output+0x0/0x30 [] nf_iterate+0x78/0x90 [] dst_output+0x0/0x30 [] dst_output+0x0/0x30 [] nf_hook_slow+0x7e/0x150 [] dst_output+0x0/0x30 [] dst_output+0x0/0x30 [] ip_push_pending_frames+0x423/0x490 [] dst_output+0x0/0x30 [] udp_push_pending_frames+0x16c/0x2b0 [] udp_sendmsg+0x3b2/0x730 [] arp_bind_neighbour+0x67/0xa0 [] rt_intern_hash+0x2e9/0x3d0 [] ip_route_output_slow+0x2a9/0x870 [] inet_sendmsg+0x4d/0x60 [] sock_sendmsg+0xdd/0x100 [] autoremove_wake_function+0x0/0x60 [] sys_sendto+0xdc/0x100 [] sys_connect+0x8f/0xb0 [] handle_mm_fault+0xfc/0x250 [] sys_send+0x33/0x40 [] sys_socketcall+0x143/0x260 [] do_page_fault+0x0/0x613 [] syscall_call+0x7/0xb BUG: atomic counter underflow at: [] ip_conntrack_event_cache_init+0x91/0xb0 [ip_conntrack] [] ip_conntrack_in+0xd7/0x2f0 [ip_conntrack] [] ip_rcv_finish+0x0/0x300 [] nf_iterate+0x78/0x90 [] ip_rcv_finish+0x0/0x300 [] ip_rcv_finish+0x0/0x300 [] nf_hook_slow+0x7e/0x150 [] ip_rcv_finish+0x0/0x300 [] ip_rcv_finish+0x0/0x300 [] ip_rcv+0x4a2/0x590 [] ip_rcv_finish+0x0/0x300 [] acpi_ut_value_exit+0x35/0x3f [] netif_receive_skb+0x167/0x220 [] e100_poll+0x750/0x800 [e100] [] net_rx_action+0x74/0x120 [] __do_softirq+0x7b/0x90 [] do_softirq+0x26/0x30 [] irq_exit+0x35/0x40 [] do_IRQ+0x1e/0x30 [] common_interrupt+0x1a/0x20 [] acpi_processor_idle+0x122/0x295 [] cpu_idle+0x50/0x60 [] start_kernel+0x15a/0x180 [] unknown_bootoption+0x0/0x1e0 While testing my patch I had the below error, is it related to the refcount leak or might it be a different issue? ctevent: skb->ct != ecache->ct !!! [] tcp_packet+0x278/0x5d0 [ip_conntrack] [] __ip_conntrack_find+0x17/0xb0 [ip_conntrack] [] ip_conntrack_find_get+0x52/0x60 [ip_conntrack] [] ip_conntrack_in+0xef/0x2f0 [ip_conntrack] [] dst_output+0x0/0x30 [] nf_iterate+0x78/0x90 [] dst_output+0x0/0x30 [] dst_output+0x0/0x30 [] nf_hook_slow+0x7e/0x150 [] dst_output+0x0/0x30 [] ip_queue_xmit+0x403/0x570 [] dst_output+0x0/0x30 [] extract_buf+0xda/0x120 [] tcp_v4_send_check+0x55/0x100 [] tcp_transmit_skb+0x478/0x720 [] tcp_write_xmit+0x150/0x3f0 [] __tcp_push_pending_frames+0x39/0xd0 [] tcp_sendmsg+0x346/0xb70 [] inet_sendmsg+0x4d/0x60 [] sock_aio_write+0xf6/0x120 [] do_sync_write+0xd1/0x120 [] page_add_file_rmap+0x59/0x70 [] handle_mm_fault+0xfc/0x250 [] autoremove_wake_function+0x0/0x60 [] vfs_write+0x16d/0x180 [] sys_write+0x51/0x80 [] syscall_call+0x7/0xb ctevent: skb->ct != ecache->ct !!! [] ip_ct_refresh_acct+0x146/0x150 [ip_conntrack] [] tcp_packet+0x1ea/0x5d0 [ip_conntrack] [] __ip_conntrack_find+0x17/0xb0 [ip_conntrack] [] ip_conntrack_find_get+0x52/0x60 [ip_conntrack] [] ip_conntrack_in+0xef/0x2f0 [ip_conntrack] [] dst_output+0x0/0x30 [] nf_iterate+0x78/0x90 [] dst_output+0x0/0x30 [] dst_output+0x0/0x30 [] nf_hook_slow+0x7e/0x150 [] dst_output+0x0/0x30 [] ip_queue_xmit+0x403/0x570 [] dst_output+0x0/0x30 [] extract_buf+0xda/0x120 [] tcp_v4_send_check+0x55/0x100 [] tcp_transmit_skb+0x478/0x720 [] tcp_write_xmit+0x150/0x3f0 [] __tcp_push_pending_frames+0x39/0xd0 [] tcp_sendmsg+0x346/0xb70 [] inet_sendmsg+0x4d/0x60 [] sock_aio_write+0xf6/0x120 [] do_sync_write+0xd1/0x120 [] page_add_file_rmap+0x59/0x70 [] handle_mm_fault+0xfc/0x250 [] autoremove_wake_function+0x0/0x60 [] vfs_write+0x16d/0x180 [] sys_write+0x51/0x80 [] syscall_call+0x7/0xb -- mattia :wq!