The branch main has been updated by tsoome:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=79a0d14fa05c75038caa52099289effb85732f88

commit 79a0d14fa05c75038caa52099289effb85732f88
Author:     Toomas Soome <tso...@freebsd.org>
AuthorDate: 2024-10-03 11:54:11 +0000
Commit:     Toomas Soome <tso...@freebsd.org>
CommitDate: 2024-10-03 13:51:59 +0000

    loader: dosfs fails to access directory data with large cluster number
    
    fsize is using 2 bytes for cluster number, but with fat32 we
    actually do have 4 bytes and with large disks the high bytes will be in use.
    
    illumos issue: https://www.illumos.org/issues/16821
    
    Sponsored by:   MNX Cloud, Inc.
    MFC after:      1 week
---
 stand/libsa/dosfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/stand/libsa/dosfs.c b/stand/libsa/dosfs.c
index 7fbbf65989ae..2ee95bf2c601 100644
--- a/stand/libsa/dosfs.c
+++ b/stand/libsa/dosfs.c
@@ -815,7 +815,7 @@ fsize(DOS_FS *fs, DOS_DE *de)
        int n;
 
        if (!(size = cv4(de->size)) && de->attr & FA_DIR) {
-               if (!(c = cv2(de->clus))) {
+               if (!(c = stclus(fs->fatsz, de))) {
                        size = fs->dirents * sizeof(DOS_DE);
                } else {
                        if ((n = fatcnt(fs, c)) == -1)

Reply via email to