On Tue, Nov 21, 2023 at 11:02 PM Ilya Leoshkevich <i...@linux.ibm.com> wrote: > > It should be possible to have inline functions in the s390 header > files, which call kmsan_unpoison_memory(). The problem is that these > header files might be included by the decompressor, which does not > contain KMSAN runtime, causing linker errors. > > Not compiling these calls if __SANITIZE_MEMORY__ is not defined - > either by changing kmsan-checks.h or at the call sites - may cause > unintended side effects, since calling these functions from an > uninstrumented code that is linked into the kernel is valid use case. > > One might want to explicitly distinguish between the kernel and the > decompressor. Checking for a decompressor-specific #define is quite > heavy-handed, and will have to be done at all call sites. > > A more generic approach is to provide a dummy kmsan_unpoison_memory() > definition. This produces some runtime overhead, but only when building > with CONFIG_KMSAN. The benefit is that it does not disturb the existing > KMSAN build logic and call sites don't need to be changed. > > Signed-off-by: Ilya Leoshkevich <i...@linux.ibm.com> Reviewed-by: Alexander Potapenko <gli...@google.com>
- [PATCH v2 05/33] kmsan: Fix is_bad_asm_addr() on arche... Ilya Leoshkevich
- Re: [PATCH v2 05/33] kmsan: Fix is_bad_asm_addr()... Alexander Potapenko
- [PATCH v2 03/33] kmsan: Disable KMSAN when DEFERRED_ST... Ilya Leoshkevich
- [PATCH v2 17/33] mm: kfence: Disable KMSAN when checki... Ilya Leoshkevich
- Re: [PATCH v2 17/33] mm: kfence: Disable KMSAN wh... Alexander Potapenko
- Re: [PATCH v2 17/33] mm: kfence: Disable KMSA... Alexander Potapenko
- [PATCH v2 22/33] s390: Use a larger stack for KMSAN Ilya Leoshkevich
- [PATCH v2 24/33] s390/checksum: Add a KMSAN check Ilya Leoshkevich
- Re: [PATCH v2 24/33] s390/checksum: Add a KMSAN c... Alexander Potapenko
- [PATCH v2 23/33] s390/boot: Add the KMSAN runtime stub Ilya Leoshkevich
- Re: [PATCH v2 23/33] s390/boot: Add the KMSAN run... Alexander Potapenko
- [PATCH v2 26/33] s390/ftrace: Unpoison ftrace_regs in ... Ilya Leoshkevich
- Re: [PATCH v2 26/33] s390/ftrace: Unpoison ftrace... Alexander Potapenko
- [PATCH v2 28/33] s390/string: Add KMSAN support Ilya Leoshkevich
- Re: [PATCH v2 28/33] s390/string: Add KMSAN suppo... Alexander Potapenko
- [PATCH v2 25/33] s390/cpacf: Unpoison the results of c... Ilya Leoshkevich
- Re: [PATCH v2 25/33] s390/cpacf: Unpoison the res... Alexander Potapenko
- [PATCH v2 31/33] s390/unwind: Disable KMSAN checks Ilya Leoshkevich
- [PATCH v2 29/33] s390/traps: Unpoison the kernel_stack... Ilya Leoshkevich
- [PATCH v2 32/33] s390: Implement the architecture-spec... Ilya Leoshkevich
- Re: [PATCH v2 32/33] s390: Implement the architec... Alexander Potapenko