View difference between Paste ID: cmsKvCnZ and ziJv98hd
SHOW: | | - or go back to the newest paste.
1
41
2-
void addTvlvNode(struct batadv_priv *bat_priv,struct shortTvlv *tvlv){
2+
Type 0 version 1 length 1
3-
	  struct batadv_shortTvlv_node *tvlv_node;
3+
Constructing new one 1
4-
        tvlv_node=kmalloc(sizeof(struct batadv_shortTvlv_node), GFP_KERNEL);
4+
foo
5-
        
5+
foo
6-
        
6+
foo
7-
		if (!tvlv_node)
7+
foo
8-
                return;
8+
foo
9-
                
9+
New Tvlv added: 1
10-
        INIT_HLIST_NODE(&tvlv_node->tlist);
10+
Type 1 version 1 length 1
11-
        spin_lock_bh(&bat_priv->tvlv_list_lock);
11+
Constructing new one 1
12-
         tvlv_node->sTvlv=tvlv;
12+
foo
13-
         /*not sure for the & in bat priv*/
13+
foo
14-
        hlist_add_head_rcu(&tvlv_node->tlist, &bat_priv->tvlv_list);
14+
foo
15-
        spin_unlock_bh(&bat_priv->tvlv_list_lock);
15+
foo
16-
	}
16+
foo
17
New Tvlv added: 2
18
Type 2 version 1 length 1
19
Constructing new one 1
20
foo
21-
void registerTvlv(uint8_t type,uint8_t version,uint8_t length,uint8_t *value,struct batadv_priv *bat_priv,struct batadv_ogm_packet *ogm){
21+
foo
22-
		
22+
foo
23-
	printk("Type %d version %d length %d \n",type,version,length);
23+
foo
24-
	
24+
foo
25-
	struct batadv_shortTvlv_node *shortTvlv_node;
25+
...... Goes on and reaches 3 to 25 iterations and then always crashes with the following
26-
	struct hlist_node *listnode;
26+
(if it reaches 25 the BUG is  unable to handle kernel-cache request)
27-
	int new=0;
27+
28-
	uint8_t *val;
28+
Constructing new one 1
29
BUG: unable to handle kernel paging request at 548b0003
30
IP: [<c106ab15>] kmem_cache_alloc+0x55/0xb0
31-
	rcu_read_lock();
31+
*pde = 00000000
32-
		
32+
Oops: 0000 [#1]
33-
		hlist_for_each_entry_rcu(shortTvlv_node,listnode,&bat_priv->tvlv_list,tlist){
33+
last sysfs file: /sys/devices/virtual/net/bat0/mesh/gw_mode
34-
	
34+
Modules linked in: via_velocity via_rhine tg3 sis900 r8169 pcnet32 ne2k_pci 8390 e1000 e100 8139too 3c59x nf_nat_tftp nf_conntrack_tftp nf_nat_irc nf_conntrack_irc nf_nat_ftp nf_conntrack_ftp ipt_MASQUERADE iptable_nat nf_nat xt_NOTRACK iptable_raw xt_state nf_conntrack_ipv4 nf_defrag_ipv4 nf_conntrack pppoe pppox libphy ipt_REJECT xt_TCPMSS ipt_LOG xt_comment xt_multiport xt_mac xt_limit iptable_mangle iptable_filter ip_tables xt_tcpudp x_tables ppp_async ppp_generic slhc natsemi crc7 crc_ccitt batman_adv crc16
35-
		 
35+
36-
		 if(shortTvlv_node->sTvlv->type!=type )
36+
Pid: 585, comm: bat_events Tainted: G        W  (2.6.32.27 #145) Bochs
37-
		 continue;
37+
EIP: 0060:[<c106ab15>] EFLAGS: 00000006 CPU: 0
38-
		
38+
EIP is at kmem_cache_alloc+0x55/0xb0 
39-
		 goto update;
39+
EAX: 00000000 EBX: 00000202 ECX: c8b4271e EDX: 548b0003
40-
		
40+
ESI: 000000d0 EDI: c12cb33c EBP: 00000008 ESP: c4442efc
41-
		 }
41+
 DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068
42
Process bat_events (pid: 585, ti=c4442000 task=c796ca20 task.ti=c4442000)
43-
new: 
43+
Stack:
44-
printk("Constructing new one %d\n",sizeof(uint8_t));
44+
 00000001 c4d28054 c4d28008 00000000 00000001 c4d28054 c8b4271e c8b4d53b
45-
struct shortTvlv *tvlv;
45+
<0> 00000001 00000001 00000001 c4d28040 c45de2c0 01014f00 c7954f00 00000009
46-
tvlv=kmalloc(sizeof(struct shortTvlv)+sizeof(uint8_t),GFP_KERNEL);
46+
<0> c4d28040 c7954f00 c7954f00 c8b3b915 c4d28054 c45de2c0 c4d28040 c4d28054
47-
		printk("foo\n");
47+
Call Trace:
48-
		if(!tvlv)goto end;
48+
 [<c8b4271e>] ? registerTvlv+0x8e/0x170 [batman_adv]
49-
		printk("foo\n");
49+
 [<c8b3b915>] ? batadv_iv_ogm_schedule+0x125/0x1f0 [batman_adv]
50-
	 tvlv->length=length;
50+
 [<c8b459f9>] ? batadv_schedule_bat_ogm+0x29/0x30 [batman_adv]
51-
	 tvlv->version=version;
51+
 [<c8b45c2e>] ? batadv_send_outstanding_bat_ogm_packet+0x6e/0xa0 [batman_adv]
52-
	 tvlv->type=type;
52+
 [<c8b45bc0>] ? batadv_send_outstanding_bat_ogm_packet+0x0/0xa0 [batman_adv]
53-
	 		printk("foo\n");
53+
 [<c103035a>] ? worker_thread+0xca/0x150
54-
	 ogm->nofAppendedTvlvs++;
54+
 [<c1032d40>] ? autoremove_wake_function+0x0/0x50
55-
	 		printk("foo\n");
55+
 [<c1030290>] ? worker_thread+0x0/0x150
56-
	 memcpy(tvlv+sizeof(struct shortTvlv),value,length*sizeof(uint8_t));
56+
 [<c1032b88>] ? kthread+0x68/0x80
57-
	 		printk("foo\n");
57+
 [<c1032b20>] ? kthread+0x0/0x80
58-
	 addTvlvNode(bat_priv,tvlv);
58+
 [<c1003327>] ? kernel_thread_helper+0x7/0x30
59-
	 		
59+
Code: 00 00 8d 80 80 00 00 00 8b 68 10 85 d2 75 19 89 44 24 04 89 f2 89 f8 89 0c 24 b9 ff ff ff ff e8 b2 fb ff ff 89 c2 eb 0c 8b 40 0c <8b> 04 82 89 87 80 00 00 00 53 9d 89 f0 25 00 80 00 00 66 85 c0
60-
	 printk("New Tvlv added: %d\n",ogm->nofAppendedTvlvs);
60+
EIP: [<c106ab15>] kmem_cache_alloc+0x55/0xb0 SS:ESP 0068:c4442efc
61-
	 goto end;
61+
CR2: 00000000548b0003
62-
update: 
62+
---[ end trace a7919e7f17c0a727 ]---