Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
linux
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tomeu Vizoso
linux
Commits
d13f5d84
Commit
d13f5d84
authored
7 years ago
by
Jiri Kosina
Browse files
Options
Downloads
Plain Diff
Merge branch 'for-4.16/signal-sysfs-force-v2' into for-next
parents
d0807da7
8869016d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kernel/livepatch/core.c
+28
-24
28 additions, 24 deletions
kernel/livepatch/core.c
with
28 additions
and
24 deletions
kernel/livepatch/core.c
+
28
−
24
View file @
d13f5d84
...
@@ -532,22 +532,24 @@ static ssize_t signal_store(struct kobject *kobj, struct kobj_attribute *attr,
...
@@ -532,22 +532,24 @@ static ssize_t signal_store(struct kobject *kobj, struct kobj_attribute *attr,
int
ret
;
int
ret
;
bool
val
;
bool
val
;
patch
=
container_of
(
kobj
,
struct
klp_patch
,
kobj
);
/*
* klp_mutex lock is not grabbed here intentionally. It is not really
* needed. The race window is harmless and grabbing the lock would only
* hold the action back.
*/
if
(
patch
!=
klp_transition_patch
)
return
-
EINVAL
;
ret
=
kstrtobool
(
buf
,
&
val
);
ret
=
kstrtobool
(
buf
,
&
val
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
if
(
val
)
if
(
!
val
)
klp_send_signals
();
return
count
;
mutex_lock
(
&
klp_mutex
);
patch
=
container_of
(
kobj
,
struct
klp_patch
,
kobj
);
if
(
patch
!=
klp_transition_patch
)
{
mutex_unlock
(
&
klp_mutex
);
return
-
EINVAL
;
}
klp_send_signals
();
mutex_unlock
(
&
klp_mutex
);
return
count
;
return
count
;
}
}
...
@@ -559,22 +561,24 @@ static ssize_t force_store(struct kobject *kobj, struct kobj_attribute *attr,
...
@@ -559,22 +561,24 @@ static ssize_t force_store(struct kobject *kobj, struct kobj_attribute *attr,
int
ret
;
int
ret
;
bool
val
;
bool
val
;
patch
=
container_of
(
kobj
,
struct
klp_patch
,
kobj
);
/*
* klp_mutex lock is not grabbed here intentionally. It is not really
* needed. The race window is harmless and grabbing the lock would only
* hold the action back.
*/
if
(
patch
!=
klp_transition_patch
)
return
-
EINVAL
;
ret
=
kstrtobool
(
buf
,
&
val
);
ret
=
kstrtobool
(
buf
,
&
val
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
if
(
val
)
if
(
!
val
)
klp_force_transition
();
return
count
;
mutex_lock
(
&
klp_mutex
);
patch
=
container_of
(
kobj
,
struct
klp_patch
,
kobj
);
if
(
patch
!=
klp_transition_patch
)
{
mutex_unlock
(
&
klp_mutex
);
return
-
EINVAL
;
}
klp_force_transition
();
mutex_unlock
(
&
klp_mutex
);
return
count
;
return
count
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment