From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej2-f43.google.com (mail-ej2-f43.google.com [74.125.228.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D1F4334692 for ; Wed, 30 Sep 2026 08:34:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.228.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790757256; cv=none; b=fM7DMLAftIWwcNk855LhY4aoqTNd+v2XaeYnNHG0uiWAgJECi28MHumm0lqcaT90h99eAfA00XjjW89Xf69BF10wmfwLOsvxuNTwGZln4rN4FlWS5z/RTIcakxKhjXLdzYj3faUt7I+TC9tRmqW+I3VrKl6U+ypRz4F97cJoJZM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790757256; c=relaxed/simple; bh=pmdUtLHiDBYPwdKz6lOBEihhJVlCk8853EgW8s9fCWc=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JRjwJIuJxYxCqHnDgvFBDw+5OHraYIPI60bEsxab7vZjLKfhqEUlrxjyVJkDrEenpI2120Ep2NmiZbi9/4Lfycr6OkbanDZhN4cGHEkjXAlG41oJe/wdiPsGauaoo9fsQGmtTy7F+SbPG6Nt3gnDSamWpCScir9Tz2AR0oE07kg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=i7KGKPAX; arc=none smtp.client-ip=74.125.228.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="i7KGKPAX" Received: by mail-ej2-f43.google.com with SMTP id a640c23a62f3a-c2af3701927so768689666b.3 for ; Wed, 30 Sep 2026 01:34:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1790757247; x=1791362047; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:date :from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=uQBLg1lOxnEKgr89MFlKuWhU+DKGispKKqyorNYQTaM=; b=i7KGKPAXmt+ZuptqaIzfIC3G6alJDnPdCO+Iy+N9tGHabaik0MKSu9XENv3X6z9nbi hthoqZ5J9eZi/sXH42cZsOpzE0tpcaxB6Q2aZwm2nsmWn0lTA9Am6Z7NtBO7mTRI0tBh A1Q8yqlOyK0YbpcsEl/3jiASAWVRVj2fdqAriZE9lmoUMbbrTqAFb3hF5F19j+NqYMiM sxZ+pCLJnoa/q39n4UefNPrsqjao3vwl2ori7MIUzj2vUpCJbSyKoxZuM8aQMocKimqF 0H15Umgwf51PcgyWyroXUUlVCJjba6ERy50K2CvQ9I7vFE6U/f88AAZIqZIo3RGgCbh7 ewUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790757247; x=1791362047; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:date :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=uQBLg1lOxnEKgr89MFlKuWhU+DKGispKKqyorNYQTaM=; b=JkC9oFpWcAdR4+i57c/M9gsgV4E6EE6NhxN43YXyU7eb8iLkuaKMba218rM8DK0Wa3 tf03OLsgsRcZcBFQQUR3FB9kw57IpdQXoeWK8c0wpf4pjymJM4fLl7Vu1yIby3n+FZGG biPqzdNTqEBjy3f1uEwSJyfGTFnQXa4SYasKlDKaoeHjFXsu5Q4WWy4fswGrA5D6kz56 o1srCahqfnoPLXk9MkuZjjQnqVsIVbtxx3F3DFErdc9vGYw7I8jUcC28ulaaTciOiiH+ uWRY1m+HS1P7xBEemPh72X1N+kAznnWyAJr9T8+347fMxRzQ3Le+cnDFRv1FwA+o78Kv FrlQ== X-Forwarded-Encrypted: i=1; AKwUvBz6+Jqb5RQFHH+JyA0b/KW3PePb2SHhWxXl8eq2U7f8qKq0IaHifg+0+25OBBMnk2VDJs5JNTOuN1gUd2Q=@vger.kernel.org X-Gm-Message-State: AFq9FYL9EO6yCAIQCTRT6n5qaOfGj164VKIXB4pAC5OyaDGZZdGq/7cQ lzqNDz8pT3E/j1md6S7sj+VN6mj1Zt14lnLqrLDRYa3XamUf8QFPCWFF X-Gm-Gg: AYBFou2ftnoHYs1fJGDeliyW0rHtlUiXyzPFpZbvCMR48phyYHWibVkslWRFEaYqXxq qHcyIsD9Fd0lGK5XqiVlJAhkk8tuz3wGff2B7z4NTGSlITe0Dn5fM/3UqlAJpFvrXJttdwFq7Zd 8SmNOsouqtoB3AM1PCcXnZYRtJ1xOJ8NXf+ImflnwDlU8vNXbildjSKng/YJsc6xcnDkmIgRL4y DVbLQLHgaoO4VqHkexn1OwxcSpRi8TXtcsP351hVh84Vfymh3I6pyENnXJyx4sVVEXxg2dZjPdw JzuSzL4nYrdi8/42HTNQd+UXO8s61YbVMnXDPN84FiK9M/PNgMXnr/jgLU1ynX2alGGpuelnT43 DK5k39WKfafJpPYnY+lX1/SbIi9HLXJBFMhgVynFT65IztAKUHAQ/5uLuJ/CGlUQCtloMQi52iO XgPw2285FqG8cUU96dJkMdT+e+viBfTdKghcK9 X-Received: by 2002:a17:907:3f18:b0:c2d:d89d:346a with SMTP id a640c23a62f3a-c2e23663b74mr51705266b.3.1790757246934; Wed, 30 Sep 2026 01:34:06 -0700 (PDT) Received: from milan ([2001:9b1:d5a0:a500::24b]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c2e22fa41e8sm27570366b.55.2026.09.30.01.34.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Sep 2026 01:34:06 -0700 (PDT) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Wed, 30 Sep 2026 10:34:03 +0200 To: Hao Ge Cc: Suren Baghdasaryan , Andrew Morton , Kent Overstreet , Luis Chamberlain , Petr Pavlu , Daniel Gomez , Sami Tolvanen , Aaron Tomlin , Alexander Potapenko , Marco Elver , Dmitry Vyukov , Vlastimil Babka , Michal Hocko , Brendan Jackman , Johannes Weiner , Zi Yan , Uladzislau Rezki , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, kasan-dev@googlegroups.com Subject: Re: [PATCH v11 0/7] alloc_tag and module codetag section fixes Message-ID: References: <20260929082014.160587-1-hao.ge@linux.dev> <20260929134401.a1a385ff4369661f879b5d2f@linux-foundation.org> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Sep 30, 2026 at 11:26:41AM +0800, Hao Ge wrote: > Hi Suren and Andrew > > > On 2026/9/30 10:39, Suren Baghdasaryan wrote: > > On Tue, Sep 29, 2026 at 8:44 PM Andrew Morton wrote: > >> > >> On Tue, 29 Sep 2026 16:20:07 +0800 Hao Ge wrote: > >> > >>> With profiling toggled off, the overflow check in > >>> reserve_module_tags() did not run, a module could load with more > >>> tags than the page flags can address, and re-enabling profiling > >>> then silently corrupted /proc/allocinfo. On overflow the fix shuts > >>> profiling down, releases the reservation and returns -EAGAIN, and > >>> the codetag section lands as regular module data in the same load, > >>> so the module loads without profiling. > >>> > >>> Review of the earlier series by Sashiko turned up more problems. > >>> > >>> One is a race. layout_sections() and move_module() both asked > >>> codetag_needs_module_section() where a codetag section goes, and > >>> mem_profiling_support can change between the two calls, for instance > >>> when another module load overflows the tag index and shuts profiling > >>> down. move_module() then copied the codetag section to offset 0 of > >>> its regular destination and clobbered the first section placed in > >>> that region. > >>> > >>> v7 reworks where codetag sections are allocated, on a prototype by > >>> Petr Pavlu [1]. The allocation runs before layout_sections() and the > >>> placement is decided in one step, so nothing re-asks the question > >>> and the race is gone. The retry is gone too, on -EAGAIN the section > >>> is laid out as regular module data right in the same load. > >> > >> Thanks. > >> > >> Seven patches, all cc:stable. Why is a backport proposed? > >> Documentation/process/stable-kernel-rules.rst gives guidelines - does > >> this series meet them? Does Suren have thoughts? > > Thanks, I've just gone through this carefully. > > > > > I think vmalloc fix in patch#2 should be posted separately and clearly > > quialifies for backporting as if fixes issues Hao found at [1]. > > Agreed. Patch #2 was added to this patch series because vm_module_tags_populate > suffers from the same issue. If we want to be more conservative, I'd prefer to keep > vm_module_tags_populate as it was in V10: > https://lore.kernel.org/all/20260915070001.113559-3-hao.ge@linux.dev/ > > Then we can submit a fix for __GFP_NOFAIL retry loop in __vmalloc_area_node() as a hotfix together > with our new patch #2. While at it, we can also check if there are any unnecessary calls to > vunmap_range family functions that can be cleaned up now that patch #2 is applied. > Yep, this should be a separate fix for vmalloc. -- Uladzislau Rezki