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
nexedi
linux
Commits
fe27d4b0
Commit
fe27d4b0
authored
Dec 03, 2010
by
James Morris
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'smack-next-master' into next
parents
ad9c2b04
676dac4b
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
178 additions
and
54 deletions
+178
-54
include/linux/xattr.h
include/linux/xattr.h
+2
-0
security/smack/smack.h
security/smack/smack.h
+30
-0
security/smack/smack_access.c
security/smack/smack_access.c
+2
-2
security/smack/smack_lsm.c
security/smack/smack_lsm.c
+142
-50
security/smack/smackfs.c
security/smack/smackfs.c
+2
-2
No files found.
include/linux/xattr.h
View file @
fe27d4b0
...
...
@@ -40,9 +40,11 @@
#define XATTR_SMACK_SUFFIX "SMACK64"
#define XATTR_SMACK_IPIN "SMACK64IPIN"
#define XATTR_SMACK_IPOUT "SMACK64IPOUT"
#define XATTR_SMACK_EXEC "SMACK64EXEC"
#define XATTR_NAME_SMACK XATTR_SECURITY_PREFIX XATTR_SMACK_SUFFIX
#define XATTR_NAME_SMACKIPIN XATTR_SECURITY_PREFIX XATTR_SMACK_IPIN
#define XATTR_NAME_SMACKIPOUT XATTR_SECURITY_PREFIX XATTR_SMACK_IPOUT
#define XATTR_NAME_SMACKEXEC XATTR_SECURITY_PREFIX XATTR_SMACK_EXEC
#define XATTR_CAPS_SUFFIX "capability"
#define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX
...
...
security/smack/smack.h
View file @
fe27d4b0
...
...
@@ -51,10 +51,16 @@ struct socket_smack {
*/
struct
inode_smack
{
char
*
smk_inode
;
/* label of the fso */
char
*
smk_task
;
/* label of the task */
struct
mutex
smk_lock
;
/* initialization lock */
int
smk_flags
;
/* smack inode flags */
};
struct
task_smack
{
char
*
smk_task
;
/* label used for access control */
char
*
smk_forked
;
/* label when forked */
};
#define SMK_INODE_INSTANT 0x01
/* inode is instantiated */
/*
...
...
@@ -242,6 +248,30 @@ static inline char *smk_of_inode(const struct inode *isp)
return
sip
->
smk_inode
;
}
/*
* Present a pointer to the smack label in an task blob.
*/
static
inline
char
*
smk_of_task
(
const
struct
task_smack
*
tsp
)
{
return
tsp
->
smk_task
;
}
/*
* Present a pointer to the forked smack label in an task blob.
*/
static
inline
char
*
smk_of_forked
(
const
struct
task_smack
*
tsp
)
{
return
tsp
->
smk_forked
;
}
/*
* Present a pointer to the smack label in the curren task blob.
*/
static
inline
char
*
smk_of_current
(
void
)
{
return
smk_of_task
(
current_security
());
}
/*
* logging functions
*/
...
...
security/smack/smack_access.c
View file @
fe27d4b0
...
...
@@ -185,7 +185,7 @@ int smk_access(char *subject_label, char *object_label, int request,
int
smk_curacc
(
char
*
obj_label
,
u32
mode
,
struct
smk_audit_info
*
a
)
{
int
rc
;
char
*
sp
=
current_security
();
char
*
sp
=
smk_of_current
();
rc
=
smk_access
(
sp
,
obj_label
,
mode
,
NULL
);
if
(
rc
==
0
)
...
...
@@ -196,7 +196,7 @@ int smk_curacc(char *obj_label, u32 mode, struct smk_audit_info *a)
* only one that gets privilege and current does not
* have that label.
*/
if
(
smack_onlycap
!=
NULL
&&
smack_onlycap
!=
current
->
cred
->
security
)
if
(
smack_onlycap
!=
NULL
&&
smack_onlycap
!=
sp
)
goto
out_audit
;
if
(
capable
(
CAP_MAC_OVERRIDE
))
...
...
security/smack/smack_lsm.c
View file @
fe27d4b0
This diff is collapsed.
Click to expand it.
security/smack/smackfs.c
View file @
fe27d4b0
...
...
@@ -121,7 +121,7 @@ static void smk_netlabel_audit_set(struct netlbl_audit *nap)
{
nap
->
loginuid
=
audit_get_loginuid
(
current
);
nap
->
sessionid
=
audit_get_sessionid
(
current
);
nap
->
secid
=
smack_to_secid
(
current_security
());
nap
->
secid
=
smack_to_secid
(
smk_of_current
());
}
/*
...
...
@@ -1160,7 +1160,7 @@ static ssize_t smk_write_onlycap(struct file *file, const char __user *buf,
size_t
count
,
loff_t
*
ppos
)
{
char
in
[
SMK_LABELLEN
];
char
*
sp
=
current
->
cred
->
security
;
char
*
sp
=
smk_of_task
(
current
->
cred
->
security
)
;
if
(
!
capable
(
CAP_MAC_ADMIN
))
return
-
EPERM
;
...
...
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