@@ -134,16 +134,15 @@ static int faccessat_handler_pre(struct kprobe *p, struct pt_regs *regs)
134134
135135static int newfstatat_handler_pre (struct kprobe * p , struct pt_regs * regs )
136136{
137- // static int vfs_statx(int dfd, const char __user *filename, int flags,struct kstat *stat, u32 request_mask)
138137 int * dfd = (int * )& PT_REGS_PARM1 (regs );
139138 const char __user * * filename_user = (const char * * )& PT_REGS_PARM2 (regs );
140- #if LINUX_VERSION_CODE >= KERNEL_VERSION (4 , 14 , 0 )
139+ #if LINUX_VERSION_CODE >= KERNEL_VERSION (4 , 11 , 0 )
140+ // static int vfs_statx(int dfd, const char __user *filename, int flags, struct kstat *stat, u32 request_mask)
141141 int * flags = (int * )& PT_REGS_PARM3 (regs );
142142#else
143143// int vfs_fstatat(int dfd, const char __user *filename, struct kstat *stat,int flag)
144144 int * flags = (int * )& PT_REGS_PARM4 (regs );
145145#endif
146-
147146
148147 return ksu_handle_stat (dfd , filename_user , flags );
149148}
@@ -172,25 +171,20 @@ static struct kprobe faccessat_kp = {
172171};
173172
174173static struct kprobe newfstatat_kp = {
175- #if LINUX_VERSION_CODE >= KERNEL_VERSION (4 , 14 , 0 )
174+ #if LINUX_VERSION_CODE >= KERNEL_VERSION (4 , 11 , 0 )
176175 .symbol_name = "vfs_statx" ,
177176#else
178- .symbol_name = "vfs_fstatat" ,
177+ .symbol_name = "vfs_fstatat" ,
179178#endif
180179 .pre_handler = newfstatat_handler_pre ,
181180};
182181
183182static struct kprobe execve_kp = {
184183#if LINUX_VERSION_CODE >= KERNEL_VERSION (5 , 9 , 0 )
185184 .symbol_name = "do_execveat_common" ,
186- #elif LINUX_VERSION_CODE >= KERNEL_VERSION (4 , 19 , 0 ) && \
187- LINUX_VERSION_CODE < KERNEL_VERSION (5 , 9 , 0 )
185+ #elif LINUX_VERSION_CODE >= KERNEL_VERSION (4 , 19 , 0 )
188186 .symbol_name = "__do_execve_file" ,
189- #elif LINUX_VERSION_CODE >= KERNEL_VERSION (4 , 14 , 0 ) && \
190- LINUX_VERSION_CODE < KERNEL_VERSION (4 , 19 , 0 )
191- .symbol_name = "do_execveat_common" ,
192- #elif LINUX_VERSION_CODE >= KERNEL_VERSION (4 , 4 , 0 ) && \
193- LINUX_VERSION_CODE < KERNEL_VERSION (4 , 14 , 0 )
187+ #elif LINUX_VERSION_CODE >= KERNEL_VERSION (3 , 19 , 0 )
194188 .symbol_name = "do_execveat_common" ,
195189#endif
196190 .pre_handler = execve_handler_pre ,
0 commit comments