linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] platform/x86/intel/ifs: Annotate work queue on stack so object debug does not complain
@ 2023-05-23 10:54 David Arcari
  2023-05-23 10:57 ` Hans de Goede
  0 siblings, 1 reply; 2+ messages in thread
From: David Arcari @ 2023-05-23 10:54 UTC (permalink / raw)
  To: platform-driver-x86
  Cc: David Arcari, Jithu Joseph, Ashok Raj, Tony Luck, Hans de Goede,
	Mark Gross, Greg Kroah-Hartman, Thomas Gleixner, Dan Williams,
	linux-kernel, stable

Object Debug results in the following warning while attempting to load
ifs firmware:

[  220.007422] ODEBUG: object 000000003bf952db is on stack 00000000e843994b, but NOT annotated.
[  220.007459] ------------[ cut here ]------------
[  220.007461] WARNING: CPU: 0 PID: 11774 at lib/debugobjects.c:548 __debug_object_init.cold+0x22e/0x2d5
[  220.137476] RIP: 0010:__debug_object_init.cold+0x22e/0x2d5
[  220.254774] Call Trace:
[  220.257641]  <TASK>
[  220.265606]  scan_chunks_sanity_check+0x368/0x5f0 [intel_ifs]
[  220.288292]  ifs_load_firmware+0x2a3/0x400 [intel_ifs]
[  220.332793]  current_batch_store+0xea/0x160 [intel_ifs]
[  220.357947]  kernfs_fop_write_iter+0x355/0x530
[  220.363048]  new_sync_write+0x28e/0x4a0
[  220.381226]  vfs_write+0x62a/0x920
[  220.385160]  ksys_write+0xf9/0x1d0
[  220.399421]  do_syscall_64+0x59/0x90
[  220.440635]  entry_SYSCALL_64_after_hwframe+0x63/0xcd
[  220.566845] ---[ end trace 3a01b299db142b41 ]---

Correct this by calling INIT_WORK_ONSTACK instead of INIT_WORK.

Fixes: 684ec215706d ("platform/x86/intel/ifs: Authenticate and copy to secured memory")

Signed-off-by: David Arcari <darcari@redhat.com>
Cc: Jithu Joseph <jithu.joseph@intel.com>
Cc: Ashok Raj <ashok.raj@intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Mark Gross <markgross@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org
---
 drivers/platform/x86/intel/ifs/load.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/intel/ifs/load.c b/drivers/platform/x86/intel/ifs/load.c
index 61dffb4c8a1d..e6ae8265f3a3 100644
--- a/drivers/platform/x86/intel/ifs/load.c
+++ b/drivers/platform/x86/intel/ifs/load.c
@@ -208,7 +208,7 @@ static int scan_chunks_sanity_check(struct device *dev)
 			continue;
 		reinit_completion(&ifs_done);
 		local_work.dev = dev;
-		INIT_WORK(&local_work.w, copy_hashes_authenticate_chunks);
+		INIT_WORK_ONSTACK(&local_work.w, copy_hashes_authenticate_chunks);
 		schedule_work_on(cpu, &local_work.w);
 		wait_for_completion(&ifs_done);
 		if (ifsd->loading_error) {
-- 
2.27.0


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

* Re: [PATCH] platform/x86/intel/ifs: Annotate work queue on stack so object debug does not complain
  2023-05-23 10:54 [PATCH] platform/x86/intel/ifs: Annotate work queue on stack so object debug does not complain David Arcari
@ 2023-05-23 10:57 ` Hans de Goede
  0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2023-05-23 10:57 UTC (permalink / raw)
  To: David Arcari, platform-driver-x86
  Cc: Jithu Joseph, Ashok Raj, Tony Luck, Mark Gross,
	Greg Kroah-Hartman, Thomas Gleixner, Dan Williams, linux-kernel,
	stable

Hi,

On 5/23/23 12:54, David Arcari wrote:
> Object Debug results in the following warning while attempting to load
> ifs firmware:
> 
> [  220.007422] ODEBUG: object 000000003bf952db is on stack 00000000e843994b, but NOT annotated.
> [  220.007459] ------------[ cut here ]------------
> [  220.007461] WARNING: CPU: 0 PID: 11774 at lib/debugobjects.c:548 __debug_object_init.cold+0x22e/0x2d5
> [  220.137476] RIP: 0010:__debug_object_init.cold+0x22e/0x2d5
> [  220.254774] Call Trace:
> [  220.257641]  <TASK>
> [  220.265606]  scan_chunks_sanity_check+0x368/0x5f0 [intel_ifs]
> [  220.288292]  ifs_load_firmware+0x2a3/0x400 [intel_ifs]
> [  220.332793]  current_batch_store+0xea/0x160 [intel_ifs]
> [  220.357947]  kernfs_fop_write_iter+0x355/0x530
> [  220.363048]  new_sync_write+0x28e/0x4a0
> [  220.381226]  vfs_write+0x62a/0x920
> [  220.385160]  ksys_write+0xf9/0x1d0
> [  220.399421]  do_syscall_64+0x59/0x90
> [  220.440635]  entry_SYSCALL_64_after_hwframe+0x63/0xcd
> [  220.566845] ---[ end trace 3a01b299db142b41 ]---
> 
> Correct this by calling INIT_WORK_ONSTACK instead of INIT_WORK.
> 
> Fixes: 684ec215706d ("platform/x86/intel/ifs: Authenticate and copy to secured memory")
> 
> Signed-off-by: David Arcari <darcari@redhat.com>
> Cc: Jithu Joseph <jithu.joseph@intel.com>
> Cc: Ashok Raj <ashok.raj@intel.com>
> Cc: Tony Luck <tony.luck@intel.com>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Mark Gross <markgross@kernel.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: linux-kernel@vger.kernel.org
> Cc: stable@vger.kernel.org

Thank you for your patch, I've applied this patch to my fixes
branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=fixes

I will include this patch in my next fixes pull-req to Linus
for the current kernel development cycle.

Regards,

Hans





> ---
>  drivers/platform/x86/intel/ifs/load.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/x86/intel/ifs/load.c b/drivers/platform/x86/intel/ifs/load.c
> index 61dffb4c8a1d..e6ae8265f3a3 100644
> --- a/drivers/platform/x86/intel/ifs/load.c
> +++ b/drivers/platform/x86/intel/ifs/load.c
> @@ -208,7 +208,7 @@ static int scan_chunks_sanity_check(struct device *dev)
>  			continue;
>  		reinit_completion(&ifs_done);
>  		local_work.dev = dev;
> -		INIT_WORK(&local_work.w, copy_hashes_authenticate_chunks);
> +		INIT_WORK_ONSTACK(&local_work.w, copy_hashes_authenticate_chunks);
>  		schedule_work_on(cpu, &local_work.w);
>  		wait_for_completion(&ifs_done);
>  		if (ifsd->loading_error) {


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

end of thread, other threads:[~2023-05-23 10:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-23 10:54 [PATCH] platform/x86/intel/ifs: Annotate work queue on stack so object debug does not complain David Arcari
2023-05-23 10:57 ` Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).