Module Name: src Committed By: maxv Date: Thu Oct 30 16:45:28 UTC 2014
Modified Files: src/sys/compat/linux/common: linux_uselib.c Log Message: Reject non-regular files. Patch from njoly@. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/sys/compat/linux/common/linux_uselib.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/compat/linux/common/linux_uselib.c diff -u src/sys/compat/linux/common/linux_uselib.c:1.31 src/sys/compat/linux/common/linux_uselib.c:1.32 --- src/sys/compat/linux/common/linux_uselib.c:1.31 Sun Oct 19 17:33:58 2014 +++ src/sys/compat/linux/common/linux_uselib.c Thu Oct 30 16:45:28 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_uselib.c,v 1.31 2014/10/19 17:33:58 maxv Exp $ */ +/* $NetBSD: linux_uselib.c,v 1.32 2014/10/30 16:45:28 maxv Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_uselib.c,v 1.31 2014/10/19 17:33:58 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_uselib.c,v 1.32 2014/10/30 16:45:28 maxv Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -100,6 +100,11 @@ linux_sys_uselib(struct lwp *l, const st if (error != 0) return error; + if (vp->v_type != VREG) { + error = EINVAL; + goto out; + } + if ((error = vn_rdwr(UIO_READ, vp, (void *) &hdr, LINUX_AOUT_HDR_SIZE, 0, UIO_SYSSPACE, IO_NODELOCKED, l->l_cred, &rem, NULL))) {