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 6F842C2D0CD for ; Sat, 17 May 2025 17:25:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 13F226B0082; Sat, 17 May 2025 13:25:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0EF426B0083; Sat, 17 May 2025 13:25:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EF6186B0085; Sat, 17 May 2025 13:25:54 -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 C23E36B0082 for ; Sat, 17 May 2025 13:25:54 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id B89FD1D1404 for ; Sat, 17 May 2025 17:25:55 +0000 (UTC) X-FDA: 83453077470.10.4449926 Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) by imf03.hostedemail.com (Postfix) with ESMTP id C832820003 for ; Sat, 17 May 2025 17:25:53 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=csgroup.eu; spf=pass (imf03.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.236.30 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1747502754; a=rsa-sha256; cv=none; b=G+k8UmcKUG0UzGmmLkpUraYm7W9RYS3kp8chbBkvnXRfnSRHijFK7RX+5sHgN+mqi7YArO IA/72gTXQOJiybdiBXEik+/1UKKU0eFjGyVahCTNPhSOnbX3mWlMfflZYp7sSVPPvtuBhi QUyr2K82ikGL6Y8GgOEKGOYSNeVfC0E= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=csgroup.eu; spf=pass (imf03.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.236.30 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1747502754; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=i4YHvtcUof/MFNaZKpePicitUnL7aIOj0jGXR2C87aU=; b=2SQJKZ4x2CJUc1bAZtBaZM/gZb+mWZlT9fA0tLbBTXIgc17EOrm/VupZjWT3fchWZz8rFN TBAxwhjNla40GBAWjMmcZlh07WnGkY3HhOHwORsR/yLqGPhAJn4gZGtAW51LpXlVa+xI8z 70QOQPSJ48QzxNgDLZ2Yw/vNaF7nzpc= Received: from localhost (mailhub3.si.c-s.fr [192.168.12.233]) by localhost (Postfix) with ESMTP id 4b09p649qhz9sWd; Sat, 17 May 2025 19:25:50 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0kOzLs8HarK8; Sat, 17 May 2025 19:25:50 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4b09p63MxDz9sVS; Sat, 17 May 2025 19:25:50 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 6E5438B767; Sat, 17 May 2025 19:25:50 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id Vg09AF3dGqEw; Sat, 17 May 2025 19:25:50 +0200 (CEST) Received: from [192.168.235.99] (unknown [192.168.235.99]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 3448D8B763; Sat, 17 May 2025 19:25:50 +0200 (CEST) Message-ID: Date: Sat, 17 May 2025 19:25:49 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Question: a module for wiping userspace RAM before shutdown/reboot/halt To: Danill Klimuk , linux-modules@vger.kernel.org, "linux-mm@kvack.org" References: Content-Language: fr-FR From: Christophe Leroy In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Stat-Signature: 11ohscd3mie4wxr7h3zdfcambnd56mgw X-Rspam-User: X-Rspamd-Queue-Id: C832820003 X-Rspamd-Server: rspam06 X-HE-Tag: 1747502753-695702 X-HE-Meta: U2FsdGVkX18OBxrbzcmS3nMLjZhnvq3H7d6lkCZ0/F/abU2YL5EXUwumBRcUfsfrXxPUTaB1uGPTRRJ6OTMRvJB/f14Wq1xT3utiEBOtjdAqBQt87+pYP+9gkIQykE+hTsITPkBx8zS23rkYBKZSK/JikB33RMSPQJL/65x3lft35wvvr378ZDWDgpHb0xfdTDOlS4LMKNUlZlo/GmIVWwhrciSC3mfgjN0cyj7pRywb4MXThUpJobFh8JZxIfxSK/t8rwqSIXtTd7iKvwnQRgyDLylCZsWa+0RW5Q0X69DCB6iI0YqJ/ZC8nbNybQ3IWUmoaOkqUmoaGwptc239hE3lrKwWFL6BW8t0gWj8/uce0H9yF03b6lHrzQkARBHbTtLyq5vitv1Cs1W1cuNai3PkokikAjRro28B8H1mLNknUN9vc+ejJKXY3N8WEnZfCojMcOb+HhV40oO6OIA8srrftc6HMFU1rCSCrm8NbOA5pM00fR2mn7VYTATC86dugpUHf6EXAcMUEMHM/JvOyotYSCg5BYEsOykIC/ebPaYXziOCayXWl/0xVqUCw4FJHNOIub0i/I6DC7wMkwtaM3Xyr44BDJ4jlx4qgYmjSbitjXbyq6XADTORQyxzlJFKZV9IWKzwgncoNMyoa404UqZq3+jrRBeq9A4IIkPteNRUi3wUjLhWx6wCmMueyGiL1ct/KjXTEUiUq7ZPWgz3RgPwFDe899MaTYDFf/zkN1yn20YZtu721+7EpWvZ1+BfEpbdPqttMVWh70I36krF225Q44HZc1Tie6upF/lzlbfEMsGFlra1ZYrUvM3SL3LJHW5/oMsKW3+hXcYN4lbTlx1LvF3sRQBGsuNp1RQIBALZTvskU2P/4FfBc+FdcSpQjLxVeMA6qeW7yj35SOaCEA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000227, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Le 15/05/2025 à 15:30, Danill Klimuk a écrit : > Hello everyone. I have received a request to write a Linux kernel module > that will wipe any processes leftovers from userspace RAM during/before > Linux kernel shutdown/reboot/halt sequences. The reason I am going to do > it inside a module is to do it in a more deterministic way that does not > depend on any processes. AFAIK Linux kernel does not have any other > functionalities to wipe leftovers from RAM apart from the command line > arguments "init_on_free" and "init_on_alloc" that results in memory > poisoning only during memory allocation and memory deallocation. These > arguments cause the kernel to clean processes memory several times > during runtime, that is not deterministic because of processes > non-deterministic behavior. Hence, I want to bring the memory wiping > mechanism in one place and make it more deterministic. The question is: > > Maybe the Linux kernel already have such functionalities implemented? Linux memory management topics should be sent to linux-mm@kvack.org > > Currently I am planning to implement the wiping process to be triggered > by "reboot_notifier_callback", so to wipe RAM after PID 1 process > finishes and no other processes are executing. I am looking forward to > merging the module into Linux kernel upstream too. What do you mean by 'wiping', do you mean 'clearing' ? Can you explain the reason this is needed ? Christophe