android_kernel_xiaomi_sm8350/drivers/scsi/aic7xxx
Colin Ian King 863c4bc883 scsi: aic7xxx: Fix unintentional sign extension issue on left shift of u8
[ Upstream commit 332a9dd1d86f1e7203fc7f0fd7e82f0b304200fe ]

The shifting of the u8 integer returned fom ahc_inb(ahc, port+3) by 24 bits
to the left will be promoted to a 32 bit signed int and then sign-extended
to a u64. In the event that the top bit of the u8 is set then all then all
the upper 32 bits of the u64 end up as also being set because of the
sign-extension. Fix this by casting the u8 values to a u64 before the 24
bit left shift.

[ This dates back to 2002, I found the offending commit from the git
history git://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git,
commit f58eb66c0b0a ("Update aic7xxx driver to 6.2.10...") ]

Link: https://lore.kernel.org/r/20210621151727.20667-1-colin.king@canonical.com
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Addresses-Coverity: ("Unintended sign extension")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-25 14:35:12 +02:00
..
aicasm
.gitignore
aic7xxx_93cx6.c
aic7xxx_93cx6.h
aic7xxx_core.c
aic7xxx_inline.h
aic7xxx_osm_pci.c
aic7xxx_osm.c scsi: aic7xxx: fix EISA support 2019-04-18 20:43:10 -04:00
aic7xxx_osm.h
aic7xxx_pci.c
aic7xxx_pci.h
aic7xxx_proc.c
aic7xxx_reg_print.c_shipped
aic7xxx_reg.h_shipped scsi: aic7xxx: regenerate firmware files 2017-08-10 19:36:51 -04:00
aic7xxx_seq.h_shipped scsi: aic7xxx: aic79xx: remove VLAs 2018-03-15 00:34:26 -04:00
aic7xxx.h
aic7xxx.reg
aic7xxx.seq Fix common misspellings 2011-03-31 11:26:23 -03:00
aic79xx_core.c
aic79xx_inline.h
aic79xx_osm_pci.c
aic79xx_osm.c scsi: flip the default on use_clustering 2018-12-18 23:13:12 -05:00
aic79xx_osm.h
aic79xx_pci.c scsi: aic7xxx: remove set but not used variable 'shared_scb_data' 2018-09-17 02:34:16 -04:00
aic79xx_pci.h
aic79xx_proc.c
aic79xx_reg_print.c_shipped scsi: aic7xxx: regenerate firmware files 2017-08-10 19:36:51 -04:00
aic79xx_reg.h_shipped
aic79xx_seq.h_shipped
aic79xx.h
aic79xx.reg
aic79xx.seq
aic7770_osm.c
aic7770.c
aiclib.h [SCSI] replace __inline with inline 2009-04-03 10:23:16 -05:00
cam.h
Kconfig.aic7xxx
Kconfig.aic79xx
Makefile
queue.h
scsi_iu.h
scsi_message.h