From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794677494; b=nolTUR29AUrUF7/v/DwxA57zeIumJAjblHtDroIDFBDB6axxk7OnUpelEsOxxcJgBkuJ EEQ8TqYQGJFaRXZ6JDjf678Ih3WKYX8K1JkBszyhgZG8IEhPflXPJKpEHVSdVwSQeFKuh 5qfB74zXDxUDXHzdD2JII6+SoImWz0JYhdOAjLTnOqyzFwKtTkAX89QwQMMcLM/bGqgoS rwvaB58wb5v6W1EN1h1MqQtqLb4np4jouMTJV44zYBJbZheQHiBVgCNuVTdlVUxHTHQ0w p4Mb6EEH7rRrufTHs3HdkAuFinR4tMJ9vjBkLQI4NNKUO5U2MPziFEoJRf5M8ZVu4Gw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794677494; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=xu6Ta+VGcVrBTjJvTLtQRPi6ZkVQp0lKmr8llfO95ro=; b=TUEUN0Vs9wTT6VugBbcvJ5pkqAy8Lj4u717bo22VroIpesVEwsOXV84IJ1BpB3NPfEkT oClFh1MxVEt4f9h9WoIWW3eY2dk20HYi71MAJ7zwGgM0DPhc58n+aDih6USYmRx+6LUR5 yPj4cV9nJdhi1EgaPqQdFLQ1MYN5qs774eEO+zaIRp7ohYKJg2NyJXqvsLcjDlBojvaYd zAmzkvfgBLVbIhIxqGqLTi4KSpjIvsFk0Fh65QyRiYIp2m6XiBI763R4kvTRlhgQTiDji JrKtYOH7hybk5TQPQ9TCmiLJhmv6rRo7l4TnNWAJcyR2fwQxQsfT0qkQ280HPN9ND9Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=XubAwCv6; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D0A43606A32D for ; Sat, 14 Nov 2026 17:31:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=XubAwCv6 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 973541F000C4; Sat, 14 Nov 2026 17:31:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794677494; bh=xu6Ta+VGcVrBTjJvTLtQRPi6ZkVQp0lKmr8llfO95ro=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=XubAwCv6+ETbPYyk95JCbkpKK5A+JFqtao9ua+CADY8vxNic4QukZaRvgMbdbueZu dEGJTBnNmnjXvWBuiPPxvJZXK1r8ot6BynZQ9rO+SyX/AqRObbBLAdsEnojlAUFntr eQmCxpQVq8bKZd5U4lRQqIPvhS42ofy3tE3U4slpb49itS3F7tCAyTqKVMTPx0/3ab amZ40UQLximBy+DKck5n90zX4/5rVfbMCYf2K3XyUsGcbOX3L5Z1kc80rD9YoAKJlH nJD3FdjWxo2PJvuWcRJjJlxz60fgVH9bbJPUn9+jN23fDkFwzcQ1N2CB7DlEH8ENUk wfJQFPEc+672w== Date: Sat, 14 Nov 2026 17:31:29 +0000 From: "Lorenzo Stoakes (ARM)" To: shao.mingyin@zte.com.cn Cc: surenb@google.com, akpm@linux-foundation.org, linux-mm@kvack.org, hao.ge@linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: snapshot alloc tags in alloc_tag_top_users() to avoid UAF Message-ID: References: <20261115004711126EXlXUnHk7NZz7rkWhDkyP@zte.com.cn> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261115004711126EXlXUnHk7NZz7rkWhDkyP@zte.com.cn> On Sun, Nov 15, 2026 at 12:47:11AM +0800, shao.mingyin@zte.com.cn wrote: > From: Shao Mingyin > > mm: snapshot alloc tags in alloc_tag_top_users() to avoid UAF > > alloc_tag_top_users() selects tags under the codetag module-list lock, > then returns raw codetag pointers. __show_mem() dereferences the tags, > their strings and per-CPU counters after that lock has been released. > Concurrent module unloading can invalidate those objects before they > are printed in the OOM or SysRq-m report. > > Copy the selected tags and counters while holding the module-list lock, > and print only the copies. Reuse allocinfo_to_params(), which copies > names into fixed-size buffers and retains at most their last 63 > characters. Preserve the signed comparison used to select the top tags. > > Keep the larger output array static under the existing show_mem lock > to avoid increasing the stack frame. The counters remain approximate > lockless per-CPU observations; the copy protects object lifetime. > > Fixes: 1438d349d16b ("lib: add memory allocations report in show_mem()") > Signed-off-by: Shao Mingyin NAK. this is generated by some AI slopper's script, spamming the kernel. The patches I looked at were wrong/broken, so no to anything from this person. They've sent 300 mails in under four weeks spanniing: ata, scsi, target, ufs, nvme/nvmet, ubifs, ublk, zloop, dm, md, mmc, virtio-blk, mfd, gpio, pwm, spi, PCI, ASoC, ACPI, net, vfs mount, block partitions, and now mm. and 17 series across 7 subsystems over the past 23 hours. We need a way to ban emails from people like this... -- Cheers, Lorenzo