Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Initialize pp->pr_redzone to false. For some reason...



details:   https://anonhg.NetBSD.org/src/rev/3ed4d76cf357
branches:  trunk
changeset: 453536:3ed4d76cf357
user:      maxv <maxv%NetBSD.org@localhost>
date:      Fri Aug 16 10:41:35 2019 +0000

description:
Initialize pp->pr_redzone to false. For some reason with KUBSAN GCC does
not eliminate the unused branch in pr_item_linkedlist_put(), and this
leads to a unused uninitialized access which triggers KUBSAN messages.

diffstat:

 sys/kern/subr_pool.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r fa8bfa7163c3 -r 3ed4d76cf357 sys/kern/subr_pool.c
--- a/sys/kern/subr_pool.c      Fri Aug 16 10:36:06 2019 +0000
+++ b/sys/kern/subr_pool.c      Fri Aug 16 10:41:35 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_pool.c,v 1.254 2019/08/03 09:31:07 maxv Exp $     */
+/*     $NetBSD: subr_pool.c,v 1.255 2019/08/16 10:41:35 maxv Exp $     */
 
 /*
  * Copyright (c) 1997, 1999, 2000, 2002, 2007, 2008, 2010, 2014, 2015, 2018
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.254 2019/08/03 09:31:07 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.255 2019/08/16 10:41:35 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -767,6 +767,7 @@
        pp->pr_drain_hook = NULL;
        pp->pr_drain_hook_arg = NULL;
        pp->pr_freecheck = NULL;
+       pp->pr_redzone = false;
        pool_redzone_init(pp, size);
        pool_quarantine_init(pp);
 



Home | Main Index | Thread Index | Old Index