public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] perf/arm: Add missing .suppress_bind_attrs
@ 2025-07-02 14:08 Robin Murphy
  2025-07-02 14:54 ` Leo Yan
  2025-07-04 17:44 ` Will Deacon
  0 siblings, 2 replies; 3+ messages in thread
From: Robin Murphy @ 2025-07-02 14:08 UTC (permalink / raw)
  To: will; +Cc: mark.rutland, linux-perf-users, linux-arm-kernel

PMU drivers should set .suppress_bind_attrs so that userspace is denied
the opportunity to pull the driver out from underneath an in-use PMU
(with predictably unpleasant consequences). Somehow both the CMN and NI
drivers have managed to miss this; put that right.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 drivers/perf/arm-cmn.c | 1 +
 drivers/perf/arm-ni.c  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c
index 031d45d0fe3d..d1df2f3adbc5 100644
--- a/drivers/perf/arm-cmn.c
+++ b/drivers/perf/arm-cmn.c
@@ -2655,6 +2655,7 @@ static struct platform_driver arm_cmn_driver = {
 		.name = "arm-cmn",
 		.of_match_table = of_match_ptr(arm_cmn_of_match),
 		.acpi_match_table = ACPI_PTR(arm_cmn_acpi_match),
+		.suppress_bind_attrs = true,
 	},
 	.probe = arm_cmn_probe,
 	.remove = arm_cmn_remove,
diff --git a/drivers/perf/arm-ni.c b/drivers/perf/arm-ni.c
index de7b6cce4d68..5f20baf59024 100644
--- a/drivers/perf/arm-ni.c
+++ b/drivers/perf/arm-ni.c
@@ -707,6 +707,7 @@ static struct platform_driver arm_ni_driver = {
 		.name = "arm-ni",
 		.of_match_table = of_match_ptr(arm_ni_of_match),
 		.acpi_match_table = ACPI_PTR(arm_ni_acpi_match),
+		.suppress_bind_attrs = true,
 	},
 	.probe = arm_ni_probe,
 	.remove = arm_ni_remove,
-- 
2.39.2.101.g768bb238c484.dirty



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf/arm: Add missing .suppress_bind_attrs
  2025-07-02 14:08 [PATCH] perf/arm: Add missing .suppress_bind_attrs Robin Murphy
@ 2025-07-02 14:54 ` Leo Yan
  2025-07-04 17:44 ` Will Deacon
  1 sibling, 0 replies; 3+ messages in thread
From: Leo Yan @ 2025-07-02 14:54 UTC (permalink / raw)
  To: Robin Murphy; +Cc: will, mark.rutland, linux-perf-users, linux-arm-kernel

On Wed, Jul 02, 2025 at 03:08:13PM +0100, Robin Murphy wrote:
> PMU drivers should set .suppress_bind_attrs so that userspace is denied
> the opportunity to pull the driver out from underneath an in-use PMU
> (with predictably unpleasant consequences). Somehow both the CMN and NI
> drivers have managed to miss this; put that right.
> 
> Signed-off-by: Robin Murphy <robin.murphy@arm.com>

Reviewed-by: Leo Yan <leo.yan@arm.com>

> ---
>  drivers/perf/arm-cmn.c | 1 +
>  drivers/perf/arm-ni.c  | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c
> index 031d45d0fe3d..d1df2f3adbc5 100644
> --- a/drivers/perf/arm-cmn.c
> +++ b/drivers/perf/arm-cmn.c
> @@ -2655,6 +2655,7 @@ static struct platform_driver arm_cmn_driver = {
>  		.name = "arm-cmn",
>  		.of_match_table = of_match_ptr(arm_cmn_of_match),
>  		.acpi_match_table = ACPI_PTR(arm_cmn_acpi_match),
> +		.suppress_bind_attrs = true,
>  	},
>  	.probe = arm_cmn_probe,
>  	.remove = arm_cmn_remove,
> diff --git a/drivers/perf/arm-ni.c b/drivers/perf/arm-ni.c
> index de7b6cce4d68..5f20baf59024 100644
> --- a/drivers/perf/arm-ni.c
> +++ b/drivers/perf/arm-ni.c
> @@ -707,6 +707,7 @@ static struct platform_driver arm_ni_driver = {
>  		.name = "arm-ni",
>  		.of_match_table = of_match_ptr(arm_ni_of_match),
>  		.acpi_match_table = ACPI_PTR(arm_ni_acpi_match),
> +		.suppress_bind_attrs = true,
>  	},
>  	.probe = arm_ni_probe,
>  	.remove = arm_ni_remove,
> -- 
> 2.39.2.101.g768bb238c484.dirty
> 
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf/arm: Add missing .suppress_bind_attrs
  2025-07-02 14:08 [PATCH] perf/arm: Add missing .suppress_bind_attrs Robin Murphy
  2025-07-02 14:54 ` Leo Yan
@ 2025-07-04 17:44 ` Will Deacon
  1 sibling, 0 replies; 3+ messages in thread
From: Will Deacon @ 2025-07-04 17:44 UTC (permalink / raw)
  To: Robin Murphy
  Cc: catalin.marinas, kernel-team, Will Deacon, mark.rutland,
	linux-perf-users, linux-arm-kernel

On Wed, 02 Jul 2025 15:08:13 +0100, Robin Murphy wrote:
> PMU drivers should set .suppress_bind_attrs so that userspace is denied
> the opportunity to pull the driver out from underneath an in-use PMU
> (with predictably unpleasant consequences). Somehow both the CMN and NI
> drivers have managed to miss this; put that right.
> 
> 

Applied to will (for-next/perf), thanks!

[1/1] perf/arm: Add missing .suppress_bind_attrs
      https://git.kernel.org/will/c/860a831de138

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-07-04 18:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-02 14:08 [PATCH] perf/arm: Add missing .suppress_bind_attrs Robin Murphy
2025-07-02 14:54 ` Leo Yan
2025-07-04 17:44 ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox