diff -u --recursive linux/CREDITS linux~/CREDITS --- linux/CREDITS Tue Aug 1 12:04:31 2000 +++ linux~/CREDITS Tue Aug 1 11:45:16 2000 @@ -1226,6 +1226,12 @@ S: University of Stuttgart, Germany and S: Ecole Nationale Superieure des Telecommunications, Paris +N: Robert M. Love +E: rml@tech9.net +E: rml@ufl.edu +D: misc. kernel hacking and debugging +S: FL, USA + N: Martin von Löwis E: loewis@informatik.hu-berlin.de D: script binary format diff -u --recursive linux/fs/binfmt_elf.c linux~/fs/binfmt_elf.c --- linux/fs/binfmt_elf.c Wed Jun 7 17:26:43 2000 +++ linux~/fs/binfmt_elf.c Tue Aug 1 11:49:50 2000 @@ -542,7 +542,7 @@ retval = permission(interpreter_dentry->d_inode, MAY_EXEC); if (retval < 0) goto out_free_dentry; - retval = read_exec(interpreter_dentry, 0, bprm->buf, 128, 1); + retval = read_exec(interpreter_dentry, 0, bprm->buf, BINPRM_BUF_SIZE, 1); if (retval < 0) goto out_free_dentry; diff -u --recursive linux/fs/binfmt_misc.c linux~/fs/binfmt_misc.c --- linux/fs/binfmt_misc.c Sat Jan 2 20:55:06 1999 +++ linux~/fs/binfmt_misc.c Tue Aug 1 11:52:20 2000 @@ -185,7 +185,7 @@ { struct binfmt_entry *fmt; struct dentry * dentry; - char iname[128]; + char iname[BINPRM_BUF_SIZE]; char *iname_addr = iname; int retval; @@ -198,8 +198,8 @@ read_lock(&entries_lock); fmt = check_file(bprm); if (fmt) { - strncpy(iname, fmt->interpreter, 127); - iname[127] = '\0'; + strncpy(iname, fmt->interpreter, BINPRM_BUF_SIZE - 1); + iname[BINPRM_BUF_SIZE - 1] = '\0'; } read_unlock(&entries_lock); if (!fmt) @@ -329,7 +329,7 @@ /* more sanity checks */ if (err || !(!cnt || (!(--cnt) && (*sp == '\n'))) || - (e->size < 1) || ((e->size + e->offset) > 127) || + (e->size < 1) || ((e->size + e->offset) > (BINPRM_BUF_SIZE - 1)) || !(e->proc_name) || !(e->interpreter) || entry_proc_setup(e)) goto free_err; diff -u --recursive linux/fs/binfmt_script.c linux~/fs/binfmt_script.c --- linux/fs/binfmt_script.c Thu Aug 20 17:32:48 1998 +++ linux~/fs/binfmt_script.c Tue Aug 1 11:55:46 2000 @@ -16,7 +16,7 @@ { char *cp, *i_name, *i_name_start, *i_arg; struct dentry * dentry; - char interp[128]; + char interp[BINPRM_BUF_SIZE]; int retval; if ((bprm->buf[0] != '#') || (bprm->buf[1] != '!') || (bprm->sh_bang)) @@ -30,9 +30,9 @@ dput(bprm->dentry); bprm->dentry = NULL; - bprm->buf[127] = '\0'; + bprm->buf[BINPRM_BUF_SIZE - 1] = '\0'; if ((cp = strchr(bprm->buf, '\n')) == NULL) - cp = bprm->buf+127; + cp = bprm->buf+BINPRM_BUF_SIZE-1; *cp = '\0'; while (cp > bprm->buf) { cp--; diff -u --recursive linux/fs/exec.c linux~/fs/exec.c --- linux/fs/exec.c Wed Jun 7 17:26:43 2000 +++ linux~/fs/exec.c Tue Aug 1 11:56:36 2000 @@ -561,7 +561,7 @@ /* * Fill the binprm structure from the inode. - * Check permissions, then read the first 512 bytes + * Check permissions, then read the first 128 (BINPRM_BUF_SIZE) bytes */ int prepare_binprm(struct linux_binprm *bprm) { @@ -663,7 +663,7 @@ } memset(bprm->buf,0,sizeof(bprm->buf)); - return read_exec(bprm->dentry,0,bprm->buf,128,1); + return read_exec(bprm->dentry,0,bprm->buf,BINPRM_BUF_SIZE,1); } /* @@ -824,14 +824,14 @@ int retval; int i; - bprm.p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *); - for (i=0 ; ibuf) */ +#define BINPRM_BUF_SIZE 128 + #ifdef __KERNEL__ /* * This structure is used to hold the arguments that are used when loading binaries. */ struct linux_binprm{ - char buf[128]; + char buf[BINPRM_BUF_SIZE]; unsigned long page[MAX_ARG_PAGES]; unsigned long p; int sh_bang;