patch-2.1.99 linux/fs/binfmt_elf.c

Next file: linux/fs/dcache.c
Previous file: linux/drivers/scsi/sg.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.98/linux/fs/binfmt_elf.c linux/fs/binfmt_elf.c
@@ -517,9 +517,10 @@
 			retval = PTR_ERR(interpreter_dentry);
 			if (IS_ERR(interpreter_dentry))
 				goto out_free_interp;
-
-			retval = read_exec(interpreter_dentry, 0, bprm->buf, 
-						128, 1);
+			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);
 			if (retval < 0)
 				goto out_free_dentry;
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov