diff options
| author | Nam Cao <namcao@linutronix.de> | 2025-02-05 11:55:16 +0100 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2025-04-05 10:30:17 +0200 |
| commit | 04257da0c99c9d4ff7c5bb93046482e1f7d34938 (patch) | |
| tree | 56524fad9153f790e1b8e6d8434233795ed573d1 /include/trace | |
| parent | hrtimers: Merge __hrtimer_init() into __hrtimer_setup() (diff) | |
| download | linux-04257da0c99c9d4ff7c5bb93046482e1f7d34938.tar.gz linux-04257da0c99c9d4ff7c5bb93046482e1f7d34938.zip | |
hrtimers: Make callback function pointer private
Make the struct hrtimer::function field private, to prevent users from
changing this field in an unsafe way. hrtimer_update_function() should be
used if the callback function needs to be changed.
Signed-off-by: Nam Cao <namcao@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/all/7d0e6e0c5c59a64a9bea940051aac05d750bc0c2.1738746927.git.namcao@linutronix.de
Diffstat (limited to 'include/trace')
| -rw-r--r-- | include/trace/events/timer.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/trace/events/timer.h b/include/trace/events/timer.h index 1ef58a04fc57..f8c906be4cd0 100644 --- a/include/trace/events/timer.h +++ b/include/trace/events/timer.h @@ -235,7 +235,7 @@ TRACE_EVENT(hrtimer_start, TP_fast_assign( __entry->hrtimer = hrtimer; - __entry->function = hrtimer->function; + __entry->function = ACCESS_PRIVATE(hrtimer, function); __entry->expires = hrtimer_get_expires(hrtimer); __entry->softexpires = hrtimer_get_softexpires(hrtimer); __entry->mode = mode; @@ -271,7 +271,7 @@ TRACE_EVENT(hrtimer_expire_entry, TP_fast_assign( __entry->hrtimer = hrtimer; __entry->now = *now; - __entry->function = hrtimer->function; + __entry->function = ACCESS_PRIVATE(hrtimer, function); ), TP_printk("hrtimer=%p function=%ps now=%llu", |
