NetBSD-Bugs archive

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

kern/59534: Use of FS_UFS2_MAGIC is problematic



>Number:         59534
>Category:       kern
>Synopsis:       Use of FS_UFS2_MAGIC is problematic
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 21 00:35:00 +0000 2025
>Originator:     Jason Thorpe
>Release:        NetBSD-current as of July 20, 2025
>Organization:
RISCy Business
>Environment:
[Doesn't matter]
>Description:
The use of FS_UFS2_MAGIC is problematic since the introduction of FS_UFS2EA_MAGIC.  There are several cases where comparisons are made against FS_UFS2_MAGIC to select "UFS2 behavior".  But of course, here is now a second UFS2 magic number which also should select the UFS2 behavior, but the comparison does not include it.
>How-To-Repeat:
Code inspection.
>Fix:
Probably invert the test (test for non-equality against the UFS1 magic number).  And maybe wrap it in a macro or something.



Home | Main Index | Thread Index | Old Index