11/*
2- * syscall .c
2+ * syscall_steal .c
33 *
44 * System call "stealing" sample.
55 *
@@ -61,7 +61,7 @@ module_param(sym, ulong, 0644);
6161
6262#endif /* Version < v5.7 */
6363
64- static unsigned long * * sys_call_table ;
64+ static unsigned long * * sys_call_table_stolen ;
6565
6666/* UID we want to spy on - will be filled from the command line. */
6767static uid_t uid = -1 ;
@@ -206,18 +206,18 @@ static void disable_write_protection(void)
206206 __write_cr0 (cr0 );
207207}
208208
209- static int __init syscall_start (void )
209+ static int __init syscall_steal_start (void )
210210{
211- if (!(sys_call_table = acquire_sys_call_table ()))
211+ if (!(sys_call_table_stolen = acquire_sys_call_table ()))
212212 return -1 ;
213213
214214 disable_write_protection ();
215215
216216 /* 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 ];
218218
219219 /* 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 ;
221221
222222 enable_write_protection ();
223223
@@ -226,27 +226,27 @@ static int __init syscall_start(void)
226226 return 0 ;
227227}
228228
229- static void __exit syscall_end (void )
229+ static void __exit syscall_steal_end (void )
230230{
231- if (!sys_call_table )
231+ if (!sys_call_table_stolen )
232232 return ;
233233
234234 /* 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 ) {
236236 pr_alert ("Somebody else also played with the " );
237237 pr_alert ("open system call\n" );
238238 pr_alert ("The system may be left in " );
239239 pr_alert ("an unstable state.\n" );
240240 }
241241
242242 disable_write_protection ();
243- sys_call_table [__NR_openat ] = (unsigned long * )original_call ;
243+ sys_call_table_stolen [__NR_openat ] = (unsigned long * )original_call ;
244244 enable_write_protection ();
245245
246246 msleep (2000 );
247247}
248248
249- module_init (syscall_start );
250- module_exit (syscall_end );
249+ module_init (syscall_steal_start );
250+ module_exit (syscall_steal_end );
251251
252252MODULE_LICENSE ("GPL" );
0 commit comments