Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/makefs/cd9660 The boot catalog pointer is a DWord, ...



details:   https://anonhg.NetBSD.org/src/rev/75317cd80c41
branches:  trunk
changeset: 374327:75317cd80c41
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Apr 18 23:00:02 2023 +0000

description:
The boot catalog pointer is a DWord, but we previously populated it via
cd9660_bothendian_dword which overwrote four unused bytes following it.
See El Torito 1.0 (1995) Figure 7 for details.

Found by Coverity on FreeBSD

diffstat:

 usr.sbin/makefs/cd9660/cd9660_eltorito.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r b1540e105d2d -r 75317cd80c41 usr.sbin/makefs/cd9660/cd9660_eltorito.c
--- a/usr.sbin/makefs/cd9660/cd9660_eltorito.c  Tue Apr 18 22:58:14 2023 +0000
+++ b/usr.sbin/makefs/cd9660/cd9660_eltorito.c  Tue Apr 18 23:00:02 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cd9660_eltorito.c,v 1.25 2022/04/09 10:05:35 riastradh Exp $   */
+/*     $NetBSD: cd9660_eltorito.c,v 1.26 2023/04/18 23:00:02 christos Exp $    */
 
 /*
  * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan
@@ -40,7 +40,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: cd9660_eltorito.c,v 1.25 2022/04/09 10:05:35 riastradh Exp $");
+__RCSID("$NetBSD: cd9660_eltorito.c,v 1.26 2023/04/18 23:00:02 christos Exp $");
 #endif  /* !__lint */
 
 #ifdef DEBUG
@@ -377,8 +377,8 @@ cd9660_setup_boot(iso9660_disk *diskStru
        /* Point to catalog: For now assume it consumes one sector */
        ELTORITO_DPRINTF(("Boot catalog will go in sector %d\n", first_sector));
        diskStructure->boot_catalog_sector = first_sector;
-       cd9660_bothendian_dword(first_sector,
-               diskStructure->boot_descriptor->boot_catalog_pointer);
+       cd9660_731(first_sector,
+           diskStructure->boot_descriptor->boot_catalog_pointer);
 
        /*
         * Use system type of default image for validation entry. Fallback to



Home | Main Index | Thread Index | Old Index