| #include <linux/mm_types.h> |
| #include <linux/binfmts.h> |
| static int load_binary(struct linux_binprm *bprm, struct pt_regs *regs) |
| struct exec *eh = (struct exec *)bprm->buf; |
| if (eh->fh.f_magic != 0x183 || (eh->fh.f_flags & 0x3000) != 0x3000) |
| allow_write_access(bprm->file); |
| loader = bprm->vma->vm_end - sizeof(void *); |
| file = open_exec("/sbin/loader"); |
| /* Remember if the application is TASO. */ |
| bprm->taso = eh->ah.entry < 0x100000000UL; |
| retval = prepare_binprm(bprm); |
| return search_binary_handler(bprm,regs); |
| static struct linux_binfmt loader_format = { |
| .load_binary = load_binary, |
| static int __init init_loader_binfmt(void) |
| return insert_binfmt(&loader_format); |
| arch_initcall(init_loader_binfmt); |