Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
ac14ae25
Commit
ac14ae25
authored
Nov 27, 2014
by
James Morris
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'smack-for-3.19' of
git://git.gitorious.org/smack-next/kernel
into next
parents
a6aacbde
5c1b6624
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
12 deletions
+18
-12
security/smack/smack_access.c
security/smack/smack_access.c
+8
-9
security/smack/smack_lsm.c
security/smack/smack_lsm.c
+10
-3
No files found.
security/smack/smack_access.c
View file @
ac14ae25
...
@@ -142,8 +142,7 @@ int smk_access(struct smack_known *subject, struct smack_known *object,
...
@@ -142,8 +142,7 @@ int smk_access(struct smack_known *subject, struct smack_known *object,
* Tasks cannot be assigned the internet label.
* Tasks cannot be assigned the internet label.
* An internet subject can access any object.
* An internet subject can access any object.
*/
*/
if
(
object
==
&
smack_known_web
||
if
(
object
==
&
smack_known_web
||
subject
==
&
smack_known_web
)
subject
==
&
smack_known_web
)
goto
out_audit
;
goto
out_audit
;
/*
/*
* A star object can be accessed by any subject.
* A star object can be accessed by any subject.
...
@@ -157,10 +156,11 @@ int smk_access(struct smack_known *subject, struct smack_known *object,
...
@@ -157,10 +156,11 @@ int smk_access(struct smack_known *subject, struct smack_known *object,
if
(
subject
->
smk_known
==
object
->
smk_known
)
if
(
subject
->
smk_known
==
object
->
smk_known
)
goto
out_audit
;
goto
out_audit
;
/*
/*
* A hat subject can read any object.
* A hat subject can read
or lock
any object.
* A floor object can be read by any subject.
* A floor object can be read
or locked
by any subject.
*/
*/
if
((
request
&
MAY_ANYREAD
)
==
request
)
{
if
((
request
&
MAY_ANYREAD
)
==
request
||
(
request
&
MAY_LOCK
)
==
request
)
{
if
(
object
==
&
smack_known_floor
)
if
(
object
==
&
smack_known_floor
)
goto
out_audit
;
goto
out_audit
;
if
(
subject
==
&
smack_known_hat
)
if
(
subject
==
&
smack_known_hat
)
...
@@ -452,10 +452,9 @@ char *smk_parse_smack(const char *string, int len)
...
@@ -452,10 +452,9 @@ char *smk_parse_smack(const char *string, int len)
return
NULL
;
return
NULL
;
smack
=
kzalloc
(
i
+
1
,
GFP_KERNEL
);
smack
=
kzalloc
(
i
+
1
,
GFP_KERNEL
);
if
(
smack
!=
NULL
)
{
if
(
smack
!=
NULL
)
strncpy
(
smack
,
string
,
i
+
1
);
strncpy
(
smack
,
string
,
i
);
smack
[
i
]
=
'\0'
;
}
return
smack
;
return
smack
;
}
}
...
...
security/smack/smack_lsm.c
View file @
ac14ae25
...
@@ -53,6 +53,7 @@
...
@@ -53,6 +53,7 @@
#define SMK_SENDING 2
#define SMK_SENDING 2
LIST_HEAD
(
smk_ipv6_port_list
);
LIST_HEAD
(
smk_ipv6_port_list
);
static
struct
kmem_cache
*
smack_inode_cache
;
#ifdef CONFIG_SECURITY_SMACK_BRINGUP
#ifdef CONFIG_SECURITY_SMACK_BRINGUP
static
void
smk_bu_mode
(
int
mode
,
char
*
s
)
static
void
smk_bu_mode
(
int
mode
,
char
*
s
)
...
@@ -240,7 +241,7 @@ struct inode_smack *new_inode_smack(struct smack_known *skp)
...
@@ -240,7 +241,7 @@ struct inode_smack *new_inode_smack(struct smack_known *skp)
{
{
struct
inode_smack
*
isp
;
struct
inode_smack
*
isp
;
isp
=
k
zalloc
(
sizeof
(
struct
inode_smack
)
,
GFP_NOFS
);
isp
=
k
mem_cache_zalloc
(
smack_inode_cache
,
GFP_NOFS
);
if
(
isp
==
NULL
)
if
(
isp
==
NULL
)
return
NULL
;
return
NULL
;
...
@@ -767,7 +768,7 @@ static int smack_inode_alloc_security(struct inode *inode)
...
@@ -767,7 +768,7 @@ static int smack_inode_alloc_security(struct inode *inode)
*/
*/
static
void
smack_inode_free_security
(
struct
inode
*
inode
)
static
void
smack_inode_free_security
(
struct
inode
*
inode
)
{
{
k
free
(
inode
->
i_security
);
k
mem_cache_free
(
smack_inode_cache
,
inode
->
i_security
);
inode
->
i_security
=
NULL
;
inode
->
i_security
=
NULL
;
}
}
...
@@ -4265,10 +4266,16 @@ static __init int smack_init(void)
...
@@ -4265,10 +4266,16 @@ static __init int smack_init(void)
if
(
!
security_module_enable
(
&
smack_ops
))
if
(
!
security_module_enable
(
&
smack_ops
))
return
0
;
return
0
;
smack_inode_cache
=
KMEM_CACHE
(
inode_smack
,
0
);
if
(
!
smack_inode_cache
)
return
-
ENOMEM
;
tsp
=
new_task_smack
(
&
smack_known_floor
,
&
smack_known_floor
,
tsp
=
new_task_smack
(
&
smack_known_floor
,
&
smack_known_floor
,
GFP_KERNEL
);
GFP_KERNEL
);
if
(
tsp
==
NULL
)
if
(
tsp
==
NULL
)
{
kmem_cache_destroy
(
smack_inode_cache
);
return
-
ENOMEM
;
return
-
ENOMEM
;
}
printk
(
KERN_INFO
"Smack: Initializing.
\n
"
);
printk
(
KERN_INFO
"Smack: Initializing.
\n
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment