From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AFE6DC4332F for ; Wed, 2 Nov 2022 12:51:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2F0588E0002; Wed, 2 Nov 2022 08:51:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2A0918E0001; Wed, 2 Nov 2022 08:51:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 190798E0002; Wed, 2 Nov 2022 08:51:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 0BC768E0001 for ; Wed, 2 Nov 2022 08:51:05 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id D30C8121083 for ; Wed, 2 Nov 2022 12:51:04 +0000 (UTC) X-FDA: 80088487248.20.DAD8813 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) by imf26.hostedemail.com (Postfix) with ESMTP id 52809140002 for ; Wed, 2 Nov 2022 12:51:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=BrG9IOWVDpvJCQydmcNDh/mfUFj3VLU7OHkFypcc6Qw=; b=L20AcLBr+PiTOE1FE3lHIBM7j+ ayryll0bvZWJo/nh5fD8XRJFGBHlEqSonLq/GkX8+KpyyDmpFT2Cew9mC6VQpe6/v0UcejnSdz7aR UxFF4SEtJRZsnq2WAwlCo8kg1t/8OBMAWpLCELnT8j5Yy0kXZU91MjIsd9Foq2QZi1ugHB2iagy5z EwiYBhgx9zMINtkzxVnk8JYUuDh/mNWvpSAULYlu2o3JLuo+RXC778eh/Aey+c0AB0+/3460e9pv+ bzkW16oZJz5eEUJwzbgM3fMQhN2OwXhEEOotW03yrRgiK1iUGLx+slSLvx1prgXuJ/ocSNf4s+gC1 gRaX28lQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqDCr-008Oki-CV; Wed, 02 Nov 2022 12:50:57 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id E5E2630007E; Wed, 2 Nov 2022 13:50:56 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 72C9A20B1E7E1; Wed, 2 Nov 2022 13:50:56 +0100 (CET) Date: Wed, 2 Nov 2022 13:50:56 +0100 From: Peter Zijlstra To: Alexander Potapenko Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Borislav Petkov , Dave Hansen , Ingo Molnar , Thomas Gleixner , x86@kernel.org Subject: Re: [PATCH 5/5] x86/traps: avoid KMSAN bugs originating from handle_bug() Message-ID: References: <20221102110611.1085175-1-glider@google.com> <20221102110611.1085175-5-glider@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221102110611.1085175-5-glider@google.com> ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1667393464; a=rsa-sha256; cv=none; b=vpLOUB9pCxPk223wWBINp2C6epRF7T3i2VE6D3uO9a99RJf7nC9q8Y2EGM2/eiN+Q5hgYF qGOoYUPg3/qx+T9pID8m+BXG+tAMIWLH8mFD8Vlg/5RHAvleDE6wBxtlZZOxtt/RbZib3f 3SxwpVlv7YcTtxFTVSUCtcjrrHzfr9M= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=L20AcLBr; spf=none (imf26.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1667393464; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=BrG9IOWVDpvJCQydmcNDh/mfUFj3VLU7OHkFypcc6Qw=; b=l90UhO0ZnMBLu03NkJTPni8jiKhpBhhr6z78c4VjbtcxK2lb/55cCeD53PP0R0oiccUPbF fjnK1aC/S+TMw1D5bme5h2bIJqQUCZ7pXlcJcEf26tiwW+j6nA6Gcc31EGW99Z1mnSSaqZ okQxVpNN5dlFK3zN9N58NXAyS7U0le4= X-Stat-Signature: f18wgxgm6gefthyjy7mpiguqyyty6fwd X-Rspamd-Server: rspam09 X-Rspam-User: X-Rspamd-Queue-Id: 52809140002 Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=L20AcLBr; spf=none (imf26.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org; dmarc=none X-HE-Tag: 1667393464-786086 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Nov 02, 2022 at 12:06:11PM +0100, Alexander Potapenko wrote: > There is a case in exc_invalid_op handler that is executed outside the > irqentry_enter()/irqentry_exit() region when an UD2 instruction is used > to encode a call to __warn(). > > In that case the `struct pt_regs` passed to the interrupt handler is > never unpoisoned by KMSAN (this is normally done in irqentry_enter()), > which leads to false positives inside handle_bug(). > > Use kmsan_unpoison_entry_regs() to explicitly unpoison those registers > before using them. As does poke_int3_handler(); does that need fixing up too? OTOH look *very very* carefully at the contraints there.