Files
Centos-kernel-stream-9/include/linux/kmsan_string.h
T
Chris von Recklinghausen bd017dbbf0 x86: fortify: kmsan: fix KMSAN fortify builds
JIRA: https://issues.redhat.com/browse/RHEL-1848

commit 78a498c3a227f2ac773a8234b2ce092a4403f2c3
Author: Alexander Potapenko <glider@google.com>
Date:   Mon Oct 24 23:21:44 2022 +0200

    x86: fortify: kmsan: fix KMSAN fortify builds

    Ensure that KMSAN builds replace memset/memcpy/memmove calls with the
    respective __msan_XXX functions, and that none of the macros are redefined
    twice.  This should allow building kernel with both CONFIG_KMSAN and
    CONFIG_FORTIFY_SOURCE.

    Link: https://lkml.kernel.org/r/20221024212144.2852069-5-glider@google.com
    Link: https://github.com/google/kmsan/issues/89
    Signed-off-by: Alexander Potapenko <glider@google.com>
    Reported-by: Tamas K Lengyel <tamas.lengyel@zentific.com>
    Cc: Nathan Chancellor <nathan@kernel.org>
    Cc: Nick Desaulniers <ndesaulniers@google.com>
    Cc: Kees Cook <keescook@chromium.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Signed-off-by: Chris von Recklinghausen <crecklin@redhat.com>
2023-10-20 06:15:06 -04:00

22 lines
681 B
C

/* SPDX-License-Identifier: GPL-2.0 */
/*
* KMSAN string functions API used in other headers.
*
* Copyright (C) 2022 Google LLC
* Author: Alexander Potapenko <glider@google.com>
*
*/
#ifndef _LINUX_KMSAN_STRING_H
#define _LINUX_KMSAN_STRING_H
/*
* KMSAN overrides the default memcpy/memset/memmove implementations in the
* kernel, which requires having __msan_XXX function prototypes in several other
* headers. Keep them in one place instead of open-coding.
*/
void *__msan_memcpy(void *dst, const void *src, size_t size);
void *__msan_memset(void *s, int c, size_t n);
void *__msan_memmove(void *dest, const void *src, size_t len);
#endif /* _LINUX_KMSAN_STRING_H */