Source-Changes-HG archive

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

[src/trunk]: src/sys/fs/cd9660 Fix info leak: zero out the buffer, because it...



details:   https://anonhg.NetBSD.org/src/rev/706c3c268a3e
branches:  trunk
changeset: 452534:706c3c268a3e
user:      maxv <maxv%NetBSD.org@localhost>
date:      Fri Jul 12 17:18:30 2019 +0000

description:
Fix info leak: zero out the buffer, because it is not entirely filled, and
the uninitialized bytes get copied to userland in sys___getdens30(). Remove
unneeded cast while here.

diffstat:

 sys/fs/cd9660/cd9660_vnops.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 8627c9ab27a5 -r 706c3c268a3e sys/fs/cd9660/cd9660_vnops.c
--- a/sys/fs/cd9660/cd9660_vnops.c      Fri Jul 12 10:39:12 2019 +0000
+++ b/sys/fs/cd9660/cd9660_vnops.c      Fri Jul 12 17:18:30 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cd9660_vnops.c,v 1.54 2016/03/12 02:36:25 christos Exp $       */
+/*     $NetBSD: cd9660_vnops.c,v 1.55 2019/07/12 17:18:30 maxv Exp $   */
 
 /*-
  * Copyright (c) 1994
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cd9660_vnops.c,v 1.54 2016/03/12 02:36:25 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd9660_vnops.c,v 1.55 2019/07/12 17:18:30 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -399,7 +399,7 @@
        imp = dp->i_mnt;
        bmask = imp->im_bmask;
 
-       idp = (struct isoreaddir *)malloc(sizeof(*idp), M_TEMP, M_WAITOK);
+       idp = malloc(sizeof(*idp), M_TEMP, M_WAITOK | M_ZERO);
        idp->saveent.d_namlen = idp->assocent.d_namlen = 0;
        /*
         * XXX



Home | Main Index | Thread Index | Old Index