That's a bug in ip_fw_ctl(). It's calling convert_ipfw()
inside FWC_WRITE_LOCK_IRQ(&ip_fw_lock, flags);
But convert_ipfw() does kmalloc(GFP_KERNEL).
Steven Cole wrote:
>
> Hi Andrew,
>
> Are these traced warnings of any use to you?
>
> If so, here is one. This one was from
>
> "Sleeping function called from illegal context at slab.c:1378"
>
> on bootup of 2.5.38-mm2:
>
> Trace; c0119986 <__might_sleep+56/5d>
> Trace; c0135166 <kmalloc+66/1f0>
> Trace; c0271e03 <convert_ipfw+63/130>
> Trace; c02721c0 <ip_fw_ctl+2f0/4d0>
> Trace; c026a023 <sock_fn+63/80>
> Trace; c012ff2e <find_get_page+2e/60>
> Trace; c0130db5 <filemap_nopage+115/310>
> Trace; c012d8ef <do_no_page+2ef/390>
> Trace; c012b5ba <pte_alloc_map+ea/150>
> Trace; c023471a <nf_sockopt+fa/150>
> Trace; c0234790 <nf_setsockopt+20/30>
> Trace; c0242fda <ip_setsockopt+74a/910>
> Trace; c02255de <sock_map_fd+be/120>
> Trace; c022562a <sock_map_fd+10a/120>
> Trace; c0263995 <inet_setsockopt+25/30>
> Trace; c02269d6 <sys_setsockopt+56/70>
> Trace; c0227026 <sys_socketcall+1a6/200>
> Trace; c0114ea0 <do_page_fault+0/436>
> Trace; c01099b1 <error_code+2d/38>
> Trace; c0108f6f <syscall_call+7/b>
>
> Steven
On Mon, 2002-09-23 at 12:30, Andrew Morton wrote:
> That's a bug in ip_fw_ctl(). It's calling convert_ipfw()
> inside FWC_WRITE_LOCK_IRQ(&ip_fw_lock, flags);
>
> But convert_ipfw() does kmalloc(GFP_KERNEL).
>
>
> Steven Cole wrote:
> >
> > Hi Andrew,
> >
> > Are these traced warnings of any use to you?
I guess that traced warning was of interest, so here are two
more from 2.5.38-mm2.
( I got a total of four warnings; the first was identical to that posted
by Grega Fajdiga here:
http://marc.theaimsgroup.com/?l=linux-kernel&m=103278825525479&w=2
and the fourth slabc:1378 warning was the one referred to above.)
Here is the second slabc:1378 warning traced with ksymoops:
Trace; c0119986 <__might_sleep+56/5d>
Trace; c0135166 <kmalloc+66/1f0>
Trace; c0120048 <__request_region+18/c0>
Trace; c0215ca2 <eata2x_detect+142/d60>
Trace; c02037a4 <ahc_linux_alloc_device+14/70>
Trace; c020298c <ahc_linux_queue+16c/1a0>
Trace; c0117c71 <schedule+351/3e0>
Trace; c01f1c6a <scsi_request_fn+13a/450>
Trace; c0117fe2 <wait_for_completion+b2/110>
Trace; c01f149d <scsi_queue_next_request+5d/140>
Trace; c01ea9da <scsi_release_command+13a/150>
Trace; c013432d <kmem_slab_destroy+dd/110>
Trace; c0134f07 <free_block+b7/120>
Trace; c013533a <kmem_cache_free+4a/80>
Trace; c01c7b43 <elevator_exit+13/20>
Trace; c01f3c06 <scan_scsis+96/a0>
Trace; c01ec218 <scsi_register_host+48/340>
Trace; c01b0133 <put_bus+13/57>
Trace; c01050b1 <init+51/1d0>
Trace; c0105060 <init+0/1d0>
Trace; c01070b9 <kernel_thread_helper+5/c>
Here is the third slabc:1378 warning traced with ksymoops:
Trace; c0119986 <__might_sleep+56/5d>
Trace; c0135166 <kmalloc+66/1f0>
Trace; c0271e03 <convert_ipfw+63/130>
Trace; c027216a <ip_fw_ctl+29a/4d0>
Trace; c017ab91 <ext3_reserve_inode_write+31/b0>
Trace; c026a023 <sock_fn+63/80>
Trace; c012ff2e <find_get_page+2e/60>
Trace; c0130db5 <filemap_nopage+115/310>
Trace; c012d8ef <do_no_page+2ef/390>
Trace; c012b5ba <pte_alloc_map+ea/150>
Trace; c023471a <nf_sockopt+fa/150>
Trace; c0234790 <nf_setsockopt+20/30>
Trace; c0242fda <ip_setsockopt+74a/910>
Trace; c02255de <sock_map_fd+be/120>
Trace; c022562a <sock_map_fd+10a/120>
Trace; c0263995 <inet_setsockopt+25/30>
Trace; c02269d6 <sys_setsockopt+56/70>
Trace; c0227026 <sys_socketcall+1a6/200>
Trace; c0114ea0 <do_page_fault+0/436>
Trace; c01099b1 <error_code+2d/38>
Trace; c0108f6f <syscall_call+7/b>
Steven
On Mon, 23 Sep 2002, Andrew Morton wrote:
> That's a bug in ip_fw_ctl(). It's calling convert_ipfw()
> inside FWC_WRITE_LOCK_IRQ(&ip_fw_lock, flags);
>
> But convert_ipfw() does kmalloc(GFP_KERNEL).
>
Below a patch to correct this. The bug is also present in 2.2 and 2.4
(patches to follow on netfilter-devel).
- James
--
James Morris
<[email protected]>
diff -urN -X dontdiff linux-2.5.38.orig/net/ipv4/netfilter/ipchains_core.c linux-2.5.38.w1/net/ipv4/netfilter/ipchains_core.c
--- linux-2.5.38.orig/net/ipv4/netfilter/ipchains_core.c Tue Sep 10 09:43:30 2002
+++ linux-2.5.38.w1/net/ipv4/netfilter/ipchains_core.c Tue Sep 24 23:09:50 2002
@@ -1252,7 +1252,7 @@
return NULL;
}
- fwkern = kmalloc(SIZEOF_STRUCT_IP_FW_KERNEL, GFP_KERNEL);
+ fwkern = kmalloc(SIZEOF_STRUCT_IP_FW_KERNEL, GFP_ATOMIC);
if (!fwkern) {
duprintf("convert_ipfw: kmalloc failed!\n");
*errno = ENOMEM;