* [PATCH 2/2] driver core: remove device_change_owner() export
2026-02-05 13:09 [PATCH 1/2] sysfs: remove exports of sysfs_*change_owner() Greg Kroah-Hartman
@ 2026-02-05 13:09 ` Greg Kroah-Hartman
2026-02-05 13:15 ` Danilo Krummrich
2026-02-05 13:39 ` Rafael J. Wysocki
2026-02-05 13:15 ` [PATCH 1/2] sysfs: remove exports of sysfs_*change_owner() Danilo Krummrich
` (2 subsequent siblings)
3 siblings, 2 replies; 7+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-05 13:09 UTC (permalink / raw)
To: rafael, dakr; +Cc: driver-core, linux-kernel, Greg Kroah-Hartman
The function, device_change_owner() is exported for modules to use,
but there are no in-kernel users of it, so remove the export to prevent
out-of-tree code from thinking this is a safe function to call.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/base/core.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 40de2f51a1b1..f599a1384eec 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -4781,7 +4781,6 @@ int device_change_owner(struct device *dev, kuid_t kuid, kgid_t kgid)
put_device(dev);
return error;
}
-EXPORT_SYMBOL_GPL(device_change_owner);
/**
* device_shutdown - call ->shutdown() on each device to shutdown.
--
2.53.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH 2/2] driver core: remove device_change_owner() export
2026-02-05 13:09 ` [PATCH 2/2] driver core: remove device_change_owner() export Greg Kroah-Hartman
@ 2026-02-05 13:15 ` Danilo Krummrich
2026-02-05 13:39 ` Rafael J. Wysocki
1 sibling, 0 replies; 7+ messages in thread
From: Danilo Krummrich @ 2026-02-05 13:15 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: rafael, driver-core, linux-kernel
On Thu Feb 5, 2026 at 2:09 PM CET, Greg Kroah-Hartman wrote:
> The function, device_change_owner() is exported for modules to use,
> but there are no in-kernel users of it, so remove the export to prevent
> out-of-tree code from thinking this is a safe function to call.
>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Danilo Krummrich <dakr@kernel.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] driver core: remove device_change_owner() export
2026-02-05 13:09 ` [PATCH 2/2] driver core: remove device_change_owner() export Greg Kroah-Hartman
2026-02-05 13:15 ` Danilo Krummrich
@ 2026-02-05 13:39 ` Rafael J. Wysocki
1 sibling, 0 replies; 7+ messages in thread
From: Rafael J. Wysocki @ 2026-02-05 13:39 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: rafael, dakr, driver-core, linux-kernel
On Thu, Feb 5, 2026 at 2:09 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> The function, device_change_owner() is exported for modules to use,
> but there are no in-kernel users of it, so remove the export to prevent
> out-of-tree code from thinking this is a safe function to call.
>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Rafael J. Wysocki (Intel) <rafael@kernel.org>
> ---
> drivers/base/core.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index 40de2f51a1b1..f599a1384eec 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -4781,7 +4781,6 @@ int device_change_owner(struct device *dev, kuid_t kuid, kgid_t kgid)
> put_device(dev);
> return error;
> }
> -EXPORT_SYMBOL_GPL(device_change_owner);
>
> /**
> * device_shutdown - call ->shutdown() on each device to shutdown.
> --
> 2.53.0
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] sysfs: remove exports of sysfs_*change_owner()
2026-02-05 13:09 [PATCH 1/2] sysfs: remove exports of sysfs_*change_owner() Greg Kroah-Hartman
2026-02-05 13:09 ` [PATCH 2/2] driver core: remove device_change_owner() export Greg Kroah-Hartman
@ 2026-02-05 13:15 ` Danilo Krummrich
2026-02-05 13:38 ` Rafael J. Wysocki
2026-02-05 14:35 ` Lee Jones
3 siblings, 0 replies; 7+ messages in thread
From: Danilo Krummrich @ 2026-02-05 13:15 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: rafael, driver-core, linux-kernel
On Thu Feb 5, 2026 at 2:09 PM CET, Greg Kroah-Hartman wrote:
> Both sysfs_change_owner() and sysfs_file_change_owner() are exported to
> modules, but there are no in-kernel module users, so remove the exports
> so that crazy out-of-tree drivers don't get the impression that it is
> safe to call these functions at all.
>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Danilo Krummrich <dakr@kernel.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] sysfs: remove exports of sysfs_*change_owner()
2026-02-05 13:09 [PATCH 1/2] sysfs: remove exports of sysfs_*change_owner() Greg Kroah-Hartman
2026-02-05 13:09 ` [PATCH 2/2] driver core: remove device_change_owner() export Greg Kroah-Hartman
2026-02-05 13:15 ` [PATCH 1/2] sysfs: remove exports of sysfs_*change_owner() Danilo Krummrich
@ 2026-02-05 13:38 ` Rafael J. Wysocki
2026-02-05 14:35 ` Lee Jones
3 siblings, 0 replies; 7+ messages in thread
From: Rafael J. Wysocki @ 2026-02-05 13:38 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: rafael, dakr, driver-core, linux-kernel
On Thu, Feb 5, 2026 at 2:09 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> Both sysfs_change_owner() and sysfs_file_change_owner() are exported to
> modules, but there are no in-kernel module users, so remove the exports
> so that crazy out-of-tree drivers don't get the impression that it is
> safe to call these functions at all.
>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Rafael J. Wysocki (Intel) <rafael@kernel.org>
> ---
> fs/sysfs/file.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
> index 3825e780cc58..a8176c875f55 100644
> --- a/fs/sysfs/file.c
> +++ b/fs/sysfs/file.c
> @@ -689,7 +689,6 @@ int sysfs_file_change_owner(struct kobject *kobj, const char *name, kuid_t kuid,
>
> return error;
> }
> -EXPORT_SYMBOL_GPL(sysfs_file_change_owner);
>
> /**
> * sysfs_change_owner - change owner of the given object.
> @@ -736,7 +735,6 @@ int sysfs_change_owner(struct kobject *kobj, kuid_t kuid, kgid_t kgid)
>
> return 0;
> }
> -EXPORT_SYMBOL_GPL(sysfs_change_owner);
>
> /**
> * sysfs_emit - scnprintf equivalent, aware of PAGE_SIZE buffer.
> --
> 2.53.0
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] sysfs: remove exports of sysfs_*change_owner()
2026-02-05 13:09 [PATCH 1/2] sysfs: remove exports of sysfs_*change_owner() Greg Kroah-Hartman
` (2 preceding siblings ...)
2026-02-05 13:38 ` Rafael J. Wysocki
@ 2026-02-05 14:35 ` Lee Jones
3 siblings, 0 replies; 7+ messages in thread
From: Lee Jones @ 2026-02-05 14:35 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: rafael, dakr, driver-core, linux-kernel
On Thu, 05 Feb 2026, Greg Kroah-Hartman wrote:
> Both sysfs_change_owner() and sysfs_file_change_owner() are exported to
> modules, but there are no in-kernel module users, so remove the exports
> so that crazy out-of-tree drivers don't get the impression that it is
> safe to call these functions at all.
>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reported-by: Lee Jones <lee@kernel.org>
Reviewed-by: Lee Jones <lee@kernel.org>
:)
> ---
> fs/sysfs/file.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
> index 3825e780cc58..a8176c875f55 100644
> --- a/fs/sysfs/file.c
> +++ b/fs/sysfs/file.c
> @@ -689,7 +689,6 @@ int sysfs_file_change_owner(struct kobject *kobj, const char *name, kuid_t kuid,
>
> return error;
> }
> -EXPORT_SYMBOL_GPL(sysfs_file_change_owner);
>
> /**
> * sysfs_change_owner - change owner of the given object.
> @@ -736,7 +735,6 @@ int sysfs_change_owner(struct kobject *kobj, kuid_t kuid, kgid_t kgid)
>
> return 0;
> }
> -EXPORT_SYMBOL_GPL(sysfs_change_owner);
>
> /**
> * sysfs_emit - scnprintf equivalent, aware of PAGE_SIZE buffer.
> --
> 2.53.0
>
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 7+ messages in thread