Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/sys/kern Pull up following revision(s) (requested by spz ...



details:   https://anonhg.NetBSD.org/src/rev/f5cfe7d69ffb
branches:  netbsd-8
changeset: 850918:f5cfe7d69ffb
user:      snj <snj%NetBSD.org@localhost>
date:      Wed Aug 09 05:09:47 2017 +0000

description:
Pull up following revision(s) (requested by spz in ticket #192):
        sys/kern/vfs_getcwd.c: revision 1.52
Don't walk off the end of the dirent buffer.
>From Ilja Van Sprundel.

diffstat:

 sys/kern/vfs_getcwd.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 045e993d6554 -r f5cfe7d69ffb sys/kern/vfs_getcwd.c
--- a/sys/kern/vfs_getcwd.c     Tue Aug 08 16:24:03 2017 +0000
+++ b/sys/kern/vfs_getcwd.c     Wed Aug 09 05:09:47 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_getcwd.c,v 1.51 2017/06/01 02:45:13 chs Exp $ */
+/* $NetBSD: vfs_getcwd.c,v 1.51.2.1 2017/08/09 05:09:47 snj Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_getcwd.c,v 1.51 2017/06/01 02:45:13 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_getcwd.c,v 1.51.2.1 2017/08/09 05:09:47 snj Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -211,7 +211,8 @@
                                reclen = dp->d_reclen;
 
                                /* check for malformed directory.. */
-                               if (reclen < _DIRENT_MINSIZE(dp)) {
+                               if (reclen < _DIRENT_MINSIZE(dp) ||
+                                   reclen > len) {
                                        error = EINVAL;
                                        goto out;
                                }



Home | Main Index | Thread Index | Old Index