Sun Dec 8 11:48:15 2019 UTC ()
Fix __nomsan: missing opt_kmsan.h, and the attribute should be
kernel-memory.


(maxv)
diff -r1.149 -r1.150 src/sys/sys/cdefs.h

cvs diff -r1.149 -r1.150 src/sys/sys/cdefs.h (expand / switch to unified diff)

--- src/sys/sys/cdefs.h 2019/11/14 16:23:53 1.149
+++ src/sys/sys/cdefs.h 2019/12/08 11:48:15 1.150
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: cdefs.h,v 1.149 2019/11/14 16:23:53 maxv Exp $ */ 1/* $NetBSD: cdefs.h,v 1.150 2019/12/08 11:48:15 maxv Exp $ */
2 2
3/* * Copyright (c) 1991, 1993 3/* * Copyright (c) 1991, 1993
4 * The Regents of the University of California. All rights reserved. 4 * The Regents of the University of California. All rights reserved.
5 * 5 *
6 * This code is derived from software contributed to Berkeley by 6 * This code is derived from software contributed to Berkeley by
7 * Berkeley Software Design, Inc. 7 * Berkeley Software Design, Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -30,26 +30,27 @@ @@ -30,26 +30,27 @@
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE. 31 * SUCH DAMAGE.
32 * 32 *
33 * @(#)cdefs.h 8.8 (Berkeley) 1/9/95 33 * @(#)cdefs.h 8.8 (Berkeley) 1/9/95
34 */ 34 */
35 35
36#ifndef _SYS_CDEFS_H_ 36#ifndef _SYS_CDEFS_H_
37#define _SYS_CDEFS_H_ 37#define _SYS_CDEFS_H_
38 38
39#ifdef _KERNEL_OPT 39#ifdef _KERNEL_OPT
40#include "opt_diagnostic.h" 40#include "opt_diagnostic.h"
41#include "opt_kasan.h" 41#include "opt_kasan.h"
42#include "opt_kcsan.h" 42#include "opt_kcsan.h"
 43#include "opt_kmsan.h"
43#endif 44#endif
44 45
45/* 46/*
46 * Macro to test if we're using a GNU C compiler of a specific vintage 47 * Macro to test if we're using a GNU C compiler of a specific vintage
47 * or later, for e.g. features that appeared in a particular version 48 * or later, for e.g. features that appeared in a particular version
48 * of GNU C. Usage: 49 * of GNU C. Usage:
49 * 50 *
50 * #if __GNUC_PREREQ__(major, minor) 51 * #if __GNUC_PREREQ__(major, minor)
51 * ...cool feature... 52 * ...cool feature...
52 * #else 53 * #else
53 * ...delete feature... 54 * ...delete feature...
54 * #endif 55 * #endif
55 */ 56 */
@@ -339,27 +340,27 @@ @@ -339,27 +340,27 @@
339#if __GNUC_PREREQ__(4, 9) && defined(KASAN) 340#if __GNUC_PREREQ__(4, 9) && defined(KASAN)
340#define __noasan __attribute__((no_sanitize_address)) 341#define __noasan __attribute__((no_sanitize_address))
341#else 342#else
342#define __noasan /* nothing */ 343#define __noasan /* nothing */
343#endif 344#endif
344 345
345#if __GNUC_PREREQ__(4, 9) && defined(KCSAN) 346#if __GNUC_PREREQ__(4, 9) && defined(KCSAN)
346#define __nocsan __attribute__((no_sanitize_thread)) 347#define __nocsan __attribute__((no_sanitize_thread))
347#else 348#else
348#define __nocsan /* nothing */ 349#define __nocsan /* nothing */
349#endif 350#endif
350 351
351#if defined(__clang__) && defined(KMSAN) 352#if defined(__clang__) && defined(KMSAN)
352#define __nomsan __attribute__((no_sanitize("memory"))) 353#define __nomsan __attribute__((no_sanitize("kernel-memory")))
353#else 354#else
354#define __nomsan /* nothing */ 355#define __nomsan /* nothing */
355#endif 356#endif
356 357
357#if defined(__clang__) 358#if defined(__clang__)
358#define __noubsan __attribute__((no_sanitize("undefined"))) 359#define __noubsan __attribute__((no_sanitize("undefined")))
359#elif __GNUC_PREREQ__(4, 9) 360#elif __GNUC_PREREQ__(4, 9)
360#define __noubsan __attribute__((no_sanitize_undefined)) 361#define __noubsan __attribute__((no_sanitize_undefined))
361#else 362#else
362#define __noubsan /* nothing */ 363#define __noubsan /* nothing */
363#endif 364#endif
364#endif 365#endif
365 366