Sun Nov 7 11:30:19 2021 UTC ()
doc: RELRO revert


(nia)
diff -r1.21 -r1.22 pkgsrc/doc/NEWS
diff -r1.4 -r1.5 pkgsrc/doc/guide/files/hardening.xml

cvs diff -r1.21 -r1.22 pkgsrc/doc/NEWS (expand / switch to unified diff)

--- pkgsrc/doc/NEWS 2021/10/10 08:39:40 1.21
+++ pkgsrc/doc/NEWS 2021/11/07 11:30:19 1.22
@@ -1,45 +1,39 @@ @@ -1,45 +1,39 @@
1# $NetBSD: NEWS,v 1.21 2021/10/10 08:39:40 nia Exp $ 1# $NetBSD: NEWS,v 1.22 2021/11/07 11:30:19 nia Exp $
2 2
3PKGSRC NEWS 3PKGSRC NEWS
4=========== 4===========
5 5
6 This file contains information about important infrastructural changes in 6 This file contains information about important infrastructural changes in
7 pkgsrc. The intended readers are the pkgsrc developers as well as anyone 7 pkgsrc. The intended readers are the pkgsrc developers as well as anyone
8 tracking pkgsrc-current. 8 tracking pkgsrc-current.
9 9
10SHA1 distfile hashes deprecated [nia 2021-10-07] 10SHA1 distfile hashes deprecated [nia 2021-10-07]
11 11
12 SHA1 hashes have been removed from the pkgsrc tree for 12 SHA1 hashes have been removed from the pkgsrc tree for
13 distfiles and will now no longer be generated for new 13 distfiles and will now no longer be generated for new
14 packages - only SHA512 and RMD160 will be generated. 14 packages - only SHA512 and RMD160 will be generated.
15 15
16Default Python version changed to 3.9 [nia 2021-10-01] 16Default Python version changed to 3.9 [nia 2021-10-01]
17 17
18Increased enabled-by-default hardening options [nia 2021-09-27] 18Increased enabled-by-default hardening options [nia 2021-09-27]
19 19
20 PKGSRC_USE_MKPIE was enabled on some architectures. 20 PKGSRC_USE_MKPIE was enabled on some architectures.
21 Packages that provide static libraries to other packages 21 Packages that provide static libraries to other packages
22 should be rebuilt with MKPIE enabled. 22 should be rebuilt with MKPIE enabled.
23 Some packages may experience runtime errors on platforms 23 Some packages may experience runtime errors on platforms
24 like i386 - usually this is due to unsafe assembly code, 24 like i386 - usually this is due to unsafe assembly code,
25 which should be disabled when MKPIE is enabled. 25 which should be disabled when MKPIE is enabled.
26 26
27 PKGSRC_USE_RELRO was enabled on some architectures. 
28 This should not affect the majority of packages that properly 
29 honor CFLAGS/LDFLAGS when building. Packages experiencing 
30 problems loading dynamic ELF plugins at runtime should have 
31 RELRO disabled. 
32 
33 PKGSRC_USE_SSP was bumped from "yes" to "strong". This 27 PKGSRC_USE_SSP was bumped from "yes" to "strong". This
34 is not expected to have a noticable effect. 28 is not expected to have a noticable effect.
35 29
36 More information: 30 More information:
37 https://www.NetBSD.org/docs/pkgsrc/hardening.html 31 https://www.NetBSD.org/docs/pkgsrc/hardening.html
38 (or see "Security hardening" section of doc/pkgsrc.txt) 32 (or see "Security hardening" section of doc/pkgsrc.txt)
39 33
40Default MySQL implementation changed to MariaDB 10.6 [nia 2021-09-27] 34Default MySQL implementation changed to MariaDB 10.6 [nia 2021-09-27]
41 35
42Default PostgreSQL changed to 13 [nia 2021-06-28] 36Default PostgreSQL changed to 13 [nia 2021-06-28]
43 37
44Default MySQL implementation changed to MariaDB [nia 2021-06-24] 38Default MySQL implementation changed to MariaDB [nia 2021-06-24]
45 39

cvs diff -r1.4 -r1.5 pkgsrc/doc/guide/files/hardening.xml (expand / switch to unified diff)

--- pkgsrc/doc/guide/files/hardening.xml 2021/11/02 08:28:45 1.4
+++ pkgsrc/doc/guide/files/hardening.xml 2021/11/07 11:30:19 1.5
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1<!-- $NetBSD: hardening.xml,v 1.4 2021/11/02 08:28:45 nia Exp $ --> 1<!-- $NetBSD: hardening.xml,v 1.5 2021/11/07 11:30:19 nia Exp $ -->
2 2
3<appendix id="hardening"> 3<appendix id="hardening">
4<title>Security hardening</title> 4<title>Security hardening</title>
5 5
6<para> 6<para>
7A number of mechanisms are available in pkgsrc to improve the security of the 7A number of mechanisms are available in pkgsrc to improve the security of the
8resulting system. This page describes the mechanisms, and gives hints 8resulting system. This page describes the mechanisms, and gives hints
9about detecting and fixing problems. 9about detecting and fixing problems.
10</para> 10</para>
11 11
12<para> 12<para>
13Mechanisms can be enabled individually in 13Mechanisms can be enabled individually in
14<filename>mk.conf</filename>, and are 14<filename>mk.conf</filename>, and are
@@ -133,26 +133,57 @@ exploits harder to construct. With PIE,  @@ -133,26 +133,57 @@ exploits harder to construct. With PIE,
133program, instead of the stack and heap only. 133program, instead of the stack and heap only.
134</para> 134</para>
135 135
136<para> 136<para>
137PIE executables will only be built for toolchains that are known to support PIE. 137PIE executables will only be built for toolchains that are known to support PIE.
138Currently, this means NetBSD on x86, ARM, SPARC64, m68k, and MIPS. 138Currently, this means NetBSD on x86, ARM, SPARC64, m68k, and MIPS.
139</para> 139</para>
140 140
141<para> 141<para>
142<varname>PKGSRC_MKPIE</varname> was enabled by default after the pkgsrc-2021Q3 branch. 142<varname>PKGSRC_MKPIE</varname> was enabled by default after the pkgsrc-2021Q3 branch.
143</para> 143</para>
144</sect3> 144</sect3>
145 145
 146<sect2 id="hardening.mechanisms.disabled">
 147<title>Not enabled by default</title>
 148
 149<sect3 id="hardening.mechanisms.disabled.repro">
 150<title>PKGSRC_MKREPRO</title>
 151
 152<para>
 153With this option, pkgsrc will try to build packages reproducibly. This allows
 154packages built from the same tree and with the same options, to produce
 155identical results bit by bit. This option should be combined with ASLR and
 156<varname>PKGSRC_MKPIE</varname> to avoid predictable address offsets for
 157attackers attempting to exploit security vulnerabilities.
 158</para>
 159
 160<para>
 161More details can be found here:
 162</para>
 163
 164<itemizedlist>
 165<listitem>
 166<para>
 167<ulink url="https://reproducible-builds.org/">Reproducible Builds - a set of software development practices that create an independently-verifiable path from source to binary code</ulink>
 168</para>
 169</listitem>
 170</itemizedlist>
 171
 172<para>
 173More work likely needs to be done before pkgsrc is fully reproducible.
 174</para>
 175</sect3>
 176
146<sect3 id="hardening.mechanisms.enabled.relro"> 177<sect3 id="hardening.mechanisms.enabled.relro">
147<title>PKGSRC_USE_RELRO</title> 178<title>PKGSRC_USE_RELRO</title>
148 179
149<para> 180<para>
150This also makes the exploitation of some security vulnerabilities more 181This also makes the exploitation of some security vulnerabilities more
151difficult in some cases. 182difficult in some cases.
152</para> 183</para>
153 184
154<para>Two different mitigation levels are available:</para> 185<para>Two different mitigation levels are available:</para>
155 186
156<itemizedlist> 187<itemizedlist>
157<listitem> 188<listitem>
158<para> 189<para>
@@ -161,74 +192,44 @@ precede the program's own data sections, @@ -161,74 +192,44 @@ precede the program's own data sections,
161</para> 192</para>
162</listitem> 193</listitem>
163<listitem> 194<listitem>
164<para> 195<para>
165full: in addition to partial RELRO, every relocation is performed immediately 196full: in addition to partial RELRO, every relocation is performed immediately
166when starting the program (with a slight performance impact), allowing the 197when starting the program (with a slight performance impact), allowing the
167entire GOT to be read-only. 198entire GOT to be read-only.
168</para> 199</para>
169</listitem> 200</listitem>
170</itemizedlist> 201</itemizedlist>
171 202
172<para> 203<para>
173This is currently supported by GCC. Many software distributions now enable this 204This is currently supported by GCC. Many software distributions now enable this
174feature by default, at the "partial" level. 205feature by default, at the "partial" level. However, it cannot yet be enforced
 206globally in pkgsrc through cwrappers.
175</para> 207</para>
176 208
177<para> 209<para>
178More details can be found here: 210More details can be found here:
179</para> 211</para>
180 212
181<itemizedlist> 213<itemizedlist>
182<listitem> 214<listitem>
183<para> 215<para>
184<ulink url="https://www.redhat.com/en/blog/hardening-elf-binaries-using-relocation-read-only-relro">Hardening ELF binaries using Relocation Read-Only (RELRO)</ulink> 216<ulink url="https://www.redhat.com/en/blog/hardening-elf-binaries-using-relocation-read-only-relro">Hardening ELF binaries using Relocation Read-Only (RELRO)</ulink>
185</para> 217</para>
186</listitem> 218</listitem>
187</itemizedlist> 219</itemizedlist>
188</sect3> 220</sect3>
189</sect2> 221</sect2>
190 222
191<sect2 id="hardening.mechanisms.disabled"> 
192<title>Not enabled by default</title> 
193 
194<sect3 id="hardening.mechanisms.disabled.repro"> 
195<title>PKGSRC_MKREPRO</title> 
196 
197<para> 
198With this option, pkgsrc will try to build packages reproducibly. This allows 
199packages built from the same tree and with the same options, to produce 
200identical results bit by bit. This option should be combined with ASLR and 
201<varname>PKGSRC_MKPIE</varname> to avoid predictable address offsets for 
202attackers attempting to exploit security vulnerabilities. 
203</para> 
204 
205<para> 
206More details can be found here: 
207</para> 
208 
209<itemizedlist> 
210<listitem> 
211<para> 
212<ulink url="https://reproducible-builds.org/">Reproducible Builds - a set of software development practices that create an independently-verifiable path from source to binary code</ulink> 
213</para> 
214</listitem> 
215</itemizedlist> 
216 
217<para> 
218More work likely needs to be done before pkgsrc is fully reproducible. 
219</para> 
220</sect3> 
221 
222<sect3 id="hardening.mechanisms.disabled.stackcheck"> 223<sect3 id="hardening.mechanisms.disabled.stackcheck">
223<title>PKGSRC_USE_STACK_CHECK</title> 224<title>PKGSRC_USE_STACK_CHECK</title>
224 225
225<para> 226<para>
226This uses <literal>-fstack-check</literal> with GCC for 227This uses <literal>-fstack-check</literal> with GCC for
227another stack protection mitigation. 228another stack protection mitigation.
228</para> 229</para>
229 230
230<para> 231<para>
231It asks the compiler to generate code verifying that it does not corrupt the 232It asks the compiler to generate code verifying that it does not corrupt the
232stack. According to GCC's manual page, this is really only useful for 233stack. According to GCC's manual page, this is really only useful for
233multi-threaded programs. 234multi-threaded programs.
234</para> 235</para>