diff options
-rw-r--r-- | sys/compat/linux/linux_exec.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/compat/linux/linux_exec.c b/sys/compat/linux/linux_exec.c index a5cb81d7c31..745ae181a38 100644 --- a/sys/compat/linux/linux_exec.c +++ b/sys/compat/linux/linux_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: linux_exec.c,v 1.28 2008/06/12 04:32:59 miod Exp $ */ +/* $OpenBSD: linux_exec.c,v 1.29 2008/06/12 22:04:55 miod Exp $ */ /* $NetBSD: linux_exec.c,v 1.13 1996/04/05 00:01:10 christos Exp $ */ /*- @@ -494,7 +494,16 @@ linux_elf_probe(p, epp, itp, pos, os) } brand = elf32_check_brand(eh); - if (brand == NULL || strcmp(brand, "Linux") != 0) + if (brand != NULL && strcmp(brand, "Linux") != 0) + return (EINVAL); + + /* + * If this is a static binary, do not allow it to run, as it + * has not been identified. We'll give non-static binaries a + * chance to run, as the Linux ld.so name is usually unique + * enough to clear any amibiguity. + */ + if (itp == NULL) return (EINVAL); recognized: |