s390 compile fix for 6.2-rc5

- 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.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEECMNfWEw3SLnmiLkZIg7DeRspbsIFAmPJMRMACgkQIg7DeRsp
 bsKPcg/7B99B+3+ABgcmmAtyFHwJat9UZQZfjFRTjXSP3A0tVipOOvCkaJcjAzzD
 Z14C7CRob8mS14MTuW5QRHb40lSiPKxFNzb5rObV0Qti1QVzSJYvNa01vfCCWk2e
 xHbF6iRIGkrn17OAsEwgI10wezMGkn++vvsFwNEGpCSzEJyxK7ZxbXrY2z//N9Xm
 ajFR1ICvEqhXzYJuQhs0W3rUSQ0Brh2Ly6v+p2QzLlxthyy7OHoRKp4pyXWMMPod
 eMj8swI+tQ15eWSaYHgcRwjaCG2MTA5Ar9rKigQyEDVvx3yRgy+fPwYluXPwM48f
 trtV6XUV+85JexQ4e9Wc8UosyQ7LnDLnHllPOlYarnNI2KsJEiF40pgfnxavlUuK
 OY2pO6AKz71+9c8AhL26nb0MxuKawtwC1XJiMrGoYp9EL/i4a/IcGP9N/jaxCfuM
 NKhSSJB0E0vOdhBAtfO9eYrAH/NGJI6nIeIVivVpO73xK7wj+4CqMVIojgvz6D2S
 RH38dOMjyIaAgJ6J9Bfy4vpOb8LO+1IJ8570++/8XuLEav7dPKUS2SKlYQyO1IAt
 lQmaorORU/TSruW2T7stpLgF60KVYsRaI7N0HZVq5NU+QSoC+DTWQIMYV+YrZBrV
 K5y+9R8A4GVtaMBUX+l6PQ7Z5xyErAN/iSt/FOFqLSBwflNP5oo=
 =XnbT
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2023-01-19 12:28:53 -08:00
commit a03df4ec37

View file

@ -508,6 +508,7 @@ static void __init setup_lowcore_dat_on(void)
{
struct lowcore *abs_lc;
unsigned long flags;
int i;
__ctl_clear_bit(0, 28);
S390_lowcore.external_new_psw.mask |= PSW_MASK_DAT;
@ -523,8 +524,8 @@ static void __init setup_lowcore_dat_on(void)
abs_lc = get_abs_lowcore(&flags);
abs_lc->restart_flags = RESTART_FLAG_CTLREGS;
abs_lc->program_new_psw = S390_lowcore.program_new_psw;
memcpy(abs_lc->cregs_save_area, S390_lowcore.cregs_save_area,
sizeof(abs_lc->cregs_save_area));
for (i = 0; i < 16; i++)
abs_lc->cregs_save_area[i] = S390_lowcore.cregs_save_area[i];
put_abs_lowcore(abs_lc, flags);
}