diff options
author | Kees Cook <keescook@chromium.org> | 2016-06-29 11:10:36 -0400 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2016-07-07 14:09:26 -0400 |
commit | f2c6edc1ed0674b196080cfc3f66bc130e4d7c18 (patch) | |
tree | 48af44b82e9d48c23d34a862a8aa270a2340eb55 | |
parent | d87c978830674f388d910c2691069a4d2219f382 (diff) |
lkdtm: move jprobe entry points to start of source
In preparation of referencing the jprobe entry points in a structure,
this moves them to the start of the source since they operate mostly
separately from everything else.
Signed-off-by: Kees Cook <keescook@chromium.org>
-rw-r--r-- | drivers/misc/lkdtm_core.c | 129 |
1 files changed, 65 insertions, 64 deletions
diff --git a/drivers/misc/lkdtm_core.c b/drivers/misc/lkdtm_core.c index ff28bd03a9e8..8b90220216e2 100644 --- a/drivers/misc/lkdtm_core.c +++ b/drivers/misc/lkdtm_core.c | |||
@@ -56,6 +56,71 @@ | |||
56 | static int lkdtm_parse_commandline(void); | 56 | static int lkdtm_parse_commandline(void); |
57 | static void lkdtm_handler(void); | 57 | static void lkdtm_handler(void); |
58 | 58 | ||
59 | /* jprobe entry point handlers. */ | ||
60 | static unsigned int jp_do_irq(unsigned int irq) | ||
61 | { | ||
62 | lkdtm_handler(); | ||
63 | jprobe_return(); | ||
64 | return 0; | ||
65 | } | ||
66 | |||
67 | static irqreturn_t jp_handle_irq_event(unsigned int irq, | ||
68 | struct irqaction *action) | ||
69 | { | ||
70 | lkdtm_handler(); | ||
71 | jprobe_return(); | ||
72 | return 0; | ||
73 | } | ||
74 | |||
75 | static void jp_tasklet_action(struct softirq_action *a) | ||
76 | { | ||
77 | lkdtm_handler(); | ||
78 | jprobe_return(); | ||
79 | } | ||
80 | |||
81 | static void jp_ll_rw_block(int rw, int nr, struct buffer_head *bhs[]) | ||
82 | { | ||
83 | lkdtm_handler(); | ||
84 | jprobe_return(); | ||
85 | } | ||
86 | |||
87 | struct scan_control; | ||
88 | |||
89 | static unsigned long jp_shrink_inactive_list(unsigned long max_scan, | ||
90 | struct zone *zone, | ||
91 | struct scan_control *sc) | ||
92 | { | ||
93 | lkdtm_handler(); | ||
94 | jprobe_return(); | ||
95 | return 0; | ||
96 | } | ||
97 | |||
98 | static int jp_hrtimer_start(struct hrtimer *timer, ktime_t tim, | ||
99 | const enum hrtimer_mode mode) | ||
100 | { | ||
101 | lkdtm_handler(); | ||
102 | jprobe_return(); | ||
103 | return 0; | ||
104 | } | ||
105 | |||
106 | static int jp_scsi_dispatch_cmd(struct scsi_cmnd *cmd) | ||
107 | { | ||
108 | lkdtm_handler(); | ||
109 | jprobe_return(); | ||
110 | return 0; | ||
111 | } | ||
112 | |||
113 | #ifdef CONFIG_IDE | ||
114 | static int jp_generic_ide_ioctl(ide_drive_t *drive, struct file *file, | ||
115 | struct block_device *bdev, unsigned int cmd, | ||
116 | unsigned long arg) | ||
117 | { | ||
118 | lkdtm_handler(); | ||
119 | jprobe_return(); | ||
120 | return 0; | ||
121 | } | ||
122 | #endif | ||
123 | |||
59 | enum cname { | 124 | enum cname { |
60 | CN_INVALID, | 125 | CN_INVALID, |
61 | CN_INT_HARDWARE_ENTRY, | 126 | CN_INT_HARDWARE_ENTRY, |
@@ -192,70 +257,6 @@ module_param(cpoint_count, int, 0644); | |||
192 | MODULE_PARM_DESC(cpoint_count, " Crash Point Count, number of times the "\ | 257 | MODULE_PARM_DESC(cpoint_count, " Crash Point Count, number of times the "\ |
193 | "crash point is to be hit to trigger action"); | 258 | "crash point is to be hit to trigger action"); |
194 | 259 | ||
195 | static unsigned int jp_do_irq(unsigned int irq) | ||
196 | { | ||
197 | lkdtm_handler(); | ||
198 | jprobe_return(); | ||
199 | return 0; | ||
200 | } | ||
201 | |||
202 | static irqreturn_t jp_handle_irq_event(unsigned int irq, | ||
203 | struct irqaction *action) | ||
204 | { | ||
205 | lkdtm_handler(); | ||
206 | jprobe_return(); | ||
207 | return 0; | ||
208 | } | ||
209 | |||
210 | static void jp_tasklet_action(struct softirq_action *a) | ||
211 | { | ||
212 | lkdtm_handler(); | ||
213 | jprobe_return(); | ||
214 | } | ||
215 | |||
216 | static void jp_ll_rw_block(int rw, int nr, struct buffer_head *bhs[]) | ||
217 | { | ||
218 | lkdtm_handler(); | ||
219 | jprobe_return(); | ||
220 | } | ||
221 | |||
222 | struct scan_control; | ||
223 | |||
224 | static unsigned long jp_shrink_inactive_list(unsigned long max_scan, | ||
225 | struct zone *zone, | ||
226 | struct scan_control *sc) | ||
227 | { | ||
228 | lkdtm_handler(); | ||
229 | jprobe_return(); | ||
230 | return 0; | ||
231 | } | ||
232 | |||
233 | static int jp_hrtimer_start(struct hrtimer *timer, ktime_t tim, | ||
234 | const enum hrtimer_mode mode) | ||
235 | { | ||
236 | lkdtm_handler(); | ||
237 | jprobe_return(); | ||
238 | return 0; | ||
239 | } | ||
240 | |||
241 | static int jp_scsi_dispatch_cmd(struct scsi_cmnd *cmd) | ||
242 | { | ||
243 | lkdtm_handler(); | ||
244 | jprobe_return(); | ||
245 | return 0; | ||
246 | } | ||
247 | |||
248 | #ifdef CONFIG_IDE | ||
249 | static int jp_generic_ide_ioctl(ide_drive_t *drive, struct file *file, | ||
250 | struct block_device *bdev, unsigned int cmd, | ||
251 | unsigned long arg) | ||
252 | { | ||
253 | lkdtm_handler(); | ||
254 | jprobe_return(); | ||
255 | return 0; | ||
256 | } | ||
257 | #endif | ||
258 | |||
259 | /* Return the crashpoint number or NONE if the name is invalid */ | 260 | /* Return the crashpoint number or NONE if the name is invalid */ |
260 | static enum ctype parse_cp_type(const char *what, size_t count) | 261 | static enum ctype parse_cp_type(const char *what, size_t count) |
261 | { | 262 | { |