Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
82b88bb2
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
82b88bb2
编写于
13年前
作者:
J
James Morris
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'for-linus' of
git://git.infradead.org/users/eparis/selinux
into for-linus
上级
60b8b1de
ded50988
无相关合并请求
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
39 addition
and
1 deletion
+39
-1
security/selinux/selinuxfs.c
security/selinux/selinuxfs.c
+36
-1
security/selinux/ss/policydb.c
security/selinux/ss/policydb.c
+3
-0
未找到文件。
security/selinux/selinuxfs.c
浏览文件 @
82b88bb2
...
...
@@ -29,6 +29,7 @@
#include <linux/audit.h>
#include <linux/uaccess.h>
#include <linux/kobject.h>
#include <linux/ctype.h>
/* selinuxfs pseudo filesystem for exporting the security policy API.
Based on the proc code and the fs/nfsd/nfsctl.c code. */
...
...
@@ -751,6 +752,14 @@ static ssize_t sel_write_access(struct file *file, char *buf, size_t size)
return
length
;
}
static
inline
int
hexcode_to_int
(
int
code
)
{
if
(
code
==
'\0'
||
!
isxdigit
(
code
))
return
-
1
;
if
(
isdigit
(
code
))
return
code
-
'0'
;
return
tolower
(
code
)
-
'a'
+
10
;
}
static
ssize_t
sel_write_create
(
struct
file
*
file
,
char
*
buf
,
size_t
size
)
{
char
*
scon
=
NULL
,
*
tcon
=
NULL
;
...
...
@@ -785,8 +794,34 @@ static ssize_t sel_write_create(struct file *file, char *buf, size_t size)
nargs
=
sscanf
(
buf
,
"%s %s %hu %s"
,
scon
,
tcon
,
&
tclass
,
namebuf
);
if
(
nargs
<
3
||
nargs
>
4
)
goto
out
;
if
(
nargs
==
4
)
if
(
nargs
==
4
)
{
/*
* If and when the name of new object to be queried contains
* either whitespace or multibyte characters, they shall be
* encoded based on the percentage-encoding rule.
* If not encoded, the sscanf logic picks up only left-half
* of the supplied name; splitted by a whitespace unexpectedly.
*/
char
*
r
,
*
w
;
int
c1
,
c2
;
r
=
w
=
namebuf
;
do
{
c1
=
*
r
++
;
if
(
c1
==
'+'
)
c1
=
' '
;
else
if
(
c1
==
'%'
)
{
if
((
c1
=
hexcode_to_int
(
*
r
++
))
<
0
)
goto
out
;
if
((
c2
=
hexcode_to_int
(
*
r
++
))
<
0
)
goto
out
;
c1
=
(
c1
<<
4
)
|
c2
;
}
*
w
++
=
c1
;
}
while
(
c1
!=
'\0'
);
objname
=
namebuf
;
}
length
=
security_context_to_sid
(
scon
,
strlen
(
scon
)
+
1
,
&
ssid
);
if
(
length
)
...
...
This diff is collapsed.
Click to expand it.
security/selinux/ss/policydb.c
浏览文件 @
82b88bb2
...
...
@@ -3222,6 +3222,9 @@ static int filename_trans_write(struct policydb *p, void *fp)
__le32
buf
[
1
];
int
rc
;
if
(
p
->
policyvers
<
POLICYDB_VERSION_FILENAME_TRANS
)
return
0
;
nel
=
0
;
rc
=
hashtab_map
(
p
->
filename_trans
,
hashtab_cnt
,
&
nel
);
if
(
rc
)
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录