Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1300912lql; Tue, 12 Mar 2024 12:58:02 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUKUz5Zu3rUFI5ib9kf+OwbW3nIgIWPqzfhRL0DHRtGDnJttSN06+OxTTfy72efB5omO14NAZ86VR7zHdvY87oaNsnUE65XKsDcYvG2mw== X-Google-Smtp-Source: AGHT+IHdm8nhibeLielUuD1B2on/2PUCSYzqmNnkuBzJTU/s36KSQimrvfGJ034mq44ru+lO1mw1 X-Received: by 2002:a2e:890a:0:b0:2d2:c3ba:fe26 with SMTP id d10-20020a2e890a000000b002d2c3bafe26mr6352121lji.48.1710273481931; Tue, 12 Mar 2024 12:58:01 -0700 (PDT) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id bl5-20020a056402210500b0056763d0295dsi3748250edb.333.2024.03.12.12.58.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 12:58:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100732-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@google.com header.s=20230601 header.b=n9SkdvBC; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-100732-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100732-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=REJECT sp=REJECT dis=REJECT) header.from=google.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id AE8841F24F16 for ; Tue, 12 Mar 2024 19:57:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0729C1428F6; Tue, 12 Mar 2024 19:57:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="n9SkdvBC" Received: from mail-yw1-f174.google.com (mail-yw1-f174.google.com [209.85.128.174]) (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 07C53142648 for ; Tue, 12 Mar 2024 19:57:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710273432; cv=none; b=KdwTHnK6EwNh1lUByzNSzOgpJmKt71TnlUBgUWQjwpWKu5/vqXdHe8E9SIx4ebGBrtlWK8jFoA3F9HzCdIU/A673MhsECFtKQW9iv3WvndvwJcmNQJqFFOy35Ywmn/0jpmopclxO0cuSX08B+rYb7F/jQnvF0m+QhnlCnCFIfQ0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710273432; c=relaxed/simple; bh=0aWGvxVmbgp4kFphrT5DgrMJEPHTfdbj9FAM43oX9JA=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=u6gEikuF32bagjmwMAt7Tvu0Z/VeNr62anUETh7BX5JMdaWFSiskgw60cuasgKrubahCnF1H2wrENc7UPI8yoqV1aGJ2IqsUd4a0qFEM9dChyed67N70Pd6xCEoV0qzQ91ogczCUp/HBn4OBPsVIh5xLlSz3WRWv2WGQwlyfHA0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=n9SkdvBC; arc=none smtp.client-ip=209.85.128.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-yw1-f174.google.com with SMTP id 00721157ae682-60a0599f647so3316877b3.1 for ; Tue, 12 Mar 2024 12:57:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1710273428; x=1710878228; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=wT+2mjCDEB2wrTUTyTKLuab+xNoniRJZtNtidsDDPI8=; b=n9SkdvBCP29jpiwunTx9H1BR2Ml5UNn8v5otShFLYbK7JyH9MubPTv36E75no1LqDL F087Nx5gd76hBnyWnz1RKILaph74iezHR8dfxhvrNyu4hW+OvUANcVGR85oF6szeI66p LehTfrQIsekB3y0zSlUlFw+k4rC27MANhiDGq5MWUDj0v7p8X/r6xuB6IfOk+yaiotpi 6PNsdZ7oDH/REX+V59tRksPbBVobOBRxA5gTKm3fkVWKTVvVvhW6qkyHeDff6HIEDksZ NyymvyrhhQDYaBGvJfqmaPS8cnXSuEknUF0Um/xxxhDbr2bvMvHMcAwmZuBE64EiPD4M sflQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710273428; x=1710878228; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wT+2mjCDEB2wrTUTyTKLuab+xNoniRJZtNtidsDDPI8=; b=VDA9Bgf4MRLs0vFp2hT1V2rdIDukxNW+eeLt1t+YC6tHyy6ywTaUSUuMZ4160VKNhk S4qj4vjDvBYO1UzlESp9ztz/Njpaf56f9x2meqWxOFQVOYuUTmEJwydU9OqFaTd5ZZit gG55d7A7f9J/DPOX+Et1+sWdMy4ujsQzhADq51VFSEcgc1GEp+LGKPYSI225wR7JbrZI g4tFJFTUgwqPn5M+AV+n/c5YlGGO6BlilahUxHDlggIJwHrLoOVBKBrbItdfXE/41CR+ hJEI3O68hxukulCpnWUMBIC0uadKYonYgxq5YCgYWi2vQ0gGwlIPzl7V2xtOPfONiEB8 VeXw== X-Forwarded-Encrypted: i=1; AJvYcCXnT+BOJCD79KlaGB6ClaKQ8sWUSPFG/EU7yEO0ixD9udmsJeuNLcCYKq7Uxx5wi8m2wW4+HpSVDoMBCv4vCan2L2t3z0bzObFwchqP X-Gm-Message-State: AOJu0YxpaPLyuCrIQXrxDy2gsPKZQmDHlH++5VSiVRZt4OTYYOHI3yrt h3QO1jimiqZw5U8kQvRmvcFJVajt6aAQ3i9M9h/wE2Y68l4JCJvCrlrXYbNqHPmHiY5AuYpaad2 ijW0K49d1z9Kkzki+wVyGb5fKJywXRgfGTW6p X-Received: by 2002:a0d:e885:0:b0:60a:67fb:146 with SMTP id r127-20020a0de885000000b0060a67fb0146mr551414ywe.17.1710273427660; Tue, 12 Mar 2024 12:57:07 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240221194052.927623-1-surenb@google.com> <20240221194052.927623-14-surenb@google.com> In-Reply-To: From: Suren Baghdasaryan Date: Tue, 12 Mar 2024 12:56:54 -0700 Message-ID: Subject: Re: [PATCH v4 13/36] lib: prevent module unloading if memory is not freed To: Luis Chamberlain Cc: Vlastimil Babka , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Mar 12, 2024 at 11:23=E2=80=AFAM 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 t= ags > > > because otherwise, once these allocations are freed, the access to th= eir > > > 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. I replied on the v5 thread here: https://lore.kernel.org/all/20240306182440.2003814-13-surenb@google.com/ Let's continue the discussion in that thread. Thanks! > > Luis