2022-11-17 04:14:42

by Joseph, Jithu

[permalink] [raw]
Subject: [PATCH v3 02/16] platform/x86/intel/ifs: Return a more appropriate Error code

scan_chunks_sanity_check() returns -ENOMEM if it encounters
an error while copying IFS test image from memory to Secure Memory.

Return -EIO in this scenario, as it is more appropriate.

Reviewed-by: Tony Luck <[email protected]>
Reviewed-by: Sohil Mehta <[email protected]>
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Jithu Joseph <[email protected]>
---
drivers/platform/x86/intel/ifs/load.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/x86/intel/ifs/load.c b/drivers/platform/x86/intel/ifs/load.c
index d056617ddc85..89ce265887ea 100644
--- a/drivers/platform/x86/intel/ifs/load.c
+++ b/drivers/platform/x86/intel/ifs/load.c
@@ -157,8 +157,10 @@ static int scan_chunks_sanity_check(struct device *dev)
INIT_WORK(&local_work.w, copy_hashes_authenticate_chunks);
schedule_work_on(cpu, &local_work.w);
wait_for_completion(&ifs_done);
- if (ifsd->loading_error)
+ if (ifsd->loading_error) {
+ ret = -EIO;
goto out;
+ }
package_authenticated[curr_pkg] = 1;
}
ret = 0;
--
2.25.1



Subject: [tip: x86/microcode] platform/x86/intel/ifs: Return a more appropriate error code

The following commit has been merged into the x86/microcode branch of tip:

Commit-ID: f4e209e956b5d66f0e6e34e89f19811c2c1e596e
Gitweb: https://git.kernel.org/tip/f4e209e956b5d66f0e6e34e89f19811c2c1e596e
Author: Jithu Joseph <[email protected]>
AuthorDate: Wed, 16 Nov 2022 19:59:21 -08:00
Committer: Borislav Petkov <[email protected]>
CommitterDate: Fri, 18 Nov 2022 21:30:36 +01:00

platform/x86/intel/ifs: Return a more appropriate error code

scan_chunks_sanity_check() returns -ENOMEM if it encounters an error
while copying IFS test image from memory to Secure Memory.

Return -EIO in this scenario, as it is more appropriate.

Signed-off-by: Jithu Joseph <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Reviewed-by: Tony Luck <[email protected]>
Reviewed-by: Sohil Mehta <[email protected]>
Reviewed-by: Hans de Goede <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
---
drivers/platform/x86/intel/ifs/load.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/x86/intel/ifs/load.c b/drivers/platform/x86/intel/ifs/load.c
index d056617..89ce265 100644
--- a/drivers/platform/x86/intel/ifs/load.c
+++ b/drivers/platform/x86/intel/ifs/load.c
@@ -157,8 +157,10 @@ static int scan_chunks_sanity_check(struct device *dev)
INIT_WORK(&local_work.w, copy_hashes_authenticate_chunks);
schedule_work_on(cpu, &local_work.w);
wait_for_completion(&ifs_done);
- if (ifsd->loading_error)
+ if (ifsd->loading_error) {
+ ret = -EIO;
goto out;
+ }
package_authenticated[curr_pkg] = 1;
}
ret = 0;