From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 998644570DC for ; Thu, 6 Aug 2026 14:46:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786027609; cv=none; b=N1yKbikEs87gv2hCnPk1gNdZ/FITCWbbl59xO6/jVasI1OIk8c2Zkfk1fn1uDUzuxlgI0PrLf+uv0n+WI/Qvq4MXjAWZxKao+3+n6S+cjjuetVjAJT1oryn/YhIVrGjY3DpaOToEHo2EY3xEVd8wcN3cx8l2sWwRmvnfP8eteCk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786027609; c=relaxed/simple; bh=KpzBNNdjie/RT5x1nlv2BU0lhNMLTEMSa3pYVPX9Ksg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kgnA1eLuAU2pIXpubwRAfFIsunnNALfW4lyCyYspRURuzTcFEDd7OvkVzCxgwkiMpFHC1jQ5sPPQtg/5YtQYIUtoRstvo5xe0jd6LNniQKHCrXNNEJFDZ0aXW8v2mWsQXoLKG0ejYAwMiay7h+lc7gcEfCNsHJWcWT8VLGH/tNA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=RmRxN+14; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="RmRxN+14" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0AE4B1A25; Thu, 6 Aug 2026 07:46:43 -0700 (PDT) Received: from e134344.cambridge.arm.com (e134344.arm.com [10.2.212.8]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 704183F9A2; Thu, 6 Aug 2026 07:46:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1786027607; bh=KpzBNNdjie/RT5x1nlv2BU0lhNMLTEMSa3pYVPX9Ksg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RmRxN+14Fh8+XZre+iNVDUkx6Ja/a4Z57JnwfU82wpvaYX+kwQP34IAFqhvSjmYZi Hxf0AWMhIfnxm2S3pBzqS0/+/XjtH4LS1JzzJlbFIf8PzMhfS3kS0oUG4yuo+vDuWz Tu1mdld5OK150e7TPFhxJF4kjwVm7YjeqVQoCWzI= From: Ben Horgan To: ben.horgan@arm.com Cc: james.morse@arm.com, reinette.chatre@intel.com, fenghuay@nvidia.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dave.martin@arm.com, andre.przywara@arm.com, will@kernel.org, catalin.marinas@kernel.org Subject: [PATCH v1 2/2] arm_mpam: Disable driver unbind to avoid UAF Date: Thu, 6 Aug 2026 15:46:31 +0100 Message-ID: <20260806144631.2502918-3-ben.horgan@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260806144631.2502918-1-ben.horgan@arm.com> References: <20260806144631.2502918-1-ben.horgan@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit When a user unbinds an MSC and that MSC is the only MSC left for a component then the corresponding mpam_component will be freed. If the user then goes on to read the schemata file in the resctrl filesystem then the mpam_component will be accessed from resctrl_arch_get_config() leading to a use after free. As the MPAM driver is not a module the unbind sysfs interface is the only way to trigger the remove. Instead of dealing with the complexity of allowing some unused MSC to unbind just remove the unbind sysfs interface. Fixes: f04046f2577a ("arm_mpam: Add probe/remove for mpam msc driver and kbuild boiler plate") Signed-off-by: Ben Horgan --- drivers/resctrl/mpam_devices.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c index bc6cc0b5c96b..e888de8d4896 100644 --- a/drivers/resctrl/mpam_devices.c +++ b/drivers/resctrl/mpam_devices.c @@ -2141,6 +2141,7 @@ static int mpam_msc_drv_probe(struct platform_device *pdev) static struct platform_driver mpam_msc_driver = { .driver = { .name = "mpam_msc", + .suppress_bind_attrs = true, }, .probe = mpam_msc_drv_probe, .remove = mpam_msc_drv_remove, -- 2.43.0