Skip to contentSkip to conversation

Off by one in floppy.c

PATCH In review Eric Sesterhenn / Snakebyte 2 participants 2 messages May 21, 2007 – May 22, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Off by one in floppy.c

hi,

another coverity patch i forgot to resend,
original thread here
http://marc.info/?l=linux-kernel&m=115144559823592&w=2

In case drive == N_DRIVE, we get one past the drive_params array.

drivers/block/floppy.c renamed from drivers/block/floppy.c.orig +1 -1
@@ -670,7 +670,7 @@ static void __reschedule_timeout(int dri
 	if (drive == current_reqD)
 		drive = current_drive;
 	del_timer(&fd_timeout);
-	if (drive < 0 || drive > N_DRIVE) {
+	if (drive < 0 || drive >= N_DRIVE) {
 		fd_timeout.expires = jiffies + 20UL * HZ;
 		drive = 0;
 	} else
#1 lore raw
Quoted 1 line · Eric Sesterhenn / Snakebyte

http://marc.info/?l=linux-kernel&m=115144559823592&w=2

Shows how much we care about floppy... It's going to be a year old soon.

drivers/block/floppy.c static void __reschedule_timeout(int dri · line 673

Quoted 7 lines

+++ linux-2.6/drivers/block/floppy.c 2007-05-22 00:54:18.000000000 +0200

drivers/block/floppy.c renamed from drivers/block/floppy.c.orig +1 -1
@@ -670,7 +670,7 @@ static void __reschedule_timeout(int dri
 	if (drive == current_reqD)
 		drive = current_drive;
 	del_timer(&fd_timeout);
-	if (drive < 0 || drive > N_DRIVE) {
+	if (drive < 0 || drive >= N_DRIVE) {

You need to find someone willing to take this. Maybe Andrew.

-- Pete