Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1307056lql; Tue, 12 Mar 2024 13:08:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWNvk598QhREStTbHDu5wHNJHd0TyV2U/TONOeauAfeJDk5UBDzKE/+wLHeu2ZMeHJIB153TEhm6BsDcR+3ZNzRHPVC0o/cNlpwzHWhsw== X-Google-Smtp-Source: AGHT+IFbwhsvfeEd3VxPs1RqVRYpAQCyfGd0AOCK3Ev3YM02igFX1OOpZhgTP5c8WQZW5UmdN6E1 X-Received: by 2002:a05:6e02:152c:b0:365:d8a:21e0 with SMTP id i12-20020a056e02152c00b003650d8a21e0mr15189880ilu.21.1710274107043; Tue, 12 Mar 2024 13:08:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710274107; cv=pass; d=google.com; s=arc-20160816; b=HU4Yki5ZGE38sVFbyv+Fls9AKe3SFgA/hWvcJJ1h4JISN9dwxnAh8PGPxlLbrxpJYJ ZV0XEo3Y7zYFJFchv6YoSSj+RdKbJqF4tOdpR8PxbvYN09JbfFd3Jr4OymPBAfUasrpN WCxZiu2q4TqxllmiICcx1N+DohQ8tWG6K+SnhTZXZDENk1/s0VKgFuTqV64mjtdnTnrd MoczUEvFlvzhXtQzfDCvHorpvuDKgrQ8i76E1Bdis9SpRHxcVVL+fKzTiGwSD1JxZqLJ 3AT845xj0lHPVqS3gx184ZPwHS6ZJjUaUPuvEQ1CPwV+LhuU+xVdCjWe7tVM0cS9Z+RY ju2w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:date; bh=yVCYd35eicxoyDwHWZ5Xnl3STwUduIDprFGFDUbtbK8=; fh=vlWpBTSR2vxZ1fnEB2bt4fl5hg5SeTvkiFDS2bJYuk8=; b=O3BO8d+sMXH5u33gzFeeMZOy4sVAjG2gg8kEjmPIhzF3hBIYbpn6MXWpm15UoYQoep exGwaCtywXdc9tJ0MqKwo+/2+wpz6Uf5xJtgERsl0WFF3RfqtyCiLH/ibAqprrCU4Z5c w8SID2uEdBJTBlijY2te8PiIGt8/NqrHCuWz3OuK5acUbN1JWFDjPPn1efqXWA8LNRX3 J6l28UeSmDssc5foCAIN3NsQgCq0ZS4mG1E1gwDpYXJoec/HF+gZG07MCl2Lf3+uJ07C a7igjGjzFQHCsFfFcRFw4eHAdIxeQXdTO+XuIsCyNFDNc9vClU2Qwr3WrkDQ5mbPbjqp 2Y8Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=fGa0rx+R; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-100744-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100744-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id a3-20020a630b43000000b005dc48827a3asi7261246pgl.227.2024.03.12.13.08.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 13:08:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100744-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=fGa0rx+R; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-100744-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100744-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id AFAC1283D3F for ; Tue, 12 Mar 2024 20:08:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A24BD142910; Tue, 12 Mar 2024 20:08:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="fGa0rx+R" Received: from out-176.mta0.migadu.com (out-176.mta0.migadu.com [91.218.175.176]) (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 2900E1428E8 for ; Tue, 12 Mar 2024 20:08:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710274095; cv=none; b=OKbStZxRqO9kUwyNz9vu5eu9jDpP1SgYG2C8/fzg0K1/Nc6W+RCWn9N27Cd7roSAOMtAutDuQ9O6cdEJp3ps1btUbMvuFshe1FZMhA8cyR58zLX7AxchPYALeAdmxgJJtsoW29BBB7MGtItxWHr4HcopOT8zO+TZEGOwrff5cA4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710274095; c=relaxed/simple; bh=RLEUuRERIJXBaD1m7rMV8MoNRD7PPHojZhDIQsbKve8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=k7x1dkwY+cCkIgZ3IlQEVJjoVszYUoeIecgy29dhIBTMCp/euewh5eVtS4Nw9bxqiXjJur4y94QAA2W5S32xqqnV1NQ6IrJdDwLhrQmo2rZD24vkfyNFphyFjwk3zS117PniBcEw61isnJy38F3i1EvZlHsdh//YA683dZEu/50= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=fGa0rx+R; arc=none smtp.client-ip=91.218.175.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Tue, 12 Mar 2024 16:07:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1710274089; 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: in-reply-to:in-reply-to:references:references; bh=yVCYd35eicxoyDwHWZ5Xnl3STwUduIDprFGFDUbtbK8=; b=fGa0rx+RU9H7yzOC8eKrKFu17a+94OmM+4cytPi0Sy37phzuaEQ+GhJUBfxmO2TO/xIFcf bikGmTAjXGkm74EXvCd4e8T8K55apzctaN+Uuym6RjHufYvesaQ3hOpfnYjJpKv9uZ5LaK qVqU7WfUOZtpXPBVr1A9ajf9sgP3KCk= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Luis Chamberlain Cc: Vlastimil Babka , Suren Baghdasaryan , akpm@linux-foundation.org, mhocko@suse.com, hannes@cmpxchg.org, roman.gushchin@linux.dev, mgorman@suse.de, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, penguin-kernel@i-love.sakura.ne.jp, corbet@lwn.net, void@manifault.com, peterz@infradead.org, juri.lelli@redhat.com, catalin.marinas@arm.com, will@kernel.org, arnd@arndb.de, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, peterx@redhat.com, david@redhat.com, axboe@kernel.dk, masahiroy@kernel.org, nathan@kernel.org, dennis@kernel.org, tj@kernel.org, muchun.song@linux.dev, rppt@kernel.org, paulmck@kernel.org, pasha.tatashin@soleen.com, yosryahmed@google.com, yuzhao@google.com, dhowells@redhat.com, hughd@google.com, andreyknvl@gmail.com, keescook@chromium.org, ndesaulniers@google.com, vvvvvv@google.com, gregkh@linuxfoundation.org, ebiggers@google.com, ytcoode@gmail.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, bristot@redhat.com, vschneid@redhat.com, cl@linux.com, penberg@kernel.org, iamjoonsoo.kim@lge.com, 42.hyeyoo@gmail.com, glider@google.com, elver@google.com, dvyukov@google.com, shakeelb@google.com, songmuchun@bytedance.com, jbaron@akamai.com, rientjes@google.com, minchan@google.com, kaleshsingh@google.com, kernel-team@android.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, linux-arch@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, kasan-dev@googlegroups.com, cgroups@vger.kernel.org Subject: Re: [PATCH v4 13/36] lib: prevent module unloading if memory is not freed Message-ID: References: <20240221194052.927623-1-surenb@google.com> <20240221194052.927623-14-surenb@google.com> 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-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT On Tue, Mar 12, 2024 at 11:23:45AM -0700, Luis Chamberlain wrote: > On Mon, Feb 26, 2024 at 05:58:40PM +0100, Vlastimil Babka wrote: > > On 2/21/24 20:40, Suren Baghdasaryan wrote: > > > Skip freeing module's data section if there are non-zero allocation tags > > > because otherwise, once these allocations are freed, the access to their > > > code tag would cause UAF. > > > > > > Signed-off-by: Suren Baghdasaryan > > > > I know that module unloading was never considered really supported etc. > > If its not supported then we should not have it on modules. Module > loading and unloading should just work, otherwise then this should not > work with modules and leave them in a zombie state. Not have memory allocation profiling on modules?