From nobody Tue Apr 7 07:05:52 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 599E2311587 for ; Wed, 25 Feb 2026 08:17:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772007422; cv=none; b=Z/VpuT8iLCn+oej2jwfi53r0HKegF7aEgxHkQA3KWzLHUP6pLsRXK1LPtu9XQUb/6upR2tdDpypSWxBoEcxQDJD0Nwc3kcAZgJ9LZHJ0gtegIksRXDVRJyGIlXdkcK5YvHREQJ6WD53CS/tall9txsPmpbuOfU0+nEZXj1bj7Qc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772007422; c=relaxed/simple; bh=RXwzQDiHu9geqg1I5FltyauABAk9iKEnO7089iEkMGg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-type; b=Y+4j+8w7G16Xw726uQ3sMkHp9wsoLGrsuEeIARWLd7K3+VXSmNOlZzPlIOHOOwIPmd86OCTeHDoyXdQU1pOKjbA05JjWnlvZotfPsoXhFsfIHG5B3pz7xiVbY6LVNbOFNT53pCv9uwXgBoBi7s6WSe/ux0TDI/q265Up7BzL5EQ= 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=Ig+rRKcR; arc=none smtp.client-ip=170.10.129.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="Ig+rRKcR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1772007420; 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=pa4Mok84BgrIJ096oguK0x0r8biU2FN9KdJaqHRRdYY=; b=Ig+rRKcRmjrvPvilOR5uDqcc/ayENsEkUZ12BM+gDuHeqMnIPk/DD5x1mqek68Lf65QEaL drHrYS9XGnyLNAYkKs8+moAdlaMYAQKHtaH5Q5dqAzALZVEAW/kyr4DomF1syY/O7nBnUL JkxcZKn2w5RjxgYT8ZWIC/PHHlHz4vc= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-199-nAFljNsZOpiYJ57hUOCZnA-1; Wed, 25 Feb 2026 03:16:54 -0500 X-MC-Unique: nAFljNsZOpiYJ57hUOCZnA-1 X-Mimecast-MFC-AGG-ID: nAFljNsZOpiYJ57hUOCZnA_1772007412 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 32EB918003FC; Wed, 25 Feb 2026 08:16:52 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.112.55]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A81041800351; Wed, 25 Feb 2026 08:16:42 +0000 (UTC) From: Baoquan He To: kasan-dev@googlegroups.com Cc: linux-mm@kvack.org, andreyknvl@gmail.com, ryabinin.a.a@gmail.com, glider@google.com, dvyukov@google.com, linux-kernel@vger.kernel.org, linux-um@lists.infradead.org, linux-arm-kernel@lists.infradead.org, loongarch@lists.linux.dev, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, x86@kernel.org, chris@zankel.net, jcmvbkbc@gmail.com, linux-s390@vger.kernel.org, hca@linux.ibm.com, Baoquan He Subject: [PATCH v5 13/15] arch/um: don't initialize kasan if it's disabled Date: Wed, 25 Feb 2026 16:14:10 +0800 Message-ID: <20260225081412.76502-14-bhe@redhat.com> In-Reply-To: <20260225081412.76502-1-bhe@redhat.com> References: <20260225081412.76502-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.4.1 on 10.30.177.111 Content-Type: text/plain; charset="utf-8" Here, kasan is disabled if specified 'kasan=3Doff' in kernel cmdline. And also wrap up the kasan code into CONFIG_KASAN ifdeffery scope. 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 89c8c8b94a79..2bf858ab35b5 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.52.0