Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
8f37d47c
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
8f37d47c
编写于
5月 27, 2005
作者:
D
David Woodhouse
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
AUDIT: Record working directory when syscall arguments are pathnames
Signed-off-by:
N
David Woodhouse
<
dwmw2@infradead.org
>
上级
7551ced3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
25 addition
and
1 deletion
+25
-1
include/linux/audit.h
include/linux/audit.h
+2
-1
kernel/auditsc.c
kernel/auditsc.c
+23
-0
未找到文件。
include/linux/audit.h
浏览文件 @
8f37d47c
...
...
@@ -61,11 +61,12 @@
#define AUDIT_SYSCALL 1300
/* Syscall event */
#define AUDIT_FS_WATCH 1301
/* Filesystem watch event */
#define AUDIT_PATH 1302
/* Filname path information */
#define AUDIT_PATH 1302
/* Fil
e
name path information */
#define AUDIT_IPC 1303
/* IPC record */
#define AUDIT_SOCKETCALL 1304
/* sys_socketcall arguments */
#define AUDIT_CONFIG_CHANGE 1305
/* Audit system configuration change */
#define AUDIT_SOCKADDR 1306
/* sockaddr copied as syscall arg */
#define AUDIT_CWD 1307
/* Current working directory */
#define AUDIT_AVC 1400
/* SE Linux avc denial or grant */
#define AUDIT_SELINUX_ERR 1401
/* Internal SE Linux Errors */
...
...
kernel/auditsc.c
浏览文件 @
8f37d47c
...
...
@@ -145,6 +145,8 @@ struct audit_context {
int
auditable
;
/* 1 if record should be written */
int
name_count
;
struct
audit_names
names
[
AUDIT_NAMES
];
struct
dentry
*
pwd
;
struct
vfsmount
*
pwdmnt
;
struct
audit_context
*
previous
;
/* For nested syscalls */
struct
audit_aux_data
*
aux
;
...
...
@@ -552,6 +554,12 @@ static inline void audit_free_names(struct audit_context *context)
if
(
context
->
names
[
i
].
name
)
__putname
(
context
->
names
[
i
].
name
);
context
->
name_count
=
0
;
if
(
context
->
pwd
)
dput
(
context
->
pwd
);
if
(
context
->
pwdmnt
)
mntput
(
context
->
pwdmnt
);
context
->
pwd
=
NULL
;
context
->
pwdmnt
=
NULL
;
}
static
inline
void
audit_free_aux
(
struct
audit_context
*
context
)
...
...
@@ -745,10 +753,18 @@ static void audit_log_exit(struct audit_context *context)
audit_log_end
(
ab
);
}
if
(
context
->
pwd
&&
context
->
pwdmnt
)
{
ab
=
audit_log_start
(
context
,
AUDIT_CWD
);
if
(
ab
)
{
audit_log_d_path
(
ab
,
"cwd="
,
context
->
pwd
,
context
->
pwdmnt
);
audit_log_end
(
ab
);
}
}
for
(
i
=
0
;
i
<
context
->
name_count
;
i
++
)
{
ab
=
audit_log_start
(
context
,
AUDIT_PATH
);
if
(
!
ab
)
continue
;
/* audit_panic has been called */
audit_log_format
(
ab
,
"item=%d"
,
i
);
if
(
context
->
names
[
i
].
name
)
{
audit_log_format
(
ab
,
" name="
);
...
...
@@ -929,6 +945,13 @@ void audit_getname(const char *name)
context
->
names
[
context
->
name_count
].
name
=
name
;
context
->
names
[
context
->
name_count
].
ino
=
(
unsigned
long
)
-
1
;
++
context
->
name_count
;
if
(
!
context
->
pwd
)
{
read_lock
(
&
current
->
fs
->
lock
);
context
->
pwd
=
dget
(
current
->
fs
->
pwd
);
context
->
pwdmnt
=
mntget
(
current
->
fs
->
pwdmnt
);
read_unlock
(
&
current
->
fs
->
lock
);
}
}
/* Intercept a putname request. Called from
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录