Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1415506lql; Tue, 12 Mar 2024 17:27:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUg0OQjshzV48PbyAOBIQ9SV/L3KMgtaXSjNRiC4f3Owp73mJlc9/URkCY9PqiekMhrtoJCCkq0Lzh2KcWXbp3EeOGaEu79SrDbmSMW8Q== X-Google-Smtp-Source: AGHT+IGM9zjHPvja1RaEw2t7dVrf7g/+9pSKsp7XbmaKXYfj3CX3Ds0Etdz1mLuMqYf4Ghwdv721 X-Received: by 2002:a05:6a20:e608:b0:1a3:1349:8489 with SMTP id my8-20020a056a20e60800b001a313498489mr9733648pzb.30.1710289651274; Tue, 12 Mar 2024 17:27:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710289651; cv=pass; d=google.com; s=arc-20160816; b=M9pqCQY2pg/TIj4TSGphTAEVJ/aGW/06joUPmS/Ka6ZzGn6ImbCfr7aHtcLvtkTVtJ Myye71YRzND6b7NEKw2YQteSF7aqCmHTmgvvjDh+M+XdjRvkJO/pGdQJ1fkJQdUsTu7Q 8jdX9Mn64bvSUziP8X+xX3GT7gh2xLqYBDTogSEblPKOXlyvWVCpf2Uss/HCZr2T58wp lDPoip3pnfTAPLnKdNqfeo0rA4dNscyW30BK7SjKqYKx67q70Jnyin8ydjP8PiM3wYlx HK2txheQ97aM4eMpZkQsFuNqsUBohpnPcYXZZX3fEFUDZoXcZqVWXAGKlvkFyGtHF4Cc IUXQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=xm7GbgXJn9YwnZvlLSry0HH3FBwrqzxic0mWxiDob2w=; fh=bn4TuujawAxSSVHDBNpafHGwExxtearkDlAwhFlJ/jw=; b=QeUYTU/E9ZN2IkvLN0MZB1VEK2vt38d7vQqZHxzYSy8iGRTtVyBYyVdRlKj5zI+mdL IL9HUlacv7tSfNDmO+NJ4SefWeXx6JynV6i5k4d3m5EadQJ5SVsc4lYsU/3993ozZN4X m9ZBFmFpSbwU3kP8B14/+6N3P5EjkQT8fqxZ7zUQEPxiwdotiUVW/e8EvvoYwOMQTaCY znCwgz4usPPuCausqA1ZU5mYpOMGjvaK7TKBtm8WRNw1k1CI+tsuJ/jCQIhi1Ym1gORm XwpMkdiv2SYQqzvHisWCXVhePoVEto/vwl8/2Ck1UcioJs8GnnElnM8P2i1uKmHjt2CS VY8Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=OTp6Uakl; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-100653-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100653-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id g11-20020a17090a578b00b0029bd899e7basi319802pji.114.2024.03.12.17.27.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 17:27:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100653-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=@infradead.org header.s=bombadil.20210309 header.b=OTp6Uakl; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-100653-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100653-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 B92102854CD for ; Tue, 12 Mar 2024 18:24:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9A45A139597; Tue, 12 Mar 2024 18:24:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="OTp6Uakl" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 8D5A1273FC; Tue, 12 Mar 2024 18:24:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710267844; cv=none; b=qcRAbjENUUjcUV4q0fzTyQ7T1RCH0uOnyBgda54FRPK+Q8xB6sFyFLnPOXUSXvA/KZ56zWf1yC3y6ruq95ipi0f2TJ+4ybjonBgc0IyWl4mYYD5xS2HuscWQTbRj4JNHts9HiiqNerY8InAo0vj+zYUA7KPO3NeW8bY16aZKbwU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710267844; c=relaxed/simple; bh=gj54TXLGtoqUu8AMVdjcFZZuTsEkjN88snjO6zTDCi8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Pd7BZ7r4Eat7ZiHA8dYuD6gawRgXDehseu3UvCmWA63AY28hm5mlwpD5Ei6LXMR/PMGVYq7Njw3I/clBNx/KzqYXjxx5CvjEgO53BCmB+D5i4eJantf2uQ4zzXzOx52829zdC4bpqMdgdKJ6B+ywRONHfD53GSJLjW8M5Gxbqds= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=OTp6Uakl; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=xm7GbgXJn9YwnZvlLSry0HH3FBwrqzxic0mWxiDob2w=; b=OTp6UaklGT+zH4v4znpg1opiV8 NB3qzGKgQ392B3qikqglBFCsBTZ/ITN3RepSR8mfOqliJyZ8P6vPZWkEucocxDznHbj4Q8NfZfSky r5hTRDUZtyzJbyw73C5MTADF9M6rbHpyplQ1wQIgs9XZNG9ePr9M66bkibeHQOOlcLP3fMH9P6+hi rkYDd5T5ESp2blS0iNFsOmZsRFfyoXXGyEpntSNeY3aC4c03h5T8VeDIou+zIEnxN5h/BV6aPJXxC 2GVLUijB40Xr9Z48KdwiQJqHSi94QEkQDxVUzv/muVg34lq8ha3PURBB6fDGIIcoOPe8F6nKukVgT Lo3t+Kmg==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rk6mv-000000076Ob-0eEr; Tue, 12 Mar 2024 18:23:45 +0000 Date: Tue, 12 Mar 2024 11:23:45 -0700 From: Luis Chamberlain To: Vlastimil Babka Cc: Suren Baghdasaryan , akpm@linux-foundation.org, kent.overstreet@linux.dev, 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: Sender: Luis Chamberlain 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. Luis