Module Name:    src
Committed By:   snj
Date:           Sat Aug 12 04:17:37 UTC 2017

Modified Files:
        src/sys/rump/kern/lib/libsys_sunos [netbsd-7-1]: rump_sunos_compat.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1479):
        sys/compat/common/vfs_syscalls_12.c: revision 1.34
        sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c: revision 1.2
        sys/compat/svr4_32/svr4_32_misc.c: revision 1.78
        sys/compat/sunos32/sunos32_misc.c: revision 1.78
        sys/compat/linux/common/linux_misc.c: revision 1.239
        sys/compat/osf1/osf1_file.c: revision 1.44
        sys/compat/common/vfs_syscalls_43.c: revision 1.60
        sys/compat/svr4/svr4_misc.c: revision 1.158
        sys/compat/ibcs2/ibcs2_misc.c: revision 1.114
        sys/compat/linux/common/linux_file64.c: revision 1.59
        sys/compat/linux32/common/linux32_dirent.c: revision 1.18
        sys/compat/sunos/sunos_misc.c: revision 1.171
Fail, don't panic, on bad dirents from file system.
Controllable via puffs from userland.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.26.1 \
    src/sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.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/rump/kern/lib/libsys_sunos/rump_sunos_compat.c
diff -u src/sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c:1.1 src/sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c:1.1.26.1
--- src/sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c:1.1	Tue Apr  9 13:08:33 2013
+++ src/sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c	Sat Aug 12 04:17:37 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump_sunos_compat.c,v 1.1 2013/04/09 13:08:33 pooka Exp $	*/
+/*	$NetBSD: rump_sunos_compat.c,v 1.1.26.1 2017/08/12 04:17:37 snj Exp $	*/
 
 /*
  * Copyright (c) 2013 Antti Kantee.  All Rights Reserved.
@@ -313,8 +313,10 @@ again:
 	for (cookie = cookiebuf; len > 0; len -= reclen) {
 		bdp = (struct dirent *)inp;
 		reclen = bdp->d_reclen;
-		if (reclen & 3)
-			panic("sunos_getdents");
+		if (reclen & 3) {
+			error = EIO;
+			goto out;
+		}
 		if ((*cookie >> 32) != 0) {
 			printf("rump_sunos_sys_getdents: offset too large\n");
 			error = EINVAL;

Reply via email to