Bugtraq ID: 47852 CVE ID:CVE-2011-1767 Linux是一款开放源代码的操作系统。 net/ipv4/ip_gre.c中IP GRE模块初始化函数包含如下代码: 01 /* 02 * And now the modules code and kernel interface. 03 */ 04 05 static int __init ipgre_init(void) 06 { 07 int err; 08 09 printk(KERN_INFO "GRE over IPv4 tunneling driver\n"); 10 11 if (inet_add_protocol(&ipgre_protocol, IPPROTO_GRE) < 0) { 12 printk(KERN_INFO "ipgre init: can't add protocol\n"); 13 return -EAGAIN; 14 } 15 16 err = register_pernet_gen_device(&ipgre_net_id, &ipgre_net_ops); 17 if (err < 0) 18 goto gen_device_failed; 19 20 err = rtnl_link_register(&ipgre_link_ops); 21 if (err < 0) 22 goto rtnl_link_failed; 23 24 err = rtnl_link_register(&ipgre_tap_ops); 25 if (err < 0) 26 goto tap_ops_failed; 27 28 out: 29 return err; 30 31 tap_ops_failed: 32 rtnl_link_unregister(&ipgre_link_ops); 33 rtnl_link_failed: 34 unregister_pernet_gen_device(ipgre_net_id, &ipgre_net_ops); 35 gen_device_failed: 36...
Bugtraq ID: 47852 CVE ID:CVE-2011-1767 Linux是一款开放源代码的操作系统。 net/ipv4/ip_gre.c中IP GRE模块初始化函数包含如下代码: 01 /* 02 * And now the modules code and kernel interface. 03 */ 04 05 static int __init ipgre_init(void) 06 { 07 int err; 08 09 printk(KERN_INFO "GRE over IPv4 tunneling driver\n"); 10 11 if (inet_add_protocol(&ipgre_protocol, IPPROTO_GRE) < 0) { 12 printk(KERN_INFO "ipgre init: can't add protocol\n"); 13 return -EAGAIN; 14 } 15 16 err = register_pernet_gen_device(&ipgre_net_id, &ipgre_net_ops); 17 if (err < 0) 18 goto gen_device_failed; 19 20 err = rtnl_link_register(&ipgre_link_ops); 21 if (err < 0) 22 goto rtnl_link_failed; 23 24 err = rtnl_link_register(&ipgre_tap_ops); 25 if (err < 0) 26 goto tap_ops_failed; 27 28 out: 29 return err; 30 31 tap_ops_failed: 32 rtnl_link_unregister(&ipgre_link_ops); 33 rtnl_link_failed: 34 unregister_pernet_gen_device(ipgre_net_id, &ipgre_net_ops); 35 gen_device_failed: 36 inet_del_protocol(&ipgre_protocol, IPPROTO_GRE); 37 goto out; 38 } 可以看到,IP GRE内核模块初始化会先注册‘IPPROTO_GRE’协议,然后注册存储在‘ipgre_net_ops’结构中的回调函数: 1 static struct pernet_operations ipgre_net_ops = { 2 .init = ipgre_init_net, 3 .exit = ipgre_exit_net, 4 }; 因此,如果攻击者在两个初始化(协议和‘ipgre_net_ops’结构)之间发送报文,会由于内核对上述结构执行初始化而触发空指针引用。 Linux kernel 2.6.x 厂商解决方案 用户可参考如下供应商提供的安全补丁: http://patchwork.ozlabs.org/patch/45553/