Skip to content

Commit b694700

Browse files
committed
Fix potential integer overflow for last frame on IRQ/WQ context
1 parent eee71c9 commit b694700

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/modules/exploit_detection/p_exploit_detection.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1515,7 +1515,7 @@ static inline int p_is_obj_on_stack(struct task_struct *p_task, const void *p_ad
15151515

15161516
void *p_stack = p_task->stack; //task_stack_page(p_task);
15171517

1518-
return (p_addr >= p_stack) && (p_addr + p_size < (p_stack + THREAD_SIZE));
1518+
return (p_addr >= p_stack) && ((unsigned long)p_addr < P_KERNEL_LAST_UNUSED_HOLE) && (p_addr + p_size < (p_stack + THREAD_SIZE));
15191519
}
15201520

15211521
int p_ed_enforce_pcfi(struct task_struct *p_task, struct p_ed_process *p_orig, struct pt_regs *p_regs) {

src/modules/exploit_detection/p_exploit_detection.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#ifndef P_EXPLOIT_DETECTION_MAIN_H
1919
#define P_EXPLOIT_DETECTION_MAIN_H
2020

21+
#define P_KERNEL_LAST_UNUSED_HOLE 0xffffffffffe00000
22+
2123
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0) && defined(CONFIG_ARCH_HAS_SYSCALL_WRAPPER)
2224

2325
/*

0 commit comments

Comments
 (0)