Source-Changes-HG archive

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

[src/trunk]: src/sys/fs/tmpfs Remove the roundups, they are incorrect and cau...



details:   https://anonhg.NetBSD.org/src/rev/a63711d7af22
branches:  trunk
changeset: 461868:a63711d7af22
user:      maxv <maxv%NetBSD.org@localhost>
date:      Sat Jul 13 14:24:37 2019 +0000

description:
Remove the roundups, they are incorrect and cause memcmp to wrongfully fail
because of uninitialized bytes at the end of the buffers.

ok rmind@

diffstat:

 sys/fs/tmpfs/tmpfs_mem.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r 9aabd0ef8db7 -r a63711d7af22 sys/fs/tmpfs/tmpfs_mem.c
--- a/sys/fs/tmpfs/tmpfs_mem.c  Sat Jul 13 12:44:02 2019 +0000
+++ b/sys/fs/tmpfs/tmpfs_mem.c  Sat Jul 13 14:24:37 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tmpfs_mem.c,v 1.9 2016/08/22 23:07:36 skrll Exp $      */
+/*     $NetBSD: tmpfs_mem.c,v 1.10 2019/07/13 14:24:37 maxv Exp $      */
 
 /*
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_mem.c,v 1.9 2016/08/22 23:07:36 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_mem.c,v 1.10 2019/07/13 14:24:37 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -234,8 +234,8 @@
 bool
 tmpfs_strname_neqlen(struct componentname *fcnp, struct componentname *tcnp)
 {
-       const size_t fln = roundup2(fcnp->cn_namelen, TMPFS_NAME_QUANTUM);
-       const size_t tln = roundup2(tcnp->cn_namelen, TMPFS_NAME_QUANTUM);
+       const size_t fln = fcnp->cn_namelen;
+       const size_t tln = tcnp->cn_namelen;
 
        return (fln != tln) || memcmp(fcnp->cn_nameptr, tcnp->cn_nameptr, fln);
 }



Home | Main Index | Thread Index | Old Index