From nobody Mon Dec 1 22:04:00 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 E48002D6E71 for ; Fri, 28 Nov 2025 03:35:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764300919; cv=none; b=WS3Pq7BZ1OVi5uHO4hgha1GHAXKyExPHNCC+E0efFZNHvwEUH0p6weETKkmST3hSax49wHYJFUy+vdCLOvUZVIo6ci+GQ+Z474Za1Bra8213nko00uG20TZ3495eSx8Z/05dIZfu2bMsoHICxr+xS8CNNYgeeGV5/kv9rBiOhwE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764300919; c=relaxed/simple; bh=5yBYmHLfTXRcYjHZcEXCQ+9eRtjjt6wdPPEyybY72jM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-type; b=Xu3s/b7bKxN+ceyEGd8RmZXFRdOyjQLw8/F7vT/2Ob58hgk1kLB5bZvoDl7DFaI6u7+rHJ7uEmJBropG9g8elvP+8J8y+4ETpGb3NeGHgWR1MRooM0/TbIdik0MutQVTN8wPgqYrs1DZbdy6WMS06Le6VV+PdlPBwW9U5KR1C4E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=QQ9TKAq1; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="QQ9TKAq1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1764300916; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IKXZUrmhKSnLBrasgIFsU0j1OV2RdKEZHqiMi8x1qZQ=; b=QQ9TKAq176pS97OJuXF9xWmtwsuoHKoWcjx2RBGKCNqhzEOvmhnsumKyBCrib615ubJJnn ZTDsq1GffGDAhs4p7RmlWdt6gbIvn+iXWnkV866/3ZSuHO+SCbIRE40s9UH6fk7KqsHvPy CmsSxpmjKvNh9KZry8Cb9JbsWOzOCjw= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-286-_d3nj9KnOtCZzyg-FTOf-A-1; Thu, 27 Nov 2025 22:35:10 -0500 X-MC-Unique: _d3nj9KnOtCZzyg-FTOf-A-1 X-Mimecast-MFC-AGG-ID: _d3nj9KnOtCZzyg-FTOf-A_1764300908 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5E284195608F; Fri, 28 Nov 2025 03:35:08 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.112.7]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6219519560B6; Fri, 28 Nov 2025 03:35:00 +0000 (UTC) From: Baoquan He To: linux-mm@kvack.org Cc: ryabinin.a.a@gmail.com, andreyknvl@gmail.com, glider@google.com, dvyukov@google.com, vincenzo.frascino@arm.com, akpm@linux-foundation.org, kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, kexec@lists.infradead.org, elver@google.com, sj@kernel.org, lorenzo.stoakes@oracle.com, snovitoll@gmail.com, christophe.leroy@csgroup.eu, Baoquan He , linux-um@lists.infradead.org Subject: [PATCH v4 11/12] arch/um: don't initialize kasan if it's disabled Date: Fri, 28 Nov 2025 11:33:19 +0800 Message-ID: <20251128033320.1349620-12-bhe@redhat.com> In-Reply-To: <20251128033320.1349620-1-bhe@redhat.com> References: <20251128033320.1349620-1-bhe@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Content-Type: text/plain; charset="utf-8" And also do the kasan_arg_disabled chekcing before kasan_flag_enabled enabling to make sure kernel parameter kasan=3Don|off has been parsed. Signed-off-by: Baoquan He Cc: linux-um@lists.infradead.org --- arch/um/kernel/mem.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c index 39c4a7e21c6f..08cd012a6bb8 100644 --- a/arch/um/kernel/mem.c +++ b/arch/um/kernel/mem.c @@ -62,8 +62,11 @@ static unsigned long brk_end; =20 void __init arch_mm_preinit(void) { +#ifdef CONFIG_KASAN /* Safe to call after jump_label_init(). Enables KASAN. */ - kasan_init_generic(); + if (!kasan_arg_disabled) + kasan_init_generic(); +#endif =20 /* clear the zero-page */ memset(empty_zero_page, 0, PAGE_SIZE); --=20 2.41.0