1
1
/*
2
- * syscall .c
2
+ * syscall_steal .c
3
3
*
4
4
* System call "stealing" sample.
5
5
*
@@ -61,7 +61,7 @@ module_param(sym, ulong, 0644);
61
61
62
62
#endif /* Version < v5.7 */
63
63
64
- static unsigned long * * sys_call_table ;
64
+ static unsigned long * * sys_call_table_stolen ;
65
65
66
66
/* UID we want to spy on - will be filled from the command line. */
67
67
static uid_t uid = -1 ;
@@ -206,18 +206,18 @@ static void disable_write_protection(void)
206
206
__write_cr0 (cr0 );
207
207
}
208
208
209
- static int __init syscall_start (void )
209
+ static int __init syscall_steal_start (void )
210
210
{
211
- if (!(sys_call_table = acquire_sys_call_table ()))
211
+ if (!(sys_call_table_stolen = acquire_sys_call_table ()))
212
212
return -1 ;
213
213
214
214
disable_write_protection ();
215
215
216
216
/* keep track of the original open function */
217
- original_call = (void * )sys_call_table [__NR_openat ];
217
+ original_call = (void * )sys_call_table_stolen [__NR_openat ];
218
218
219
219
/* use our openat function instead */
220
- sys_call_table [__NR_openat ] = (unsigned long * )our_sys_openat ;
220
+ sys_call_table_stolen [__NR_openat ] = (unsigned long * )our_sys_openat ;
221
221
222
222
enable_write_protection ();
223
223
@@ -226,27 +226,27 @@ static int __init syscall_start(void)
226
226
return 0 ;
227
227
}
228
228
229
- static void __exit syscall_end (void )
229
+ static void __exit syscall_steal_end (void )
230
230
{
231
- if (!sys_call_table )
231
+ if (!sys_call_table_stolen )
232
232
return ;
233
233
234
234
/* Return the system call back to normal */
235
- if (sys_call_table [__NR_openat ] != (unsigned long * )our_sys_openat ) {
235
+ if (sys_call_table_stolen [__NR_openat ] != (unsigned long * )our_sys_openat ) {
236
236
pr_alert ("Somebody else also played with the " );
237
237
pr_alert ("open system call\n" );
238
238
pr_alert ("The system may be left in " );
239
239
pr_alert ("an unstable state.\n" );
240
240
}
241
241
242
242
disable_write_protection ();
243
- sys_call_table [__NR_openat ] = (unsigned long * )original_call ;
243
+ sys_call_table_stolen [__NR_openat ] = (unsigned long * )original_call ;
244
244
enable_write_protection ();
245
245
246
246
msleep (2000 );
247
247
}
248
248
249
- module_init (syscall_start );
250
- module_exit (syscall_end );
249
+ module_init (syscall_steal_start );
250
+ module_exit (syscall_steal_end );
251
251
252
252
MODULE_LICENSE ("GPL" );
0 commit comments