Linux.ChinaUnix.net
ChinaUnix | Linux首页 | 新闻 | 博客 | 文章 | 专栏 | 新手 | 方案 | 图书 | 下载 | 人才 | 手册 | wiki | 搜索     
Linux论坛
  会员: 密码: 免费注册 | 忘记密码 | 会员登录 | 搜索 | 帮助 


Kernel Bug-Vulnerability-Comment library
首页 » CU论坛 » Linux » 汇总贴列表 » 内核源码 »  
[打印] [订阅] [收藏] [推荐给朋友] [本帖文本页]
版主 platinum (何时才能飞)
广告杀手-老法王
人生的转折



UID:26424
注册:2002-11-2
最后登录: 2008-09-08
帖子:20230
精华:22

可用积分:24078 (巨富豪门)
信誉积分:105
专家积分:454 (本版:100)
空间积分:0
推广积分:0

状态:...保密...

[资料] [站内短信] [Blog]


顶部
81楼 发表于 2008-1-15 11:54 


localhost test # insmod show_buflow.ko
段错误
localhost test # lsmod
Module                  Size  Used by
show_buflow             5248  1
pcnet32                31236  0
localhost test # rmmod show_buflow
ERROR: Module show_buflow is in use
localhost test #



Jan 15 11:42:15 localhost show_buflow: module license 'unspecified' taints kernel.
Jan 15 11:42:15 localhost aaa
Jan 15 11:42:15 localhost aaa
Jan 15 11:42:15 localhost and what?
Jan 15 11:42:15 localhost BUG: unable to handle kernel paging request at virtual address 74616877
Jan 15 11:42:15 localhost printing eip:
Jan 15 11:42:15 localhost c01e6737
Jan 15 11:42:15 localhost *pde = 00000000
Jan 15 11:42:15 localhost Oops: 0000 [#1]
Jan 15 11:42:15 localhost PREEMPT SMP
Jan 15 11:42:15 localhost Modules linked in: show_buflow(P) pcnet32
Jan 15 11:42:15 localhost CPU:    0
Jan 15 11:42:15 localhost EIP:    0060:[<c01e6737>]    Tainted: P       VLI
Jan 15 11:42:15 localhost EFLAGS: 00010097   (2.6.21-gentoo-r4 #56)
Jan 15 11:42:15 localhost EIP is at vsnprintf+0x2af/0x48c
Jan 15 11:42:15 localhost eax: 74616877   ebx: ffffffff   ecx: 74616877   edx: fffffffe
Jan 15 11:42:15 localhost esi: c04d26c0   edi: c4b63eb0   ebp: ffffffff   esp: c4b63dc4
Jan 15 11:42:15 localhost ds: 007b   es: 007b   fs: 00d8  gs: 0033  ss: 0068
Jan 15 11:42:15 localhost Process insmod (pid: 6658, ti=c4b62000 task=cfeb1580 task.ti=c4b62000)
Jan 15 11:42:15 localhost Stack: 00000000 cfeb7070 cfeb7070 1b41a784 00000109 0000f6d7 00000400 c04d26c0
Jan 15 11:42:15 localhost 0051e0c0 c4b63e0c c04d2ac0 ffffffff 00000000 d0855051 00000400 cf402c00
Jan 15 11:42:15 localhost cf402d98 d0855280 c01e69fd c4b63eb0 00000003 c011e412 c4b63eb0 cf51e0c0
Jan 15 11:42:15 localhost Call Trace:
Jan 15 11:42:15 localhost [<c01e69fd>] vscnprintf+0x14/0x1f
Jan 15 11:42:15 localhost [<c011e412>] vprintk+0xbd/0x2fc
Jan 15 11:42:15 localhost [<c01195f0>] try_to_wake_up+0x393/0x39d
Jan 15 11:42:15 localhost [<c033b0a8>] preempt_schedule+0x46/0x58
Jan 15 11:42:15 localhost [<c01195f0>] try_to_wake_up+0x393/0x39d
Jan 15 11:42:15 localhost [<c033b05a>] wait_for_completion+0x93/0x9b
Jan 15 11:42:15 localhost [<c033c911>] _spin_unlock_irq+0xe/0x22
Jan 15 11:42:15 localhost [<c011e66c>] printk+0x1b/0x1f
Jan 15 11:42:15 localhost [<d0855038>] init_module+0x38/0x40 [show_buflow]
Jan 15 11:42:15 localhost [<c01395e5>] sys_init_module+0x15ac/0x16e3
Jan 15 11:42:15 localhost [<c033c767>] _spin_lock+0xd/0x5a
Jan 15 11:42:15 localhost [<c011e651>] printk+0x0/0x1f
Jan 15 11:42:15 localhost [<c0159fa7>] __fput+0x112/0x13c
Jan 15 11:42:15 localhost [<c016ac25>] mntput_no_expire+0x11/0x5c
Jan 15 11:42:15 localhost [<c0104e20>] sysenter_past_esp+0x5d/0x81
Jan 15 11:42:15 localhost =======================
Jan 15 11:42:15 localhost Code: 74 24 28 73 03 c6 06 20 46 4d 85 ed 7f f1 e9 b9 00 00 00 8b 0f 81 f9 ff 0f 00 00 b8 2e 51 3d c0 0f 46 c8 8b 54 24 2c 89 c8 eb 06 <80> 38 00 74 07 40 4a 83 fa ff 75 f4 29 c8 89 c3 89 e8 f6 44 24
Jan 15 11:42:15 localhost EIP: [<c01e6737>] vsnprintf+0x2af/0x48c SS:ESP 0068:c4b63dc4
Jan 15 11:42:15 localhost note: insmod[6658] exited with preempt_count 2
Jan 15 11:42:15 localhost BUG: scheduling while atomic: insmod/0x10000002/6658
Jan 15 11:42:15 localhost [<c033a806>] __sched_text_start+0x56/0x7c3
Jan 15 11:42:15 localhost [<c02e70f0>] net_rx_action+0x13c/0x181
Jan 15 11:42:15 localhost [<c0119a38>] __cond_resched+0x12/0x2c
Jan 15 11:42:15 localhost [<c033b575>] cond_resched+0x26/0x31
Jan 15 11:42:15 localhost [<c0148961>] unmap_vmas+0x415/0x514
Jan 15 11:42:15 localhost [<c014b307>] exit_mmap+0x7c/0x108
Jan 15 11:42:15 localhost [<c011bcd0>] mmput+0x1d/0x78
Jan 15 11:42:15 localhost [<c0120623>] do_exit+0x1ae/0x6ad
Jan 15 11:42:15 localhost [<c010638b>] die+0x208/0x22d
Jan 15 11:42:15 localhost [<c033e362>] do_page_fault+0x442/0x510
Jan 15 11:42:15 localhost [<c033df20>] do_page_fault+0x0/0x510
Jan 15 11:42:15 localhost [<c033cacc>] error_code+0x7c/0x84
Jan 15 11:42:15 localhost [<c01e6737>] vsnprintf+0x2af/0x48c
Jan 15 11:42:15 localhost [<c01e69fd>] vscnprintf+0x14/0x1f
Jan 15 11:42:15 localhost [<c011e412>] vprintk+0xbd/0x2fc
Jan 15 11:42:15 localhost [<c01195f0>] try_to_wake_up+0x393/0x39d
Jan 15 11:42:15 localhost [<c033b0a8>] preempt_schedule+0x46/0x58
Jan 15 11:42:15 localhost [<c01195f0>] try_to_wake_up+0x393/0x39d
Jan 15 11:42:15 localhost [<c033b05a>] wait_for_completion+0x93/0x9b
Jan 15 11:42:15 localhost [<c033c911>] _spin_unlock_irq+0xe/0x22
Jan 15 11:42:15 localhost [<c011e66c>] printk+0x1b/0x1f
Jan 15 11:42:15 localhost [<d0855038>] init_module+0x38/0x40 [show_buflow]
Jan 15 11:42:15 localhost [<c01395e5>] sys_init_module+0x15ac/0x16e3
Jan 15 11:42:15 localhost [<c033c767>] _spin_lock+0xd/0x5a
Jan 15 11:42:15 localhost [<c011e651>] printk+0x0/0x1f
Jan 15 11:42:15 localhost [<c0159fa7>] __fput+0x112/0x13c
Jan 15 11:42:15 localhost [<c016ac25>] mntput_no_expire+0x11/0x5c
Jan 15 11:42:15 localhost [<c0104e20>] sysenter_past_esp+0x5d/0x81
Jan 15 11:42:15 localhost =======================

这样是会溢出的啊
问题是 TCP_CONNTRACK_MAX 和 TCP_CONNTRACK_IGNORE 会不会被取到呢?我不是太了解

[ 本帖最后由 platinum 于 2008-1-15 12:03 编辑 ]



您对本贴的看法:鲜花[0] 臭蛋[0]

__________________________________

当我们在为生活而疲惫奔波的时候
生活却渐渐离我们远去
find our way, find our style
空间积分可以换礼品了! | 有奖讨论:TPC-E对服务器采购的价值 | 致电800-858-2903,了解DELL如何为你量身订制笔记本 | 送2G U盘
版主 platinum (何时才能飞)
广告杀手-老法王
人生的转折



UID:26424
注册:2002-11-2
最后登录: 2008-09-08
帖子:20230
精华:22

可用积分:24078 (巨富豪门)
信誉积分:105
专家积分:454 (本版:100)
空间积分:0
推广积分:0

状态:...保密...

[资料] [站内短信] [Blog]


顶部
82楼 发表于 2008-1-15 15:52 
知道了,那两种状态根本就不会进入 conntrack->proto.tcp.state,所以不会出现溢出状况



您对本贴的看法:鲜花[0] 臭蛋[0]

__________________________________

当我们在为生活而疲惫奔波的时候
生活却渐渐离我们远去
find our way, find our style
空间积分可以换礼品了! | 有奖讨论:TPC-E对服务器采购的价值 | 致电800-858-2903,了解DELL如何为你量身订制笔记本 | 送2G U盘
sisi8408 (linux八哥)
风云使者




UID:509266
注册:2006-12-22
最后登录: 2008-07-28
帖子:617
精华:0

可用积分:567 (稍有积蓄)
信誉积分:100
专家积分:0 (本版:0)
空间积分:0
推广积分:0

状态:...离线...

[资料] [站内短信] [Blog]


顶部
83楼 发表于 2008-1-15 20:06 
大脚王,赞一个

tcp_conntrack_names[] overflow 与
tcp_options overflow 不一样,

tcp_options overflow in stack, but
tcp_conntrack_names[] overflow in heap,

module 没法卸载

[ 本帖最后由 sisi8408 于 2008-1-15 20:14 编辑 ]



您对本贴的看法:鲜花[0] 臭蛋[0]

__________________________________

东直门外大街
张字85号
丁字96号

空间积分可以换礼品了! | 有奖讨论:TPC-E对服务器采购的价值 | 致电800-858-2903,了解DELL如何为你量身订制笔记本 | 送2G U盘
版主 platinum (何时才能飞)
广告杀手-老法王
人生的转折



UID:26424
注册:2002-11-2
最后登录: 2008-09-08
帖子:20230
精华:22

可用积分:24078 (巨富豪门)
信誉积分:105
专家积分:454 (本版:100)
空间积分:0
推广积分:0

状态:...保密...

[资料] [站内短信] [Blog]


顶部
84楼 发表于 2008-1-15 22:39 
前两天还在研究 heap 和 stack 之间的关系,今天 sisi8408 大哥这么一说,我更明白了,谢谢你 ^_^



您对本贴的看法:鲜花[0] 臭蛋[0]

__________________________________

当我们在为生活而疲惫奔波的时候
生活却渐渐离我们远去
find our way, find our style
空间积分可以换礼品了! | 有奖讨论:TPC-E对服务器采购的价值 | 致电800-858-2903,了解DELL如何为你量身订制笔记本 | 送2G U盘
sisi8408 (linux八哥)
风云使者




UID:509266
注册:2006-12-22
最后登录: 2008-07-28
帖子:617
精华:0

可用积分:567 (稍有积蓄)
信誉积分:100
专家积分:0 (本版:0)
空间积分:0
推广积分:0

状态:...离线...

[资料] [站内短信] [Blog]


顶部
85楼 发表于 2008-1-18 21:18 


static void add_file(struct super_block *sb, char *name,
        int (*func) (struct seq_file *, struct super_block *))
{
        struct proc_dir_entry *de;

        de = create_proc_entry(name, 0, REISERFS_SB(sb)->procdir);
        if (de) {
                /*
                 * linux-2.6.23.12/fs/reiserfs
                 * 2008-1-18 21:09
                 * nice play show what is free indeed
                 */
                de->data = func;
                de->proc_fops = &r_file_operations;
        }
}




您对本贴的看法:鲜花[0] 臭蛋[0]

__________________________________

东直门外大街
张字85号
丁字96号

空间积分可以换礼品了! | 有奖讨论:TPC-E对服务器采购的价值 | 致电800-858-2903,了解DELL如何为你量身订制笔记本 | 送2G U盘
sisi8408 (linux八哥)
风云使者




UID:509266
注册:2006-12-22
最后登录: 2008-07-28
帖子:617
精华:0

可用积分:567 (稍有积蓄)
信誉积分:100
专家积分:0 (本版:0)
空间积分:0
推广积分:0

状态:...离线...

[资料] [站内短信] [Blog]


顶部
86楼 发表于 2008-1-18 22:31 


                // make sure, that the node contents look like a node of
                // certain level
                if (!is_tree_node(p_s_bh, expected_level)) {
                        reiserfs_warning(p_s_sb, "vs-5150: search_by_key: "
                                         "invalid format found in block %ld. Fsck?",
                                         p_s_bh->b_blocknr);
                        pathrelse(p_s_search_path);
                        /* linux-2.6.23.12
                         * it is not HW err
                         */
                        return IO_ERROR;
                }




您对本贴的看法:鲜花[0] 臭蛋[0]

__________________________________

东直门外大街
张字85号
丁字96号

空间积分可以换礼品了! | 有奖讨论:TPC-E对服务器采购的价值 | 致电800-858-2903,了解DELL如何为你量身订制笔记本 | 送2G U盘
sisi8408 (linux八哥)
风云使者




UID:509266
注册:2006-12-22
最后登录: 2008-07-28
帖子:617
精华:0

可用积分:567 (稍有积蓄)
信誉积分:100
专家积分:0 (本版:0)
空间积分:0
推广积分:0

状态:...离线...

[资料] [站内短信] [Blog]


顶部
87楼 发表于 2008-1-19 10:30 


struct in_core_key
{
        __u32 k_dir_id;
        __u32 k_objectid;
        __u64 k_offset;
        __u8  k_type;        /* shit and big tail eagle?! */
}; /* shouldbe? __attribute__ ((__packed__)); */
/*linux-2.6.23.12*/
struct cpu_key
{
        struct in_core_key on_disk_key;
        int version;
        int key_length;                /* 3 in all cases but direct2indirect and
                                   indirect2direct conversion */
};




您对本贴的看法:鲜花[0] 臭蛋[0]

__________________________________

东直门外大街
张字85号
丁字96号

空间积分可以换礼品了! | 有奖讨论:TPC-E对服务器采购的价值 | 致电800-858-2903,了解DELL如何为你量身订制笔记本 | 送2G U盘
sisi8408 (linux八哥)
风云使者




UID:509266
注册:2006-12-22
最后登录: 2008-07-28
帖子:617
精华:0

可用积分:567 (稍有积蓄)
信誉积分:100
专家积分:0 (本版:0)
空间积分:0
推广积分:0

状态:...离线...

[资料] [站内短信] [Blog]


顶部
88楼 发表于 2008-1-30 22:02 
potential NULL pointer bug in reiserfs-3.6

static int balance_leaf(struct tree_balance *tb,
                        struct item_head *ih,        /* item header of inserted item (this is on little endian) */
                        const char *body,        /* body  of inserted item or bytes to paste */
                        int flag,        /* i - insert, d - delete, c - cut, p - paste
                                           (see comment to do_balance) */
                        struct item_head *insert_key,        /* in our processing of one level we sometimes determine what
                                                           must be inserted into the next higher level.  This insertion
                                                           consists of a key or two keys and their corresponding
                                                           pointers */
                        struct buffer_head **insert_ptr        /* inserted node-ptrs for the next level */
    )
{
        struct buffer_head *tbS0 = PATH_PLAST_BUFFER(tb->tb_path);
        int item_pos = PATH_LAST_POSITION(tb->tb_path);        /*  index into the array of item headers in S[0]
                                                           of the affected item */
        struct buffer_info bi;
        struct buffer_head *S_new[2];        /* new nodes allocated to hold what could not fit into S */
        int snum[2];                /* number of items that will be placed
                                   into S_new (includes partially shifted
                                   items) */
        int sbytes[2];                /* if an item is partially shifted into S_new then
                                   if it is a directory item
                                   it is the number of entries from the item that are shifted into S_new
                                   else
                                   it is the number of bytes from the item that are shifted into S_new
                                 */
        int n, i;
        int ret_val;
        int pos_in_item;
        int zeros_num;

        PROC_INFO_INC(tb->tb_sb, balance_at[0]);

        /* Make balance in case insert_size[0] < 0 */
        if (tb->insert_size[0] < 0)
                return balance_leaf_when_delete(tb, flag);

        zeros_num = 0;
        if (flag == M_INSERT && body == 0)
                /*
                 * 2008-1-30 21:46
                 * linux-2.6.23.12
                 * @@@@@@@@@@@@@@@@@@@@@@@@@@@@
                 * potential ih NULL pointer  @
                 * @@@@@@@@@@@@@@@@@@@@@@@@@@@@
                 */
                zeros_num = ih_item_len(ih);

        pos_in_item = tb->tb_path->pos_in_item;
        /* for indirect item pos_in_item is measured in unformatted node
           pointers. Recalculate to bytes */
        if (flag != M_INSERT
            && is_indirect_le_ih(B_N_PITEM_HEAD(tbS0, item_pos)))
                pos_in_item *= UNFM_P_SIZE;
[...]
}

int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th,
                             struct treepath *p_s_search_path,        /* Path to the pasted item */
                             const struct cpu_key *p_s_key,        /* Key to search for the needed item */
                             struct inode *inode,        /* Inode that item belongs to */
                             const char *p_c_body,        /* Pointer to the bytes to paste */
                             int n_pasted_size) /* Size of pasted bytes */
{
[...]
        /* Perform balancing after all resources are collected by fix_nodes, and
         * accessing them will not risk triggering schedule.
         */
        if (retval == CARRY_ON) {
                /*
                 * source-01
                 */
                do_balance(&s_paste_balance, NULL, /*ih*/ p_c_body, M_PASTE);
                return 0;
        }
        retval = (retval == NO_DISK_SPACE) ? -ENOSPC : -EIO;
[...]
}

void do_balance(struct tree_balance *tb,        /* tree_balance structure */
                struct item_head *ih,        /* item header of inserted item */
                const char *body,        /* body  of inserted item or bytes to paste */
                int flag)
                                /* i - insert, d - delete
                                   c - cut, p - paste

                                   Cut means delete part of an item
                                   (includes removing an entry from a directory).

                                   Delete means delete whole item.

                                   Insert means add a new item into the tree.

                                   Paste means to append to the end of an
                                         existing file or to insert a directory entry.
                                */
{
[...]
        do_balance_starts(tb);
        /* balance leaf returns 0 except
         * if combining L R and S into one node.
         *
         * see balance_internal() for explanation of this line of code.
         */
        child_pos = PATH_H_B_ITEM_ORDER(tb->tb_path, 0) +
                /*
                 * source-02
                 */
                balance_leaf(tb, ih, body, flag, insert_key, insert_ptr);
[...]
}




您对本贴的看法:鲜花[0] 臭蛋[0]

__________________________________

东直门外大街
张字85号
丁字96号

空间积分可以换礼品了! | 有奖讨论:TPC-E对服务器采购的价值 | 致电800-858-2903,了解DELL如何为你量身订制笔记本 | 送2G U盘
daemeon   帅哥
精灵




UID:304570
注册:2005-8-20
最后登录: 2008-09-07
帖子:156
精华:0

可用积分:146 (白手起家)
信誉积分:100
专家积分:0 (本版:0)
空间积分:0
推广积分:0

状态:...离线...

[资料] [站内短信] [Blog]


顶部
89楼 发表于 2008-2-3 00:40 
回复 #88 sisi8408 的帖子

It's not a bug since the marked codes are executed only when flag == M_INSERT.



您对本贴的看法:鲜花[0] 臭蛋[0]
空间积分可以换礼品了! | 有奖讨论:TPC-E对服务器采购的价值 | 致电800-858-2903,了解DELL如何为你量身订制笔记本 | 送2G U盘
zx_wing   帅哥 (骑着猪的青蛙)
大天使
学徒



UID:499746
注册:2006-12-4
最后登录: 2008-09-08
帖子:1944
精华:3

可用积分:1632 (家境小康)
信誉积分:100
专家积分:11 (本版:1)
空间积分:0
推广积分:0

来自:成都
状态:...保密...

[资料] [站内短信] [Blog]


顶部
90楼 发表于 2008-2-3 17:03 
很有意思的帖子,以前还从没看过。
至今为止我只在e100的驱动中发现过一个中断处理的bug。老大让把patch发出去,结果俺到现在还没发。
很想看一下这个帖子,可惜大部分代码都不熟悉,光看片段代码很难知道是不是BUG,必须结合相关子系统上下文一起看。
像大家学习了,关注中



您对本贴的看法:鲜花[0] 臭蛋[0]

__________________________________


C调 ---- C语言
都是最喜欢的
空间积分可以换礼品了! | 有奖讨论:TPC-E对服务器采购的价值 | 致电800-858-2903,了解DELL如何为你量身订制笔记本 | 送2G U盘

首页 » CU论坛 » Linux » 汇总贴列表 » 内核源码 »

 


Copyright © 2001-2008 ChinaUnix.net All Rights Reserved     联系我们:

感谢所有关心和支持过ChinaUnix的朋友们    转载本站内容请注明原作者名及出处

京ICP证041476号


清除 Cookies - Linux时代 - Archiver - WAP - TOP

Processed in 0.925213 second(s), 5 queries , Gzip enabled