Source-Changes-HG archive

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

[src/netbsd-6-0]: src/sys/kern Pull up following revision(s) (requested by mr...



details:   https://anonhg.NetBSD.org/src/rev/cbccf25b66ac
branches:  netbsd-6-0
changeset: 775246:cbccf25b66ac
user:      snj <snj%NetBSD.org@localhost>
date:      Sat Aug 19 04:17:08 2017 +0000

description:
Pull up following revision(s) (requested by mrg in ticket #1482):
        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 1b96dacf2fc7 -r cbccf25b66ac sys/kern/vfs_getcwd.c
--- a/sys/kern/vfs_getcwd.c     Sat Aug 19 04:13:48 2017 +0000
+++ b/sys/kern/vfs_getcwd.c     Sat Aug 19 04:17:08 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_getcwd.c,v 1.47 2010/11/30 10:30:02 dholland Exp $ */
+/* $NetBSD: vfs_getcwd.c,v 1.47.20.1 2017/08/19 04:17:08 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.47 2010/11/30 10:30:02 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_getcwd.c,v 1.47.20.1 2017/08/19 04:17:08 snj Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -207,7 +207,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