Skip to content

Commit 979fe44

Browse files
Alexander Gordeevhcahca
authored andcommitted
s390/ipl: fix virtual vs physical address confusion
The value of ipl_cert_list_addr boot variable contains a physical address, which is used directly. That works because virtual and physical address spaces are currently the same, but otherwise it is wrong. While at it, fix also a comment for the platform keyring. Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com> Reviewed-by: Mimi Zohar <zohar@linux.ibm.com> Acked-by: Jarkko Sakkinen <jarkko@kernel.org> Link: https://lore.kernel.org/r/20230816132942.2540411-1-agordeev@linux.ibm.com Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
1 parent 386cb81 commit 979fe44

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

arch/s390/kernel/machine_kexec_file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ static int kexec_file_add_ipl_report(struct kimage *image,
188188
data->memsz = ALIGN(data->memsz, PAGE_SIZE);
189189
buf.mem = data->memsz;
190190

191-
ptr = (void *)ipl_cert_list_addr;
191+
ptr = __va(ipl_cert_list_addr);
192192
end = ptr + ipl_cert_list_size;
193193
ncerts = 0;
194194
while (ptr < end) {
@@ -200,7 +200,7 @@ static int kexec_file_add_ipl_report(struct kimage *image,
200200

201201
addr = data->memsz + data->report->size;
202202
addr += ncerts * sizeof(struct ipl_rb_certificate_entry);
203-
ptr = (void *)ipl_cert_list_addr;
203+
ptr = __va(ipl_cert_list_addr);
204204
while (ptr < end) {
205205
len = *(unsigned int *)ptr;
206206
ptr += sizeof(len);

arch/s390/kernel/setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ static void __init log_component_list(void)
875875
pr_info("Linux is running with Secure-IPL enabled\n");
876876
else
877877
pr_info("Linux is running with Secure-IPL disabled\n");
878-
ptr = (void *) early_ipl_comp_list_addr;
878+
ptr = __va(early_ipl_comp_list_addr);
879879
end = (void *) ptr + early_ipl_comp_list_size;
880880
pr_info("The IPL report contains the following components:\n");
881881
while (ptr < end) {

security/integrity/platform_certs/load_ipl_s390.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ static int __init load_ipl_certs(void)
2222

2323
if (!ipl_cert_list_addr)
2424
return 0;
25-
/* Copy the certificates to the system keyring */
26-
ptr = (void *) ipl_cert_list_addr;
25+
/* Copy the certificates to the platform keyring */
26+
ptr = __va(ipl_cert_list_addr);
2727
end = ptr + ipl_cert_list_size;
2828
while ((void *) ptr < end) {
2929
len = *(unsigned int *) ptr;

0 commit comments

Comments
 (0)