收稿日期:
2014-04-15
;
修回日期:
2014-06-06
。
基金项目:
国家
863
计划项目
(
2008AA01A202
)
。
作者简介:
郭庆伟
(
1987
-
)
,
男,
河南商丘人,
硕士研究生,
主要研究方向:
嵌入式操作系统容错;
杨麦顺
(
1957
-
)
,
男,
陕西渭南人,
高级
工程师,
硕士,
主要研究方向:
嵌入式操作系统容错、
嵌入式系统;
张影
(
1989
-
)
,
女,
陕西渭南人,
硕士研究生,
主要研究方向:
嵌入式操作系统
容错;
张兴军
(
1969
-
)
,
男,
陕西宝鸡人,
教授,
博士,
主要研究方向:
高性能计算、
网络存储与网络计算。
文章编号:
1001-9081
(
2014
)
S2-0200-04
用软件中断实现的
Linux
内核故障注入方法
郭庆伟
*
,
杨麦顺,
张
影,
张兴军
(西安交通大学
电子与信息工程学院,
西安
710049
)
(
*
通信作者电子邮箱
qqingweihao@
163.
com)
摘
要:
针对容错操作系统的可靠性评测问题,
提出一种向
Linux
内核注入
“单个位”
故障的方法。基于
x86
体系
结构中的软件中断机制,
首先利用可加载内核模块机制在时钟中断中设置一个探测点,
然后将用户态的故障数据传
输到内核空间,
最后利用一种
C
/
S
结构的故障注入模型,
分别向
Linux
内核的
arch
、
fs
、
kernel
和
mm
四个子系统注入故
障
(瞬时型、
间歇型和永久型)
6
700
余次。实验结果表明,
与
arch
和
fs
子系统相比,
kernel
和
mm
子系统对故障的敏感
度较高,
平均检测故障覆盖率达到
38.
23'
;
与数据段相比,
内核代码段对故障的敏感度较高,
平均检测故障覆盖率达
到
73.
49'
,
该方法提高了容错型操作系统可靠性评测的速度和准确度。
关键词:
可靠性评测;
软件中断;
软件实现的故障注入;
Linux
内核
中图分类号:
TP311.
56
文献标志码:
A
Software
interrupt
implemented
fault
injection
method
in
Linux
kernel
GUO
Qingwei
*
,
YANG
Maishun,
ZHANG
Ying,
ZHANG
Xingjun
(
School
of
Electronics
and
Information
Engineering,
Xi'an
Jiaotong
University,
Xi'an
Shaanxi
710049
,
China
)
Abstract:
Aiming
at
the
problem
of
evaluating
the
dependability
of
fault-tolerant
operating
system,
a
scheme
was
proposed
to
inject
single-bit
faults
in
the
Linux
kernel.
Based
on
software
interrupt
technology
existing
in
x86
architecture,
a
probe
point
was
firstly
installed
in
the
timer
interrupt
using
loadable
kernel
module.
Then
the
faults
data
were
delivered
from
user
space
to
kernel
space.
Finally
about
6
700
faults
including
transient,
intermittent
and
permanent
type
were
conducted
targeting
four
kernel
subsystems,
i.
e.
arch,
fs,
kernel
and
mm,
by
means
of
a
C
/
S
fault
injecting
model.
Experiments
indicate
that
compared
with
arch
and
fs
subsystems,
the
kernel
and
mm
are
more
sensitive
to
faults,
the
average
detection
fault
coverage
reaches
38.
23'.
Compared
with
data
segment,
the
code
segment
is
more
sensitive
to
faults,
the
average
detection
fault
coverage
reaches
73.
49'.
This
scheme
improves
the
speed
and
accuracy
when
evaluating
the
dependability
of
fault-
tolerant
operating
system.
Key
words:
dependability
evaluation;
software
interrupt;
software
implemented
fault
injection;
Linux
kernel
0
引言
随着计算机系统在社会生活中的应用和普及,
人们对其稳
定性提出了越来越高的要求。一些关键领域如交通控制、
航空航
天、
医疗支持、
核电站管理等,
计算机系统一旦失效,
就会对人们
的生活、
生命和财产安全带来巨大的威胁,
后果无法估量。
计算机系统的稳定性很大程度上依赖于底层操作系统内
核的可靠性,
操作系统内核是计算机系统中最为敏感的组件,
它直接管理所有硬件资源,
为上层应用提供基础服务。由于
硬件和软件环境的复杂多样,
操作系统内核本身具有高度复
杂性,
对其可靠性的评测通常也是一项复杂艰巨的任务。操
作系统内核可靠性的评测需要在有限的时间内获得足够数量
的有效故障数据,
而故障的长时间潜伏期又使得获得这些数
据非常困难。对目标系统进行人为的故障注入可以缩短故障
潜伏期,
加速系统失效,
从而减少获得故障数据所需的时间。
目前常见的故障注入方法可以分为基于模拟的故障注入、
硬
件实现的故障注入和软件实现的故障注入。基于模拟的故障
注入方法需要对目标系统建模,
通常建模过程比较耗时;
硬件
实现的故障注入能够比较真实地模拟硬件故障,
但需要额外
的硬件支持并且难以模拟软件故障。相比之下,
软件实现的
故障注入方法易于实现和控制,
既可以在应用程序级注入故
障,
也可以在操作系统级注入故障,
是一种较为理想的故障注
入方案。
本文给出了一种基于软件中断的
Linux
内核故障注入方
法
LKFinjector
(
Linux
kernel
fault
injector
)
。
1
相关研究
Pradhan
[
1
]
定
义
了
软
件
实
现
的
故
障
注
入(
Software
Implemented
Fault
Injection
,
SWIFI
)
,
具体指通过某种方式中
断系统的正常执行,
然后执行特殊的故障注入代码以达到模
拟硬件和软件故障的目的。
SWIFI
既可以在用户空间进行,
也可以在操作系统内核空间进行。
目前的一些研究成果已经能够使用软件的方法向计算机
系统中注入一些特定类型的故障。
Linux
系统调用
ptrace
提
供了查询和修改另一个进程的内存映像和寄存器的能力。文
献
[
2
]
在
IA64
(
64-bit
Intel
Itanium
Architecture
)
系统之上设计
实现了一个故障注入平台,
允许注入处理器故障、
磁盘故障、
文件系统故障和系统调用边界故障。文献
[
3
]
在已有通用软
件故障注入技术
(
Generic
Software
Fault
Injection
Technique
,
Journal
of
Computer
Applications
计算机应用
,
2014,
34(
S2)
:
200
-
203
ISSN
1001-9081
CODEN
JYIIDU
2014-12-15
http:
/
/
www.
joca.