projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't allow zero length files to be exec'd (causes a panic after it is
[unix-history]
/
sys
/
kern
/
kern_execve.c
diff --git
a/sys/kern/kern_execve.c
b/sys/kern/kern_execve.c
index
5fbdeb6
..
1d712e2
100644
(file)
--- a/
sys/kern/kern_execve.c
+++ b/
sys/kern/kern_execve.c
@@
-28,7
+28,7
@@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kern_execve.c,v 1.1
2 1993/12/20 19:31:17 wollman
Exp $
+ * $Id: kern_execve.c,v 1.1
3 1994/01/03 07:56:43 davidg
Exp $
*/
#include "param.h"
*/
#include "param.h"
@@
-498,6
+498,12
@@
exec_check_permissions(iparams)
return (EACCES);
}
return (EACCES);
}
+ /*
+ * Zero length files can't be exec'd
+ */
+ if (attr->va_size == 0)
+ return (ENOEXEC);
+
/*
* Disable setuid/setgid if the filesystem prohibits it or if
* the process is being traced.
/*
* Disable setuid/setgid if the filesystem prohibits it or if
* the process is being traced.