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


Kernel Bug-Vulnerability-Comment library
首页 » CU论坛 » Linux » 汇总贴列表 » 内核源码 »  
[打印] [订阅] [收藏] [推荐给朋友] [本帖文本页]
sisi8408 (linux八哥)
风云使者




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

可用积分:545 (稍有积蓄)
信誉积分:100
专家积分:0 (本版)

状态:...离线...

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


顶部
1楼 发表于 2007-8-18 13:49 
这里搜集/整理/讨论 linux 八哥/漏洞,和解决方案

贴八哥/漏洞,一次性获得¥1,最多¥9。



贴解决方案,一次性获得¥1,最多¥9。



鲜花和致敬送给大侠,还有八哥的一丝心意

daemeon: ¥4+1
思一克: ¥6
platinum: ¥2+2

1,sisi8408承诺和负责支付,或由白金老大转交,呵呵。

2,如果无力支付,另由sisi8408公开声明。

[ 本帖最后由 sisi8408 于 2008-5-9 23:13 编辑 ]



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

__________________________________

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

Web安全应用现状有奖调查+Web安全应急处理沙龙+100积分 | 致电800-858-2903,了解DELL如何为你量身订制笔记本
sisi8408 (linux八哥)
风云使者




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

可用积分:545 (稍有积蓄)
信誉积分:100
专家积分:0 (本版)

状态:...离线...

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


顶部
2楼 发表于 2007-8-18 13:52 


linux-2.6.17.x/drivers/net/ppp_generic.c

static void cardmap_set(struct cardmap **pmap, unsigned int nr, void *ptr)
{
        struct cardmap *p;
        int i;

        p = *pmap;
        if (p == NULL || (nr >> p->shift) >= CARDMAP_WIDTH) {
                do {
                        /* need a new top level */
                        struct cardmap *np = kmalloc(sizeof(*np), GFP_KERNEL);
                        /*
                         * ¥6
                         * if (np == NULL)
                         *        what_to_do???
                         */
                        memset(np, 0, sizeof(*np));
                        np->ptr[0] = p;
                        if (p != NULL) {
                                np->shift = p->shift + CARDMAP_ORDER;
                                p->parent = np;
                        } else
                                np->shift = 0;
                        p = np;
                        /*
                         * ¥3
                         * if (p->shift == 0)
                         *      ask_linuz_stop_while_loop???
                         */
                } while ((nr >> p->shift) >= CARDMAP_WIDTH);
                *pmap = p;
        }
        while (p->shift > 0) {
                i = (nr >> p->shift) & CARDMAP_MASK;
                if (p->ptr[i] == NULL) {
                        struct cardmap *np = kmalloc(sizeof(*np), GFP_KERNEL);
                        memset(np, 0, sizeof(*np));
                        np->shift = p->shift - CARDMAP_ORDER;
                        np->parent = p;
                        p->ptr[i] = np;
                }
                if (ptr == NULL)
                        clear_bit(i, &p->inuse);
                p = p->ptr[i];
        }
        i = nr & CARDMAP_MASK;
        p->ptr[i] = ptr;
        if (ptr != NULL)
                set_bit(i, &p->inuse);
        else
                clear_bit(i, &p->inuse);
}

[ 本帖最后由 sisi8408 于 2007-8-18 14:20 编辑 ]



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

__________________________________

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

Web安全应用现状有奖调查+Web安全应急处理沙龙+100积分 | 致电800-858-2903,了解DELL如何为你量身订制笔记本
sisi8408 (linux八哥)
风云使者




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

可用积分:545 (稍有积蓄)
信誉积分:100
专家积分:0 (本版)

状态:...离线...

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


顶部
3楼 发表于 2007-8-18 13:56 


linux-2.6.22.1/kernel/time/timer_list.c

static void print_active_timers(struct seq_file *m,
        struct hrtimer_clock_base *base, u64 now)
{
        struct hrtimer *timer, tmp;
        unsigned long next = 0, i;
        struct rb_node *curr;
        unsigned long flags;

next_one:
        i = 0;
        spin_lock_irqsave(&base->cpu_base->lock, flags);

        curr = base->first;
        /*
         * Crude but we have to do this O(N*N) thing, because
         * we have to unlock the base when printing:
         */
        while (curr && i < next) {
                curr = rb_next(curr);
                i++;
        }

        if (curr) {
                timer = rb_entry(curr, struct hrtimer, node);
                tmp = *timer;
                spin_unlock_irqrestore(&base->cpu_base->lock, flags);
                /*
                 * yeah Ingo Molnar, ifuleu,
                 * but print shows not timer but tmp,
                 * how can i see %p timer??
                 */
                print_timer(m, &tmp, i, now);
                next++;
                goto next_one;
        }
        spin_unlock_irqrestore(&base->cpu_base->lock, flags);
}

[ 本帖最后由 sisi8408 于 2007-8-18 13:58 编辑 ]



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

__________________________________

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

Web安全应用现状有奖调查+Web安全应急处理沙龙+100积分 | 致电800-858-2903,了解DELL如何为你量身订制笔记本
sisi8408 (linux八哥)
风云使者




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

可用积分:545 (稍有积蓄)
信誉积分:100
专家积分:0 (本版)

状态:...离线...

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


顶部
4楼 发表于 2007-8-18 14:04 


/*
* linux-2.6.22.1/net/ipv4/ip_fragment.c
*
* Oops, a fragment queue timed out.
* Kill it and send an ICMP reply.
*
* sisi 2007-8-13 02:27pm
*/
static void ip_expire(unsigned long arg)
{
        struct ipq *qp = (struct ipq *) arg;

        spin_lock(&qp->lock);

        if (qp->last_in & COMPLETE)
                goto out;

        ipq_kill(qp);

        IP_INC_STATS_BH(IPSTATS_MIB_REASMTIMEOUT);
        IP_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);

        if ((qp->last_in&FIRST_IN) && qp->fragments != NULL) {
                struct sk_buff *head = qp->fragments;
                /*
                 * Send an ICMP "Fragment Reassembly Timeout" message.
                 *
                 * 由这里引发
                 */
                if ((head->dev = dev_get_by_index(qp->iif)) != NULL) {
                        icmp_send(head, ICMP_TIME_EXCEEDED, ICMP_EXC_FRAGTIME, 0);
                        dev_put(head->dev);
                }
        }
out:
        spin_unlock(&qp->lock);
        ipq_put(qp, NULL);
}

void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
{
        struct iphdr *iph;
        int room;
        struct icmp_bxm icmp_param;
        struct rtable *rt = (struct rtable *)skb_in->dst;
        struct ipcm_cookie ipc;
        __be32 saddr;
        u8  tos;

        if (!rt) {
                /* 在这里兑现,
                 *
                 * defarg, if issued by netfilter,
                 * at PRE_ROUTING in normal cases,
                 * 谁给skb_in->dst赋值?
                 *
                 * 本应发送Fragment Reassembly Timeout message,
                 * 确没有发。
                 */
                goto out;
        }
}



shot bug by daemeon

--- linux-2.6.22/net/ipv4/icmp.c        2007-07-09 07:32:17.000000000 +0800
+++ new/net/ipv4/icmp.c        2007-08-13 17:36:21.000000000 +0800
@@ -440,9 +440,6 @@ void icmp_send(struct sk_buff *skb_in, i
        __be32 saddr;
        u8  tos;

-        if (!rt)
-                goto out;
-
        /*
         *        Find the original header. It is expected to be valid, of course.
         *        Check this, icmp_send is called from the most obscure devices
@@ -461,16 +458,24 @@ void icmp_send(struct sk_buff *skb_in, i
                goto out;

        /*
-         *        Now check at the protocol level
+         *        Only reply to fragment 0. We byte re-order the constant
+         *        mask for efficiency.
         */
-        if (rt->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST))
+        if (iph->frag_off & htons(IP_OFFSET))
                goto out;

+        if (!rt) {
+                if (ip_route_input(skb_in, iph->daddr, iph->saddr,
+                                        iph->tos, skb_in->dev) != 0)
+                        goto out;
+
+                rt = (struct rtable *)skb_in->dst;
+        }
+
        /*
-         *        Only reply to fragment 0. We byte re-order the constant
-         *        mask for efficiency.
+         *        Now check at the protocol level
         */
-        if (iph->frag_off & htons(IP_OFFSET))
+        if (rt->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST))
                goto out;

        /*

daemeon won ¥4。
版权问题,请daemeon大哥确认。

refined by rtable

+        if (!rt) {
+                struct net_device __ndev;
+
+                if (skb_in->input_dev)
+                    __ndev = skb_in->input_dev;
+                else
+                   __ndev = get_dev_by_index(skb_in->iif);
+                if (!__ndev)
+                   goto out;
+
+                if (ip_route_input(skb_in, iph->daddr, iph->saddr,
+                                             iph->tos, __ndev) != 0)
+                        goto out;
+
+                rt = (struct rtable *)skb_in->dst;
+        }

[ 本帖最后由 sisi8408 于 2007-8-18 14:37 编辑 ]



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

__________________________________

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

Web安全应用现状有奖调查+Web安全应急处理沙龙+100积分 | 致电800-858-2903,了解DELL如何为你量身订制笔记本
sisi8408 (linux八哥)
风云使者




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

可用积分:545 (稍有积蓄)
信誉积分:100
专家积分:0 (本版)

状态:...离线...

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


顶部
5楼 发表于 2007-8-18 14:06 


/*
* linux-2.6.22.1/net/xfrm/xfrm_state.c
* sisi 2007-8-14 10:44am
*/
int km_report (u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr)
{
        int err = -EINVAL;
        int ret;
        struct xfrm_mgr *km;

        read_lock(&xfrm_km_lock);
        list_for_each_entry(km, &xfrm_km_list, list) {
                if (km->report) {
                        ret = km->report(proto, sel, addr);
                        if (!ret)
                                err = ret;
                }
        }
        read_unlock(&xfrm_km_lock);
        /*
         * err report bug
         */
        return err;
}




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

__________________________________

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

Web安全应用现状有奖调查+Web安全应急处理沙龙+100积分 | 致电800-858-2903,了解DELL如何为你量身订制笔记本
sisi8408 (linux八哥)
风云使者




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

可用积分:545 (稍有积蓄)
信誉积分:100
专家积分:0 (本版)

状态:...离线...

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


顶部
6楼 发表于 2007-8-18 14:10 


linux-2.6.20.7 漏洞

static int wanpipe_rcv(struct sk_buff *skb, struct net_device *dev,
                       struct sock *sk)
{
        struct wan_sockaddr_ll * sll = (struct wan_sockaddr_ll *)skb->cb;
        wanpipe_common_t * chan = dev->priv;
        /*
         * When we registered the protocol,
         * we saved the socket in the data field for just this event.
         */
        skb->dev = dev;

        sll->sll_family = AF_WANPIPE;
        sll->sll_hatype = dev->type;
        sll->sll_protocol = skb->protocol;
        sll->sll_pkttype = skb->pkt_type;
        sll->sll_ifindex = dev->ifindex;
      
        sll->sll_halen = 0;
        if (dev->hard_header_parse)
                sll->sll_halen = dev->hard_header_parse(skb, sll->sll_addr);

        /*
         * WAN_PACKET_DATA : Data which should be passed up the receive queue.
         * WAN_PACKET_ASYC : Asynchronous data like place call, which should
         *                   be passed up the listening sock.
         * WAN_PACKET_ERR  : Asynchronous data like clear call or restart
         *                   which should go into an error queue.
         */
        switch (skb->pkt_type) {
                case WAN_PACKET_DATA:
                        if (sock_queue_rcv_skb(sk, skb) < 0) {
                                return -ENOMEM;
                        }
                        break;
               
                case WAN_PACKET_CMD:
                        sk->sk_state = chan->state;
                        /* Bug fix: update Mar6.
                         * Do not set the sock lcn number here, since
                          * cmd is not guaranteed to be executed on the
                         * board, thus Lcn could be wrong
                         */
                        sk->sk_data_ready(sk, skb->len);
                        kfree_skb(skb);
                        break;
               
                case WAN_PACKET_ERR:
                        sk->sk_state = chan->state;
                        if (sock_queue_err_skb(sk,skb)<0){
                                return -ENOMEM;
                        }
                        break;
               
                default:
                        //at this case 就在这儿,呵呵
                        printk(KERN_INFO "wansock: BH Illegal Packet Type Dropping\n");
                        kfree_skb(skb);
                        break;
        }
        return 0;
}




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

__________________________________

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

Web安全应用现状有奖调查+Web安全应急处理沙龙+100积分 | 致电800-858-2903,了解DELL如何为你量身订制笔记本
daemeon   帅哥
精灵




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

可用积分:144 (白手起家)
信誉积分:100
专家积分:0 (本版)

状态:...离线...

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


顶部
7楼 发表于 2007-8-18 14:53 
回复 #1 sisi8408 的帖子

>>请daemeon大哥确认
狂汗

print_active_timers不会是指Andrew的注释里的说问题吧?



您对本贴的看法:鲜花[0] 臭蛋[0]
Web安全应用现状有奖调查+Web安全应急处理沙龙+100积分 | 致电800-858-2903,了解DELL如何为你量身订制笔记本
sisi8408 (linux八哥)
风云使者




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

可用积分:545 (稍有积蓄)
信誉积分:100
专家积分:0 (本版)

状态:...离线...

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


顶部
8楼 发表于 2007-8-18 14:58 
回复 #7 daemeon 的帖子

请细说Andrew的注释里的问题,

这里请注意spin lock 的用法,¥1 就为这个。

化¥1 理解I Molnar的苦心,if(timer_pending(t))让俺受苦。
¥5 for WAN 还等你出手,呵呵。

[ 本帖最后由 sisi8408 于 2007-8-18 15:13 编辑 ]



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

__________________________________

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

Web安全应用现状有奖调查+Web安全应急处理沙龙+100积分 | 致电800-858-2903,了解DELL如何为你量身订制笔记本
daemeon   帅哥
精灵




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

可用积分:144 (白手起家)
信誉积分:100
专家积分:0 (本版)

状态:...离线...

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


顶部
9楼 发表于 2007-8-18 16:06 
回复 #8 sisi8408 的帖子

spin_lock用法没有问题.



您对本贴的看法:鲜花[0] 臭蛋[0]
Web安全应用现状有奖调查+Web安全应急处理沙龙+100积分 | 致电800-858-2903,了解DELL如何为你量身订制笔记本
sisi8408 (linux八哥)
风云使者




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

可用积分:545 (稍有积蓄)
信誉积分:100
专家积分:0 (本版)

状态:...离线...

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


顶部
10楼 发表于 2007-8-18 16:22 
回复 #9 daemeon 的帖子

的确没问题,他干吗用个tmp,还要memcpy?
俺查看timer的地址,对吗?

[ 本帖最后由 sisi8408 于 2007-8-18 16:33 编辑 ]



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

__________________________________

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

Web安全应用现状有奖调查+Web安全应急处理沙龙+100积分 | 致电800-858-2903,了解DELL如何为你量身订制笔记本

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

 


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

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

京ICP证041476号


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

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