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
2835a13b
Commit
2835a13b
authored
Jun 09, 2017
by
John Johansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apparmor: cleanup rename XXX_file_context() to XXX_file_ctx()
Signed-off-by:
John Johansen
<
john.johansen@canonical.com
>
parent
df8073c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
11 deletions
+16
-11
security/apparmor/include/file.h
security/apparmor/include/file.h
+12
-5
security/apparmor/lsm.c
security/apparmor/lsm.c
+4
-6
No files found.
security/apparmor/include/file.h
View file @
2835a13b
...
...
@@ -30,6 +30,8 @@ struct path;
AA_MAY_CHMOD | AA_MAY_CHOWN | AA_MAY_LOCK | \
AA_EXEC_MMAP | AA_MAY_LINK)
#define file_ctx(X) ((struct aa_file_ctx *)(X)->f_security)
/* struct aa_file_ctx - the AppArmor context the file was opened in
* @perms: the permission the file was opened with
*
...
...
@@ -42,21 +44,26 @@ struct aa_file_ctx {
};
/**
* aa_alloc_file_context - allocate file_ctx
* aa_alloc_file_ctx - allocate file_ctx
* @label: initial label of task creating the file
* @gfp: gfp flags for allocation
*
* Returns: file_ctx or NULL on failure
*/
static
inline
struct
aa_file_ctx
*
aa_alloc_file_c
ontext
(
gfp_t
gfp
)
static
inline
struct
aa_file_ctx
*
aa_alloc_file_c
tx
(
gfp_t
gfp
)
{
return
kzalloc
(
sizeof
(
struct
aa_file_ctx
),
gfp
);
struct
aa_file_ctx
*
ctx
;
ctx
=
kzalloc
(
sizeof
(
struct
aa_file_ctx
),
gfp
);
return
ctx
;
}
/**
* aa_free_file_c
ontext
- free a file_ctx
* aa_free_file_c
tx
- free a file_ctx
* @ctx: file_ctx to free (MAYBE_NULL)
*/
static
inline
void
aa_free_file_c
ontext
(
struct
aa_file_ctx
*
ctx
)
static
inline
void
aa_free_file_c
tx
(
struct
aa_file_ctx
*
ctx
)
{
if
(
ctx
)
kzfree
(
ctx
);
...
...
security/apparmor/lsm.c
View file @
2835a13b
...
...
@@ -398,9 +398,9 @@ static int apparmor_file_alloc_security(struct file *file)
/* freed by apparmor_file_free_security */
struct
aa_profile
*
profile
=
begin_current_profile_crit_section
();
file
->
f_security
=
aa_alloc_file_c
ontext
(
GFP_KERNEL
);
if
(
!
file
->
f_security
)
return
-
ENOMEM
;
file
->
f_security
=
aa_alloc_file_c
tx
(
GFP_KERNEL
);
if
(
!
file
_ctx
(
file
)
)
error
=
-
ENOMEM
;
end_current_profile_crit_section
(
profile
);
return
error
;
...
...
@@ -408,9 +408,7 @@ static int apparmor_file_alloc_security(struct file *file)
static
void
apparmor_file_free_security
(
struct
file
*
file
)
{
struct
aa_file_ctx
*
ctx
=
file
->
f_security
;
aa_free_file_context
(
ctx
);
aa_free_file_ctx
(
file_ctx
(
file
));
}
static
int
common_file_perm
(
const
char
*
op
,
struct
file
*
file
,
u32
mask
)
...
...
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