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
d102d895
Commit
d102d895
authored
Jan 16, 2017
by
John Johansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apparmor: pass gfp param into aa_policy_init()
Signed-off-by:
John Johansen
<
john.johansen@canonical.com
>
parent
bbe4a7c8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
7 deletions
+7
-7
security/apparmor/include/lib.h
security/apparmor/include/lib.h
+1
-1
security/apparmor/lib.c
security/apparmor/lib.c
+4
-4
security/apparmor/policy.c
security/apparmor/policy.c
+1
-1
security/apparmor/policy_ns.c
security/apparmor/policy_ns.c
+1
-1
No files found.
security/apparmor/include/lib.h
View file @
d102d895
...
@@ -194,7 +194,7 @@ static inline struct aa_policy *__policy_strn_find(struct list_head *head,
...
@@ -194,7 +194,7 @@ static inline struct aa_policy *__policy_strn_find(struct list_head *head,
}
}
bool
aa_policy_init
(
struct
aa_policy
*
policy
,
const
char
*
prefix
,
bool
aa_policy_init
(
struct
aa_policy
*
policy
,
const
char
*
prefix
,
const
char
*
name
);
const
char
*
name
,
gfp_t
gfp
);
void
aa_policy_destroy
(
struct
aa_policy
*
policy
);
void
aa_policy_destroy
(
struct
aa_policy
*
policy
);
#endif
/* AA_LIB_H */
#endif
/* AA_LIB_H */
security/apparmor/lib.c
View file @
d102d895
...
@@ -171,20 +171,20 @@ void *__aa_kvmalloc(size_t size, gfp_t flags)
...
@@ -171,20 +171,20 @@ void *__aa_kvmalloc(size_t size, gfp_t flags)
* Returns: true if policy init successful
* Returns: true if policy init successful
*/
*/
bool
aa_policy_init
(
struct
aa_policy
*
policy
,
const
char
*
prefix
,
bool
aa_policy_init
(
struct
aa_policy
*
policy
,
const
char
*
prefix
,
const
char
*
name
)
const
char
*
name
,
gfp_t
gfp
)
{
{
/* freed by policy_free */
/* freed by policy_free */
if
(
prefix
)
{
if
(
prefix
)
{
policy
->
hname
=
kmalloc
(
strlen
(
prefix
)
+
strlen
(
name
)
+
3
,
policy
->
hname
=
kmalloc
(
strlen
(
prefix
)
+
strlen
(
name
)
+
3
,
GFP_KERNEL
);
gfp
);
if
(
policy
->
hname
)
if
(
policy
->
hname
)
sprintf
((
char
*
)
policy
->
hname
,
"%s//%s"
,
prefix
,
name
);
sprintf
((
char
*
)
policy
->
hname
,
"%s//%s"
,
prefix
,
name
);
}
else
}
else
policy
->
hname
=
kstrdup
(
name
,
GFP_KERNEL
);
policy
->
hname
=
kstrdup
(
name
,
gfp
);
if
(
!
policy
->
hname
)
if
(
!
policy
->
hname
)
return
0
;
return
0
;
/* base.name is a substring of fqname */
/* base.name is a substring of fqname */
policy
->
name
=
(
char
*
)
basename
(
policy
->
hname
);
policy
->
name
=
basename
(
policy
->
hname
);
INIT_LIST_HEAD
(
&
policy
->
list
);
INIT_LIST_HEAD
(
&
policy
->
list
);
INIT_LIST_HEAD
(
&
policy
->
profiles
);
INIT_LIST_HEAD
(
&
policy
->
profiles
);
...
...
security/apparmor/policy.c
View file @
d102d895
...
@@ -272,7 +272,7 @@ struct aa_profile *aa_alloc_profile(const char *hname)
...
@@ -272,7 +272,7 @@ struct aa_profile *aa_alloc_profile(const char *hname)
goto
fail
;
goto
fail
;
kref_init
(
&
profile
->
proxy
->
count
);
kref_init
(
&
profile
->
proxy
->
count
);
if
(
!
aa_policy_init
(
&
profile
->
base
,
NULL
,
hname
))
if
(
!
aa_policy_init
(
&
profile
->
base
,
NULL
,
hname
,
GFP_KERNEL
))
goto
fail
;
goto
fail
;
kref_init
(
&
profile
->
count
);
kref_init
(
&
profile
->
count
);
...
...
security/apparmor/policy_ns.c
View file @
d102d895
...
@@ -95,7 +95,7 @@ static struct aa_ns *alloc_ns(const char *prefix, const char *name)
...
@@ -95,7 +95,7 @@ static struct aa_ns *alloc_ns(const char *prefix, const char *name)
AA_DEBUG
(
"%s(%p)
\n
"
,
__func__
,
ns
);
AA_DEBUG
(
"%s(%p)
\n
"
,
__func__
,
ns
);
if
(
!
ns
)
if
(
!
ns
)
return
NULL
;
return
NULL
;
if
(
!
aa_policy_init
(
&
ns
->
base
,
prefix
,
name
))
if
(
!
aa_policy_init
(
&
ns
->
base
,
prefix
,
name
,
GFP_KERNEL
))
goto
fail_ns
;
goto
fail_ns
;
INIT_LIST_HEAD
(
&
ns
->
sub_ns
);
INIT_LIST_HEAD
(
&
ns
->
sub_ns
);
...
...
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