diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2005-11-11 16:41:25 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2005-11-11 16:41:25 +0000 |
commit | 6485f21df442288ecd8d53e52d1c81c426b4e076 (patch) | |
tree | 9af4568c03da22cbce6504491e59a37c97c94014 /sys/kern/exec_elf.c | |
parent | f270d9b59bd21e7089f8e6844a38271c6f4cdcac (diff) |
Allow binaries to run if all sections are marked writable
(some unusual linux binaries), ok deraadt.
Diffstat (limited to 'sys/kern/exec_elf.c')
-rw-r--r-- | sys/kern/exec_elf.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/kern/exec_elf.c b/sys/kern/exec_elf.c index 281b1dc61c5..5304023bf5f 100644 --- a/sys/kern/exec_elf.c +++ b/sys/kern/exec_elf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_elf.c,v 1.49 2003/11/03 19:58:22 tedu Exp $ */ +/* $OpenBSD: exec_elf.c,v 1.50 2005/11/11 16:41:24 drahn Exp $ */ /* * Copyright (c) 1996 Per Fogelstrom @@ -710,6 +710,13 @@ native: } /* + * Strangely some linux programs may have all load sections marked + * writeable, in this case, textsize is not -1, but rather 0; + */ + if (epp->ep_tsize == ELFDEFNNAME(NO_ADDR)) + epp->ep_tsize = 0; + + /* * Check if we found a dynamically linked binary and arrange to load * it's interpreter when the exec file is released. */ |