aic7xxx_core: Avoid shift overflow in aic7xxx init
Subsystems (2)
PATCH 1/1 aic7xxx_core: Avoid shift overflow in aic7xxx init
When built with _FORTIFY_SOURCE there was a shift overflow in ahc_init. Target mode was conditionally disabled based on ahc->unit which was initialized to -1 and later is set to the real unit number. The Linux kernel does not support target mode so undconditionally disable target mode.
Signed-off-by Jesse Taube <[email protected]>
--- drivers/scsi/aic7xxx/aic7xxx_core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/scsi/aic7xxx/aic7xxx_core.c +2 -3
@@ -5276,10 +5276,9 @@ ahc_init(struct ahc_softc *ahc) ahc->flags |=AHC_INITIATORROLE ;/* -* Only allow target mode features if this unit has them enabled. +* Only disallow target mode features. */ -if ((AHC_TMODE_ENABLE & (0x1 << ahc->unit)) ==0 ) - ahc->features &= ~AHC_TARGETMODE ; + ahc->features &= ~AHC_TARGETMODE ; ahc->init_level++;
Signature · 1 line
2.56.0