Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Be less strict: when copyinstr() returns ENAMETOOLO...



details:   https://anonhg.NetBSD.org/src/rev/a179c0555e3b
branches:  trunk
changeset: 745094:a179c0555e3b
user:      maxv <maxv%NetBSD.org@localhost>
date:      Sat Feb 22 20:08:39 2020 +0000

description:
Be less strict: when copyinstr() returns ENAMETOOLONG, it does initialize
the buffer, so mark it as such.

diffstat:

 sys/kern/subr_msan.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r b7975219ab65 -r a179c0555e3b sys/kern/subr_msan.c
--- a/sys/kern/subr_msan.c      Sat Feb 22 19:54:34 2020 +0000
+++ b/sys/kern/subr_msan.c      Sat Feb 22 20:08:39 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_msan.c,v 1.7 2020/01/31 08:26:10 maxv Exp $       */
+/*     $NetBSD: subr_msan.c,v 1.8 2020/02/22 20:08:39 maxv Exp $       */
 
 /*
  * Copyright (c) 2019-2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_msan.c,v 1.7 2020/01/31 08:26:10 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_msan.c,v 1.8 2020/02/22 20:08:39 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -885,7 +885,7 @@
        kmsan_check_arg(sizeof(uaddr) + sizeof(kaddr) +
            sizeof(len) + sizeof(done), "copyinstr():args");
        ret = copyinstr(uaddr, kaddr, len, &_done);
-       if (ret == 0)
+       if (ret == 0 || ret == ENAMETOOLONG)
                kmsan_shadow_fill(kaddr, KMSAN_STATE_INITED, _done);
        if (done != NULL) {
                *done = _done;



Home | Main Index | Thread Index | Old Index