Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1578907 > unrolled thread
| Started by | Jess Frazelle <me@jessfraz.com> |
|---|---|
| First post | 2017-02-11 02:40 +0100 |
| Last post | 2017-02-11 10:30 +0100 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v2 2/5] time: mark syscore_ops as __ro_after_init Jess Frazelle <me@jessfraz.com> - 2017-02-11 02:40 +0100
Re: [PATCH v2 2/5] time: mark syscore_ops as __ro_after_init John Stultz <john.stultz@linaro.org> - 2017-02-11 03:20 +0100
Re: [PATCH v2 2/5] time: mark syscore_ops as __ro_after_init Thomas Gleixner <tglx@linutronix.de> - 2017-02-11 10:30 +0100
| From | Jess Frazelle <me@jessfraz.com> |
|---|---|
| Date | 2017-02-11 02:40 +0100 |
| Subject | [PATCH v2 2/5] time: mark syscore_ops as __ro_after_init |
| Message-ID | <t9uPn-2IM-7@gated-at.bofh.it> |
Marked syscore_ops structs as __ro_after_init when register_syscore_ops was
called only during init. Most of the caller functions were already annotated as
__init.
unregister_syscore_ops() was never called on these ops.
This protects the data structure from accidental corruption.
Suggested-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Jess Frazelle <me@jessfraz.com>
Acked-by: Rik van Riel <riel@redhat.com>
---
kernel/time/sched_clock.c | 2 +-
kernel/time/timekeeping.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/time/sched_clock.c b/kernel/time/sched_clock.c
index a26036d37a38..5df2fc07300b 100644
--- a/kernel/time/sched_clock.c
+++ b/kernel/time/sched_clock.c
@@ -289,7 +289,7 @@ static void sched_clock_resume(void)
rd->read_sched_clock = cd.actual_read_sched_clock;
}
-static struct syscore_ops sched_clock_ops = {
+static struct syscore_ops sched_clock_ops __ro_after_init = {
.suspend = sched_clock_suspend,
.resume = sched_clock_resume,
};
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index db087d7e106d..467e3021723a 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1756,7 +1756,7 @@ int timekeeping_suspend(void)
}
/* sysfs resume/suspend bits for timekeeping */
-static struct syscore_ops timekeeping_syscore_ops = {
+static struct syscore_ops timekeeping_syscore_ops __ro_after_init = {
.resume = timekeeping_resume,
.suspend = timekeeping_suspend,
};
--
2.11.0
[toc] | [next] | [standalone]
| From | John Stultz <john.stultz@linaro.org> |
|---|---|
| Date | 2017-02-11 03:20 +0100 |
| Message-ID | <t9vs5-3b9-1@gated-at.bofh.it> |
| In reply to | #1578907 |
On Fri, Feb 10, 2017 at 5:37 PM, Jess Frazelle <me@jessfraz.com> wrote: > Marked syscore_ops structs as __ro_after_init when register_syscore_ops was > called only during init. Most of the caller functions were already annotated as > __init. > unregister_syscore_ops() was never called on these ops. > This protects the data structure from accidental corruption. > > Suggested-by: Kees Cook <keescook@chromium.org> > Signed-off-by: Jess Frazelle <me@jessfraz.com> > Acked-by: Rik van Riel <riel@redhat.com> Thanks for sending this out. Looks reasonable to me. I'll queue it for testing, targeting for 4.12. thanks -john
[toc] | [prev] | [next] | [standalone]
| From | Thomas Gleixner <tglx@linutronix.de> |
|---|---|
| Date | 2017-02-11 10:30 +0100 |
| Message-ID | <t9Cad-7mN-9@gated-at.bofh.it> |
| In reply to | #1578919 |
On Fri, 10 Feb 2017, John Stultz wrote: > On Fri, Feb 10, 2017 at 5:37 PM, Jess Frazelle <me@jessfraz.com> wrote: > > Marked syscore_ops structs as __ro_after_init when register_syscore_ops was > > called only during init. Most of the caller functions were already annotated as > > __init. > > unregister_syscore_ops() was never called on these ops. > > This protects the data structure from accidental corruption. > > > > Suggested-by: Kees Cook <keescook@chromium.org> > > Signed-off-by: Jess Frazelle <me@jessfraz.com> > > Acked-by: Rik van Riel <riel@redhat.com> > > Thanks for sending this out. Looks reasonable to me. I'll queue it for > testing, targeting for 4.12. NAK. See: http://lkml.kernel.org/r/alpine.DEB.2.20.1702110948030.3734@nanos Thanks, tglx
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web