iPXE
sbat.h
Go to the documentation of this file.
1 #ifndef _IPXE_SBAT_H
2 #define _IPXE_SBAT_H
3 
4 /** @file
5  *
6  * Secure Boot Advanced Targeting (SBAT)
7  *
8  * SBAT defines an encoding for security generation numbers stored as
9  * a CSV file within a special ".sbat" section in the signed binary.
10  * If a Secure Boot exploit is discovered then the generation number
11  * will be incremented alongside the corresponding fix.
12  *
13  * Platforms may then record the minimum generation number required
14  * for any given product. This allows for an efficient revocation
15  * mechanism that consumes minimal flash storage space (in contrast to
16  * the DBX mechanism, which allows for only a single-digit number of
17  * revocation events to ever take place across all possible signed
18  * binaries).
19  */
20 
21 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
22 
23 /**
24  * A single line within an SBAT CSV file
25  *
26  * @v name Machine-readable component name
27  * @v generation Security generation number
28  * @v vendor Human-readable vendor name
29  * @v package Human-readable package name
30  * @v version Human-readable package version
31  * @v uri Contact URI
32  * @ret line CSV line
33  */
34 #define SBAT_LINE( name, generation, vendor, package, version, uri ) \
35  name "," _S2 ( generation ) "," vendor "," package "," \
36  version "," uri "\n"
37 
38 /** SBAT format generation */
39 #define SBAT_GENERATION 1
40 
41 /** Upstream security generation
42  *
43  * This represents the security generation of the upstream codebase.
44  * It will be incremented whenever a Secure Boot exploit is fixed in
45  * the upstream codebase.
46  *
47  * If you do not have commit access to the upstream iPXE repository,
48  * then you may not modify this value under any circumstances.
49  */
50 #define IPXE_SBAT_GENERATION 1
51 
52 /* Seriously, do not modify this value */
53 #if IPXE_SBAT_GENERATION != 1
54 #error "You may not modify IPXE_SBAT_GENERATION"
55 #endif
56 
57 /** SBAT header line */
58 #define SBAT_HEADER \
59  SBAT_LINE ( "sbat", SBAT_GENERATION, "SBAT Version", "sbat", \
60  _S2 ( SBAT_GENERATION ), \
61  "https://github.com/rhboot/shim/blob/main/SBAT.md" )
62 
63 /** Mark variable as being in the ".sbat" section */
64 #define __sbat __attribute__ (( section ( ".sbat" ), aligned ( 512 ) ))
65 
66 extern const char sbat[] __sbat;
67 
68 #endif /* _IPXE_SBAT_H */
#define __sbat
Mark variable as being in the ".sbat" section.
Definition: sbat.h:64
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)