Print this page
3027 installgrub can segfault when encountering bogus data on disk
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/boot/installboot/installboot.h
+++ new/usr/src/cmd/boot/installboot/installboot.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
23 23 */
24 24
25 25 #ifndef _INSTALLBOOT_H
26 26 #define _INSTALLBOOT_H
27 27
28 28 #ifdef __cplusplus
29 29 extern "C" {
30 30 #endif
31 31
32 32 #include <sys/multiboot.h>
33 33 #include <sys/types.h>
34 34
35 35 enum ib_fs_types {
36 36 TARGET_IS_UFS = 0,
37 37 TARGET_IS_HSFS,
38 38 TARGET_IS_ZFS
39 39 };
40 40
41 41 typedef struct _ib_device {
42 42 char *path;
43 43 int fd;
44 44 uint8_t type;
↓ open down ↓ |
44 lines elided |
↑ open up ↑ |
45 45 } ib_device_t;
46 46
47 47 typedef struct _ib_bootblock {
48 48 char *buf;
49 49 char *file;
50 50 char *extra;
51 51 multiboot_header_t *mboot;
52 52 uint32_t mboot_off;
53 53 uint32_t buf_size;
54 54 uint32_t file_size;
55 + uint32_t extra_size;
55 56 } ib_bootblock_t;
56 57
57 58 typedef struct _ib_data {
58 59 ib_device_t device;
59 60 ib_bootblock_t bootblock;
60 61 } ib_data_t;
61 62
62 63 #define is_zfs(type) (type == TARGET_IS_ZFS)
63 64
64 65 #define BBLK_DATA_RSVD_SIZE (15 * SECTOR_SIZE)
65 66 #define BBLK_ZFS_EXTRA_OFF (SECTOR_SIZE * 1024)
66 67
67 68 #ifdef __cplusplus
68 69 }
69 70 #endif
70 71
71 72 #endif /* _INSTALLBOOT_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX