1 From 3279decb2c3c8d58cb0b70ed5235c480735a36ee Mon Sep 17 00:00:00 2001
2 From: David Arcari <darcari@redhat.com>
3 Date: Tue, 23 May 2023 06:54:00 -0400
4 Subject: platform/x86/intel/ifs: Annotate work queue on stack so object debug does not complain
6 From: David Arcari <darcari@redhat.com>
8 commit 3279decb2c3c8d58cb0b70ed5235c480735a36ee upstream.
10 Object Debug results in the following warning while attempting to load
13 [ 220.007422] ODEBUG: object 000000003bf952db is on stack 00000000e843994b, but NOT annotated.
14 [ 220.007459] ------------[ cut here ]------------
15 [ 220.007461] WARNING: CPU: 0 PID: 11774 at lib/debugobjects.c:548 __debug_object_init.cold+0x22e/0x2d5
16 [ 220.137476] RIP: 0010:__debug_object_init.cold+0x22e/0x2d5
17 [ 220.254774] Call Trace:
19 [ 220.265606] scan_chunks_sanity_check+0x368/0x5f0 [intel_ifs]
20 [ 220.288292] ifs_load_firmware+0x2a3/0x400 [intel_ifs]
21 [ 220.332793] current_batch_store+0xea/0x160 [intel_ifs]
22 [ 220.357947] kernfs_fop_write_iter+0x355/0x530
23 [ 220.363048] new_sync_write+0x28e/0x4a0
24 [ 220.381226] vfs_write+0x62a/0x920
25 [ 220.385160] ksys_write+0xf9/0x1d0
26 [ 220.399421] do_syscall_64+0x59/0x90
27 [ 220.440635] entry_SYSCALL_64_after_hwframe+0x63/0xcd
28 [ 220.566845] ---[ end trace 3a01b299db142b41 ]---
30 Correct this by calling INIT_WORK_ONSTACK instead of INIT_WORK.
32 Fixes: 684ec215706d ("platform/x86/intel/ifs: Authenticate and copy to secured memory")
34 Signed-off-by: David Arcari <darcari@redhat.com>
35 Cc: Jithu Joseph <jithu.joseph@intel.com>
36 Cc: Ashok Raj <ashok.raj@intel.com>
37 Cc: Tony Luck <tony.luck@intel.com>
38 Cc: Hans de Goede <hdegoede@redhat.com>
39 Cc: Mark Gross <markgross@kernel.org>
40 Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
41 Cc: Thomas Gleixner <tglx@linutronix.de>
42 Cc: Dan Williams <dan.j.williams@intel.com>
43 Cc: linux-kernel@vger.kernel.org
44 Cc: stable@vger.kernel.org
45 Link: https://lore.kernel.org/r/20230523105400.674152-1-darcari@redhat.com
46 Reviewed-by: Hans de Goede <hdegoede@redhat.com>
47 Signed-off-by: Hans de Goede <hdegoede@redhat.com>
48 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
50 drivers/platform/x86/intel/ifs/load.c | 2 +-
51 1 file changed, 1 insertion(+), 1 deletion(-)
53 --- a/drivers/platform/x86/intel/ifs/load.c
54 +++ b/drivers/platform/x86/intel/ifs/load.c
55 @@ -208,7 +208,7 @@ static int scan_chunks_sanity_check(stru
57 reinit_completion(&ifs_done);
59 - INIT_WORK(&local_work.w, copy_hashes_authenticate_chunks);
60 + INIT_WORK_ONSTACK(&local_work.w, copy_hashes_authenticate_chunks);
61 schedule_work_on(cpu, &local_work.w);
62 wait_for_completion(&ifs_done);
63 if (ifsd->loading_error) {