Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- edit file
- usr/src/linux/kernel/fork.c
- add the following.
- int disfork=0;
- SYSCALL_DEFINE0(nofork){
- printk("ForkaDISABLEDaCAlled");
- return disfork = (disfork==0)? 1 : 0;
- }
- long do_fork(unsigned long clone_flags,
- unsigned long stack_start,
- struct pt_regs *regs,
- unsigned long stack_size,
- int __user *parent_tidptr,
- int __user *child_tidptr)
- {
- struct task_struct *p;
- int trace = 0;
- long nr;
- if ( disfork) return -EPERM;
- --------
- then goto that syscall file and at 283 just like in the other lab make it ref nofork instead.
- --c program does library call
- #include <unistd.h>
- #include <stdio.h>
- #include <sys/syscall.h>
- #define NOFORK 283
- int main(int argc, char **argv){
- syscall(NOFORK);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement