NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/50849: Relax TC option ROM header check for ROM widths < 4



>Number:         50849
>Category:       kern
>Synopsis:       Relax TC option ROM header check for ROM widths < 4
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 25 08:05:00 +0000 2016
>Originator:     Felix Deichmann
>Release:        all
>Organization:
>Environment:
n/a
>Description:
Check of the test pattern in a TURBOchannel option ROM header implies a fixed ROM width of 4 bytes (32 bit) at the moment. While this may be OK for all presently supported TURBOchannel devices (which have a ROM width of 4), devices with an allowed, real ROM header width of 1 or 2 could fail (as the values of upper bytes are unknown/don't care).
The ROM header width is given in the ROM header, so the actual value can be used to relax the check.
>How-To-Repeat:
Boot with a (theoretical) TURBOchannel option installed which has an option ROM header width < 4.
>Fix:
--- src/sys/dev/tc/tc.c_1_51	Thu Feb 25 09:00:00 2016
+++ src/sys/dev/tc/tc.c	Thu Feb 25 09:00:00 2016
@@ -229,7 +229,7 @@
 		if (romp->tcr_stride.v != 4)
 			continue;
 
-		for (j = 0; j < 4; j++)
+		for (j = 0; j < romp->tcr_width.v; j++)
 			if (romp->tcr_test[j+0*romp->tcr_stride.v] != 0x55 ||
 			    romp->tcr_test[j+1*romp->tcr_stride.v] != 0x00 ||
 			    romp->tcr_test[j+2*romp->tcr_stride.v] != 0xaa ||



Home | Main Index | Thread Index | Old Index