From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 3F1A02D94B5 for ; Thu, 25 Jun 2026 21:06:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782421583; cv=none; b=mKYfMetxtbbPYWodJmrKEIzjTOG30j1M3VI4P17rKLUcQOu5Qcuws1T+aPeAJitFRUQ43/bMow5Xo2Jtw7gVf3DoC2+artGXjS2OE8d/PhQvABrwEnaeYyxT5psHGOqMvDNyCUfRBysIVKGDeEXKCpthTW6Y79nIsQOQeTFrq+k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782421583; c=relaxed/simple; bh=FPVHM7pBQ1tC8Rw/Sk//0Ggo+boz3DQ2bM+a9wTck8k=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=maMca2YfgjQkYLM6TT/BSMLOYtCCORlVwezCI8zHJuYTzIvp74WMW2X4CQ2hSVJvCpKZy0bmcxUT4MQ9/aPrxR5lJ5BFS9Y4C68OOJRhDbUkGFhj7CzUs02834vFdw4+i3si0cRWnGjpNcjRjRsu+E16z3dHk5Y8rhQ6Te4cVQM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IAZm0REY; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IAZm0REY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26A9A1F000E9; Thu, 25 Jun 2026 21:06:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1782421581; bh=eOyeMClWhgd7TiNUKn5BYWKoVRd0OQqwk8a1u11rrfc=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=IAZm0REYgrWX3/03SmLDCDR4CUsPQqwMZ/HvJZNNhBKC+oZTv5YH7gEzdwTCjjhnT YLblX4/VI7X84HTJTdGEKRjeC7e8kY1nvnxPS6uYsdIT+rzXtPpdvKxiUG9YA/0xt6 DkxzQNVKaZ0AQpkUPgZ2ggb6X4zaeQzqXuikVMIiYodfFZAQ8RHioUCXhUkz2WVwvT ct1Dyopxsl1TGOb6/god95ONzqc6obCVI+7O0vK9TOV/uCBc+FiFeyJPXbqVsiVLiR T+Pzriv/GwlW9XvfJCbANqhiXZDafsFQuZ2BWixZacpd2dZfjW13X++xYPvoa6ZhCN WWHo/YVLOrXcA== From: Thomas Gleixner To: Alexander Potapenko , Mark Rutland , Marco Elver Cc: Dmitry Vyukov , syzbot , kasan-dev , linux-kernel@vger.kernel.org, luto@kernel.org, peterz@infradead.org, syzkaller-bugs@googlegroups.com, ruanjinjie@huawei.com Subject: Re: [syzbot] [kernel?] upstream test error: KMSAN: uninit-value in irqentry_exit_to_kernel_mode_preempt In-Reply-To: References: <69e7ee1f.a00a0220.17a17.001d.GAE@google.com> <87v7cu876c.ffs@tglx> <87zf246t8l.ffs@tglx> Date: Thu, 25 Jun 2026 23:06:18 +0200 Message-ID: <87se6ajpo5.ffs@fw13> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Mon, Jun 22 2026 at 11:37, Alexander Potapenko wrote: >> I have a draft Clang patch implementing the following intrinsics at >> https://github.com/llvm/llvm-project/pull/202603: >> - llvm.kmsan.instrumentation.begin >> - llvm.kmsan.instrumentation.end >> - llvm.kmsan.instrumentation.update.context (to reload the context >> pointer; I am not using it yet). > > For the record, Marco Elver has an alternative proposal: modify > __kmsan_get_context() to take _RET_IP_ from the caller. > Then, if noinstr function A calls an instrumented function B, B will > pass the return address belonging to A to __kmsan_get_context(), and > the latter can check that return address and wipe out the argument > shadow if it belongs to the noinstr function. > > This solution is quite elegant; it requires only minor compiler > changes, and won't require any kernel annotations. > However, there are downsides: > - We are slowing down each call, including those between instrumented functions. > - For noinstr calls from modules, we'll need complex lookups involving > RCU, with a potential for infinite recursion. Let's not go there. I rather spend some effort to disentangle the BUG/WARN maze. Thanks, tglx