? bin/ls/.gdbinit ? bin/ls/ls ? bin/ls/ls.cat1 ? bin/ls/ls.debug ? bin/ls/ls.html1 ? external/gpl3/gdb/dist/gdb/rust-exp.c Index: bin/ls/ls.c =================================================================== RCS file: /cvsroot/src/bin/ls/ls.c,v retrieving revision 1.76 diff -u -r1.76 ls.c --- bin/ls/ls.c 6 Feb 2017 21:06:04 -0000 1.76 +++ bin/ls/ls.c 5 Jun 2018 10:30:55 -0000 @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #include @@ -688,6 +689,12 @@ { int a_info, b_info; + MSAN_UNPOISON(a, sizeof(FTSENT *)); + MSAN_UNPOISON(b, sizeof(FTSENT *)); + + MSAN_UNPOISON(*a, sizeof(FTSENT)); + MSAN_UNPOISON(*b, sizeof(FTSENT)); + a_info = (*a)->fts_info; if (a_info == FTS_ERR) return (0); Index: distrib/sets/lists/comp/mi =================================================================== RCS file: /cvsroot/src/distrib/sets/lists/comp/mi,v retrieving revision 1.2203 diff -u -r1.2203 mi --- distrib/sets/lists/comp/mi 3 Jun 2018 22:32:57 -0000 1.2203 +++ distrib/sets/lists/comp/mi 5 Jun 2018 10:31:10 -0000 @@ -2821,6 +2821,7 @@ ./usr/include/rump/scsitest.h comp-obsolete obsolete ./usr/include/rump/ukfs.h comp-c-include rump ./usr/include/sa.h comp-obsolete obsolete +./usr/include/sanitizer.h comp-c-include ./usr/include/saslc.h comp-c-include ./usr/include/sched.h comp-c-include ./usr/include/sdp.h comp-c-include Index: include/Makefile =================================================================== RCS file: /cvsroot/src/include/Makefile,v retrieving revision 1.144 diff -u -r1.144 Makefile --- include/Makefile 16 Oct 2017 11:38:25 -0000 1.144 +++ include/Makefile 5 Jun 2018 10:33:45 -0000 @@ -17,7 +17,8 @@ memory.h mntopts.h monetary.h mpool.h mqueue.h \ ndbm.h netconfig.h netdb.h netgroup.h nlist.h nl_types.h nsswitch.h \ paths.h pwd.h quota.h randomid.h ranlib.h re_comp.h regex.h regexp.h \ - resolv.h res_update.h rmt.h sched.h search.h semaphore.h setjmp.h \ + resolv.h res_update.h rmt.h \ + sanitizer.h sched.h search.h semaphore.h setjmp.h \ string.h sgtty.h signal.h spawn.h stab.h stdalign.h stddef.h stdio.h \ stdlib.h stdnoreturn.h strings.h stringlist.h struct.h sysexits.h \ tar.h time.h ttyent.h tzfile.h \ Index: include/sanitizer.h =================================================================== RCS file: include/sanitizer.h diff -N include/sanitizer.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ include/sanitizer.h 5 Jun 2018 10:33:45 -0000 @@ -0,0 +1,61 @@ +/* $NetBSD$ */ + +/*- + * Copyright (c) 2018 The NetBSD Foundation, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + + +#ifndef _SANITIZER_H_ +#define _SANITIZER_H_ + +// Clang/LLVM specific macro +#if !defined(__has_feature) +#define __has_feature(x) 0 +#endif + +#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__) +#include +// The compiler header defines macros: +// - ASAN_POISON_MEMORY_REGION(a, b) +// - ASAN_UNPOISON_MEMORY_REGION(a, b) +#else +#define ASAN_POISON_MEMORY_REGION(a, b) +#define ASAN_UNPOISON_MEMORY_REGION(a, b) +#endif + +#if __has_feature(memory_sanitizer) +#include +#define MSAN_POISON(a, b) __msan_poison(a, b) +#define MSAN_UNPOISON(a, b) __msan_unpoison(a, b) +#else +#define MSAN_POISON(a, b) +#define MSAN_UNPOISON(a, b) +#endif + +#if __has_feature(thread_sanitizer) || defined(__SANITIZE_THREAD__) +#include +#endif + +#endif /* !_SANITIZER_H_ */