Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Simon Ruderich
passt-mac
Commits
2dc8b6af
Commit
2dc8b6af
authored
Jul 20, 2016
by
Lukas Braun
Committed by
Simon Ruderich
Aug 29, 2016
Browse files
slsm: grab the tree mutex while serializing
slsm_serialize_subtree allocates, so we can't rely on RCU.
parent
bd943b31
Changes
1
Hide whitespace changes
Inline
Side-by-side
security/slsm/tree.c
View file @
2dc8b6af
...
...
@@ -263,7 +263,6 @@ ssize_t slsm_serialize_subtree(struct slsm_str *buf, struct slsm_str *path_buf,
}
ssize_t
slsm_serialize_tree
(
char
**
retbuf
)
{
struct
tree_node
*
t
;
ssize_t
ret
;
struct
slsm_str
buf
;
struct
slsm_str
path_buf
;
...
...
@@ -278,10 +277,9 @@ ssize_t slsm_serialize_tree(char **retbuf) {
if
(
ret
)
return
ret
;
rcu_read_lock
();
t
=
rcu_dereference
(
rules
);
ret
=
slsm_serialize_subtree
(
&
buf
,
&
path_buf
,
t
);
rcu_read_unlock
();
mutex_lock
(
&
mutex
);
ret
=
slsm_serialize_subtree
(
&
buf
,
&
path_buf
,
rules
);
mutex_unlock
(
&
mutex
);
if
(
ret
)
return
ret
;
...
...
Write
Preview
Supports
Markdown
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