Source-Changes-HG archive

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

[src/trunk]: src/sys/lib/libkern Fix KASAN build on aarch64



details:   https://anonhg.NetBSD.org/src/rev/d89af25238f1
branches:  trunk
changeset: 1008962:d89af25238f1
user:      skrll <skrll%NetBSD.org@localhost>
date:      Tue Apr 07 08:07:58 2020 +0000

description:
Fix KASAN build on aarch64

diffstat:

 common/lib/libc/string/strcat.c  |  6 +++---
 common/lib/libc/string/strchr.c  |  8 ++++++--
 common/lib/libc/string/strrchr.c |  8 ++++++--
 sys/lib/libkern/libkern.h        |  5 ++++-
 4 files changed, 19 insertions(+), 8 deletions(-)

diffs (104 lines):

diff -r 448354fe0c02 -r d89af25238f1 common/lib/libc/string/strcat.c
--- a/common/lib/libc/string/strcat.c   Tue Apr 07 07:43:33 2020 +0000
+++ b/common/lib/libc/string/strcat.c   Tue Apr 07 08:07:58 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: strcat.c,v 1.3 2018/02/04 20:22:17 mrg Exp $   */
+/*     $NetBSD: strcat.c,v 1.4 2020/04/07 08:07:58 skrll Exp $ */
 
 /*
  * Copyright (c) 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)strcat.c   8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: strcat.c,v 1.3 2018/02/04 20:22:17 mrg Exp $");
+__RCSID("$NetBSD: strcat.c,v 1.4 2020/04/07 08:07:58 skrll Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -45,7 +45,7 @@
 #include <lib/libkern/libkern.h>
 #endif
 
-#ifdef _FORTIFY_SOURCE
+#if defined(_FORTIFY_SOURCE) || defined(KASAN)
 #undef strcat
 #endif
 
diff -r 448354fe0c02 -r d89af25238f1 common/lib/libc/string/strchr.c
--- a/common/lib/libc/string/strchr.c   Tue Apr 07 07:43:33 2020 +0000
+++ b/common/lib/libc/string/strchr.c   Tue Apr 07 08:07:58 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: strchr.c,v 1.6 2018/02/04 20:22:17 mrg Exp $   */
+/*     $NetBSD: strchr.c,v 1.7 2020/04/07 08:07:58 skrll Exp $ */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)index.c    8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: strchr.c,v 1.6 2018/02/04 20:22:17 mrg Exp $");
+__RCSID("$NetBSD: strchr.c,v 1.7 2020/04/07 08:07:58 skrll Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -46,6 +46,10 @@
 #include <lib/libkern/libkern.h>
 #endif
 
+#if defined(KASAN)
+#undef strchr
+#endif
+
 __strong_alias(index, strchr)
 char *
 strchr(const char *p, int ch)
diff -r 448354fe0c02 -r d89af25238f1 common/lib/libc/string/strrchr.c
--- a/common/lib/libc/string/strrchr.c  Tue Apr 07 07:43:33 2020 +0000
+++ b/common/lib/libc/string/strrchr.c  Tue Apr 07 08:07:58 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: strrchr.c,v 1.6 2018/02/04 20:22:17 mrg Exp $  */
+/*     $NetBSD: strrchr.c,v 1.7 2020/04/07 08:07:58 skrll Exp $        */
 
 /*
  * Copyright (c) 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)rindex.c   8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: strrchr.c,v 1.6 2018/02/04 20:22:17 mrg Exp $");
+__RCSID("$NetBSD: strrchr.c,v 1.7 2020/04/07 08:07:58 skrll Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -45,6 +45,10 @@
 #include <lib/libkern/libkern.h>
 #endif
 
+#if defined(KASAN)
+#undef strrchr
+#endif
+
 __strong_alias(rindex, strrchr)
 char *
 strrchr(const char *p, int ch)
diff -r 448354fe0c02 -r d89af25238f1 sys/lib/libkern/libkern.h
--- a/sys/lib/libkern/libkern.h Tue Apr 07 07:43:33 2020 +0000
+++ b/sys/lib/libkern/libkern.h Tue Apr 07 08:07:58 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: libkern.h,v 1.138 2020/04/03 18:44:50 maxv Exp $       */
+/*     $NetBSD: libkern.h,v 1.139 2020/04/07 08:07:58 skrll Exp $      */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -429,6 +429,9 @@
 #define        alloca(s)               __builtin_alloca(s)
 #endif
 
+char   *strcat(char *, const char *);
+char   *strchr(const char *, int);
+char   *strrchr(const char *, int);
 /* These exist in GCC 3.x, but we don't bother. */
 #if defined(_KERNEL) && defined(KASAN)
 char   *kasan_strcat(char *, const char *);



Home | Main Index | Thread Index | Old Index