From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C15817E792 for ; Thu, 13 Jun 2024 20:30:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718310635; cv=none; b=exRn5wjp684FiVmEOmLFnJkktQtH+LjsSIiMrY9p02cLYszkoUORpbLQU3O5jLeDuFqRha7XbG88ommdydtz88g3kVEtyp7DkFAKwNkX379/An4Kq7ni2TYm42Fsgk9ir1YuVLXYxAoJ85lLvRIIwi/oB+bI16Ca1FmxOrkBUtw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718310635; c=relaxed/simple; bh=7aWXLK4x8IfayDMGE6jyuoY9IFsSVC8yu6vaciUG7OI=; h=Date:To:From:Subject:Message-Id; b=rRuQP3l/RDHesArQBuZwuEkkJ8GV8s+prpRnzNrnouhFCWttR+Lu6SEdeixhw7PwuG3lrUdSfKL+QyRnKQfMvebVDlkQxm0rad0J/P8G33PJhXC1nkD1dodeSfGUF2zRvUERbXbuS+4ilm6eWJoiZGq1FJKQ3q1Kx+3uCJgzfpY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=benFPsF/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="benFPsF/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4453EC2BBFC; Thu, 13 Jun 2024 20:30:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1718310635; bh=7aWXLK4x8IfayDMGE6jyuoY9IFsSVC8yu6vaciUG7OI=; h=Date:To:From:Subject:From; b=benFPsF/zAn+8K1/h0NIbwiba17fkn0ZXpmQvqkHqyDgjJFQBf24+jp4A7Kvn1Dqn NMu6cchLLNg47I4Vyys5M8kXLeax0w8WYRVXMGUB3yNj9lMv7YLop8JOZ6DsMtC/oH NoEH52FxHOoggjm7WESa1rs26/O/FAZkpHNpM3N8= Date: Thu, 13 Jun 2024 13:30:34 -0700 To: mm-commits@vger.kernel.org,vbabka@suse.cz,svens@linux.ibm.com,rostedt@goodmis.org,roman.gushchin@linux.dev,rientjes@google.com,penberg@kernel.org,mhiramat@kernel.org,mark.rutland@arm.com,iamjoonsoo.kim@lge.com,hca@linux.ibm.com,gor@linux.ibm.com,glider@google.com,elver@google.com,dvyukov@google.com,cl@linux.com,borntraeger@linux.ibm.com,agordeev@linux.ibm.com,42.hyeyoo@gmail.com,iii@linux.ibm.com,akpm@linux-foundation.org From: Andrew Morton Subject: + ftrace-unpoison-ftrace_regs-in-ftrace_ops_list_func.patch added to mm-unstable branch Message-Id: <20240613203035.4453EC2BBFC@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The patch titled Subject: ftrace: unpoison ftrace_regs in ftrace_ops_list_func() has been added to the -mm mm-unstable branch. Its filename is ftrace-unpoison-ftrace_regs-in-ftrace_ops_list_func.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/ftrace-unpoison-ftrace_regs-in-ftrace_ops_list_func.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Ilya Leoshkevich Subject: ftrace: unpoison ftrace_regs in ftrace_ops_list_func() Date: Thu, 13 Jun 2024 17:34:03 +0200 Patch series "kmsan: Enable on s390", v4. This series provides the minimal support for Kernel Memory Sanitizer on s390. Kernel Memory Sanitizer is clang-only instrumentation for finding accesses to uninitialized memory. The clang support for s390 has already been merged (https://reviews.llvm.org/D148596). This patch (of 35): Architectures use assembly code to initialize ftrace_regs and call ftrace_ops_list_func(). Therefore, from the KMSAN's point of view, ftrace_regs is poisoned on ftrace_ops_list_func entry(). This causes KMSAN warnings when running the ftrace testsuite. Fix by trusting the architecture-specific assembly code and always unpoisoning ftrace_regs in ftrace_ops_list_func. The issue was not encountered on x86_64 so far only by accident: assembly-allocated ftrace_regs was overlapping a stale partially unpoisoned stack frame. Poisoning stack frames before returns [1] makes the issue appear on x86_64 as well. [1] https://github.com/iii-i/llvm-project/commits/msan-poison-allocas-before-returning-2024-06-12/ Link: https://lkml.kernel.org/r/20240613153924.961511-1-iii@linux.ibm.com Link: https://lkml.kernel.org/r/20240613153924.961511-2-iii@linux.ibm.com Signed-off-by: Ilya Leoshkevich Reviewed-by: Alexander Potapenko Acked-by: Steven Rostedt (Google) Cc: Alexander Gordeev Cc: Christian Borntraeger Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Heiko Carstens Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Joonsoo Kim Cc: Marco Elver Cc: Mark Rutland Cc: Masami Hiramatsu (Google) Cc: Pekka Enberg Cc: Roman Gushchin Cc: Sven Schnelle Cc: Vasily Gorbik Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- kernel/trace/ftrace.c | 1 + 1 file changed, 1 insertion(+) --- a/kernel/trace/ftrace.c~ftrace-unpoison-ftrace_regs-in-ftrace_ops_list_func +++ a/kernel/trace/ftrace.c @@ -7407,6 +7407,7 @@ out: void arch_ftrace_ops_list_func(unsigned long ip, unsigned long parent_ip, struct ftrace_ops *op, struct ftrace_regs *fregs) { + kmsan_unpoison_memory(fregs, sizeof(*fregs)); __ftrace_ops_list_func(ip, parent_ip, NULL, fregs); } #else _ Patches currently in -mm which might be from iii@linux.ibm.com are ftrace-unpoison-ftrace_regs-in-ftrace_ops_list_func.patch kmsan-make-the-tests-compatible-with-kmsanpanic=1.patch kmsan-disable-kmsan-when-deferred_struct_page_init-is-enabled.patch kmsan-increase-the-maximum-store-size-to-4096.patch kmsan-fix-is_bad_asm_addr-on-arches-with-overlapping-address-spaces.patch kmsan-fix-kmsan_copy_to_user-on-arches-with-overlapping-address-spaces.patch kmsan-remove-a-useless-assignment-from-kmsan_vmap_pages_range_noflush.patch kmsan-remove-an-x86-specific-include-from-kmsanh.patch kmsan-expose-kmsan_get_metadata.patch kmsan-export-panic_on_kmsan.patch kmsan-allow-disabling-kmsan-checks-for-the-current-task.patch kmsan-support-slab_poison.patch kmsan-use-align_down-in-kmsan_get_metadata.patch kmsan-do-not-round-up-pg_data_t-size.patch mm-slub-let-kmsan-access-metadata.patch mm-slub-unpoison-the-memchr_inv-return-value.patch mm-kfence-disable-kmsan-when-checking-the-canary.patch lib-zlib-unpoison-dfltcc-output-buffers.patch kmsan-accept-ranges-starting-with-0-on-s390.patch s390-boot-turn-off-kmsan.patch s390-use-a-larger-stack-for-kmsan.patch s390-boot-add-the-kmsan-runtime-stub.patch s390-checksum-add-a-kmsan-check.patch s390-cpacf-unpoison-the-results-of-cpacf_trng.patch s390-cpumf-unpoison-stcctm-output-buffer.patch s390-diag-unpoison-diag224-output-buffer.patch s390-ftrace-unpoison-ftrace_regs-in-kprobe_ftrace_handler.patch s390-irqflags-do-not-instrument-arch_local_irq_-with-kmsan.patch s390-mm-define-kmsan-metadata-for-vmalloc-and-modules.patch s390-string-add-kmsan-support.patch s390-traps-unpoison-the-kernel_stack_overflows-pt_regs.patch s390-uaccess-add-kmsan-support-to-put_user-and-get_user.patch s390-unwind-disable-kmsan-checks.patch s390-implement-the-architecture-specific-kmsan-functions.patch kmsan-enable-on-s390.patch