From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8E87C27F727 for ; Wed, 26 Nov 2025 18:14:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764180894; cv=none; b=ek5COtDuBJN+XVXBgDyHBdSCJ/IQ/yH/Ab8C2NhtZvG/HH5HoYtwOKhJ4vfQIdXiE0FvuCyM780wJ/mkCgwIdDqsB8CW7vrzykwgDe1MuKp9HXJbrXL5dHnUBVLkhUUK84QChPWnS0UbBTmlOwaPgMsx6eeRqOz4xVaoOXNayRk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764180894; c=relaxed/simple; bh=kjHx5hFM99/6/f9ENV62ybrwwGC7N83jK71FIRHO86k=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=l3aU7iqpscoX+Z7zRE1S5Qqk9TQWulr3w5Gh2Ejm5iS1W/WZRR7voDALedYQmcYEV8JF76szI+9delQeOrm2+M1sBP/Sth7qK+uC56KJj53aaucxJpq6taSqZI67+JKj6gSyhG3vpoEw6OZrZqHud6i/eg9FiXMI6UQE0oj6mAE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=p7X5qj2O; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="p7X5qj2O" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EFBC3C4CEF8; Wed, 26 Nov 2025 18:14:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1764180894; bh=kjHx5hFM99/6/f9ENV62ybrwwGC7N83jK71FIRHO86k=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=p7X5qj2Ogw6DhSG+Db57ZmeCGAeKCNEcijtsjxrFozJXgGhSqVSUuMUw7Hny7oktD DGvCr7OzgAxHGT0C494t7VZdZ3M5DlMEOAongOWa/1BsSg+h9+f/6eJ0omjCtdMfJv lB77JHtJjrQ3Cv2HxJUD6A+l7gizCooLwhU2WEFM= Date: Wed, 26 Nov 2025 10:14:53 -0800 From: Andrew Morton To: Breno Leitao Cc: Alexander Potapenko , Marco Elver , Dmitry Vyukov , kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: Re: [PATCH] mm/kfence: add reboot notifier to disable KFENCE on shutdown Message-Id: <20251126101453.3ba9b3184aa6dd3c718287e6@linux-foundation.org> In-Reply-To: <20251126-kfence-v1-1-5a6e1d7c681c@debian.org> References: <20251126-kfence-v1-1-5a6e1d7c681c@debian.org> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 26 Nov 2025 09:46:18 -0800 Breno Leitao wrote: > During system shutdown, KFENCE can cause IPI synchronization issues if > it remains active through the reboot process. To prevent this, register > a reboot notifier that disables KFENCE and cancels any pending timer > work early in the shutdown sequence. > > This is only necessary when CONFIG_KFENCE_STATIC_KEYS is enabled, as > this configuration sends IPIs that can interfere with shutdown. Without > static keys, no IPIs are generated and KFENCE can safely remain active. > > The notifier uses maximum priority (INT_MAX) to ensure KFENCE shuts > down before other subsystems that might still depend on stable memory > allocation behavior. > > This fixes a late kexec CSD lockup[1] when kfence is trying to IPI a CPU > that is busy in a IRQ-disabled context printing characters to the > console. > > Link: https://lore.kernel.org/all/sqwajvt7utnt463tzxgwu2yctyn5m6bjwrslsnupfexeml6hkd@v6sqmpbu3vvu/ [1] 6.13 kernels and earlier, so I assume we'll want a cc:stable on this. And I assume there's really no identifiable Fixes: target.