Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp32966rdg; Tue, 10 Oct 2023 03:30:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFvaRf2FC+5oV8qOAywngz3cSrZgrm+gvjXYY0SCQ1Wv68kIIp3xxUZgLkz0scc5ejWf/7F X-Received: by 2002:a17:902:ee41:b0:1bc:c82:9368 with SMTP id 1-20020a170902ee4100b001bc0c829368mr17317351plo.32.1696933858557; Tue, 10 Oct 2023 03:30:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696933858; cv=none; d=google.com; s=arc-20160816; b=TBgs1syle4TbxQ/5pSIkImwVv9PsWZ0Mblw+rDYCGru9s4RTRC+RUx+DIBqB2Rob7V rTiQqo2q7zn7YfHfY+mM2nQFT+krZNTvnTmqjBwxu2dVKMcHK6y2LapIO+c+6Xne3acV flnnGS7qwOUy6zU19ufjZcPSM/qEbJYTgOX5Lms+bIj+gaAAWloYcUHNNa2uLC+X5xVo BOozKy2ZGYTdPOjKweyWNaflv3x992sPtequQ+KscjMv2rcTwTT1jErXcWEmrjFAobPr D+qbB9PL+pJWPVogaALUeNH1n61xTXbR6j65SwNmDvPml1R96xGWjgEdTGvZfu2A4V2g leEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=iflXojYnSpFgKJljaLougO8F8G9RONmWdqmx611sL8o=; fh=j6gH8MVd8SXUPRBQKuaUs95IQ8SMKFlgheGW6KdVuMs=; b=Id7r/evIqMggjU07QFWmldKREGJlmxJjZAXZlQq12+dw80fwbTUL2fq/ExTaMAPuU3 gbWd5xJNhkX0ALcWuD7FYTycVfpuuSNvpJa0+4jPHdAvTs7R8sADRviu57y9s/IJDjnm g5us50lW0M4k8/9A3SyB1S3LtJ2PNVg1ooH4zAZsP+dCgQyHzG88VR8lrRFeO9Ct9vGg 7rqF10enTYFKM8aWLeIjx4V7enqkLuS3YAoOyYxelpl+/w782KUA30AWIJpsv9eOBi/B yAFlcIt1aDNwcAreBRG8RqgBEAmJE//yj7PUe5vIOX1C+zRXMeGAsvKWa1HAA91uLcdd phnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=m4Zyw1cd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id e3-20020a17090301c300b001c9b6735417si946013plh.398.2023.10.10.03.30.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 03:30:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=m4Zyw1cd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id E9125806BE2F; Tue, 10 Oct 2023 03:30:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230140AbjJJKai (ORCPT + 99 others); Tue, 10 Oct 2023 06:30:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230254AbjJJKae (ORCPT ); Tue, 10 Oct 2023 06:30:34 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C74B19E; Tue, 10 Oct 2023 03:30:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696933833; x=1728469833; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=XakNk4GgwZEyofp6lByGxyrj3kfNwhhD+AeDdSisNVM=; b=m4Zyw1cdJ8/Pv/EejVZ/Hsnr9DplwOd3eeh5UPKW8ICNoY7eEmGjAe5C nTudD5uHvg4tP4pSnd0ZHpfgtIS4qdE1topWcer8w0gV0i+fZaDP9uras Y36v3jELLn8UoC1gWeOi+drkaAb7LzP3alMTCjAGU/I552XjvmTfW6rcK fBWP7+dn/ShGd0m6LlU2Ov6b5nIoyApY2pfst7D0wj9QFzzwMnwZuLsDT LVyKQVeeTjHM+jeKyjiBkNdPWX3e1uFA/d/d5TvwH++Y058H2ZFda+jni vLXJWytTsEZlqwwC9dp9zI+8IZRUGhB/2uKx+XpYphYYOkHGjz8p/34vg A==; X-IronPort-AV: E=McAfee;i="6600,9927,10858"; a="369423611" X-IronPort-AV: E=Sophos;i="6.03,212,1694761200"; d="scan'208";a="369423611" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2023 03:30:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10858"; a="1084720804" X-IronPort-AV: E=Sophos;i="6.03,212,1694761200"; d="scan'208";a="1084720804" Received: from albertmo-mobl2.ger.corp.intel.com (HELO box.shutemov.name) ([10.251.208.38]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2023 03:30:29 -0700 Received: by box.shutemov.name (Postfix, from userid 1000) id C523910989E; Tue, 10 Oct 2023 13:30:26 +0300 (+03) Date: Tue, 10 Oct 2023 13:30:26 +0300 From: "Kirill A. Shutemov" To: Peter Zijlstra Cc: Borislav Petkov , Thomas Gleixner , Ingo Molnar , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino , kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, Fei Yang , stable@vger.kernel.org Subject: Re: [PATCH] x86/alternatives: Disable KASAN on text_poke_early() in apply_alternatives() Message-ID: <20231010103026.hcjn47kvjqesxoqj@box.shutemov.name> References: <20231010053716.2481-1-kirill.shutemov@linux.intel.com> <20231010081938.GBZSUJGlSvEkFIDnES@fat_crate.local> <20231010101056.GF377@noisy.programming.kicks-ass.net> <20231010101621.GG377@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231010101621.GG377@noisy.programming.kicks-ass.net> X-Spam-Status: No, score=2.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 10 Oct 2023 03:30:48 -0700 (PDT) X-Spam-Level: ** On Tue, Oct 10, 2023 at 12:16:21PM +0200, Peter Zijlstra wrote: > On Tue, Oct 10, 2023 at 12:10:56PM +0200, Peter Zijlstra wrote: > > > That said, I don't particularly like the patch, I think it should, at > > the veyr least, cover all of apply_alternatives, not just > > text_poke_early(). > > kasan_arch_is_ready() is another option, x86 doesn't currently define > that, but that would allow us to shut kasan down harder around patching. > Not sure if it's worth the trouble though. IIUC, it was intended to delay KASAN usage until it is ready. KASAN is functional well before apply_alternatives() and making kasan_arch_is_ready() temporary false for patching feels like abuse of the hook. -- Kiryl Shutsemau / Kirill A. Shutemov