Skip to content

Commit a03df4e

Browse files
committed
Merge tag 's390-6.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 build fix from Heiko Carstens: - Workaround invalid gcc-11 out of bounds read warning caused by s390's S390_lowcore definition. This happens only with gcc 11.1.0 and 11.2.0. The code which causes this warning will be gone with the next merge window. Therefore just replace the memcpy() with a for loop to get rid of the warning. * tag 's390-6.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390: workaround invalid gcc-11 out of bounds read warning
2 parents 46f0cba + 41e1992 commit a03df4e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

arch/s390/kernel/setup.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,7 @@ static void __init setup_lowcore_dat_on(void)
508508
{
509509
struct lowcore *abs_lc;
510510
unsigned long flags;
511+
int i;
511512

512513
__ctl_clear_bit(0, 28);
513514
S390_lowcore.external_new_psw.mask |= PSW_MASK_DAT;
@@ -523,8 +524,8 @@ static void __init setup_lowcore_dat_on(void)
523524
abs_lc = get_abs_lowcore(&flags);
524525
abs_lc->restart_flags = RESTART_FLAG_CTLREGS;
525526
abs_lc->program_new_psw = S390_lowcore.program_new_psw;
526-
memcpy(abs_lc->cregs_save_area, S390_lowcore.cregs_save_area,
527-
sizeof(abs_lc->cregs_save_area));
527+
for (i = 0; i < 16; i++)
528+
abs_lc->cregs_save_area[i] = S390_lowcore.cregs_save_area[i];
528529
put_abs_lowcore(abs_lc, flags);
529530
}
530531

0 commit comments

Comments
 (0)