mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] aic7xxx_core: Avoid shift overflow in aic7xxx init
@ 2026-11-24 15:17 Jesse Taube
  0 siblings, 0 replies; only message in thread
From: Jesse Taube @ 2026-11-24 15:17 UTC (permalink / raw)
  To: Martin K. Petersen
  Cc: linux-scsi, linux-kernel, James E.J. Bottomley, Jesse Taube

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 <jtaubepe@redhat.com>
---
 drivers/scsi/aic7xxx/aic7xxx_core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c
index b9761f9f0bbc..eeae5965f79f 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_core.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_core.c
@@ -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++;
 
-- 
2.56.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-24 15:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-24 15:17 [PATCH] aic7xxx_core: Avoid shift overflow in aic7xxx init Jesse Taube

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®