Fix style
[kconfig-hardened-check.git] / issues.md
1 Export of Github issues for [a13xp0p0v/kconfig-hardened-check](https://github.com/a13xp0p0v/kconfig-hardened-check).
2
3 # [\#76 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/76) `open`: iommu=force
4
5 #### <img src="https://avatars.githubusercontent.com/u/74207682?u=e2caba41d5de242cc07db2138f9fe9dc997a7300&v=4" width="50">[d4rklynk](https://github.com/d4rklynk) opened issue at [2022-12-13 17:58](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/76):
6
7 It seems it helps indirectly from DMA attacks (from what I understand). It is recommended by ANSSI.
8
9 From this [PDF](https://www.ssi.gouv.fr/uploads/2019/02/fr_np_linux_configuration-v2.0.pdf) (in french) at the chapter "**5.2.1 Configuration de la mémoire**"
10
11 Or from this [older version](https://www.ssi.gouv.fr/uploads/2019/03/linux_configuration-en-v1.2.pdf) of the same PDF but in english : chapter "**4.3 IOMMU Service (input/output virtualization)**"
12
13
14
15
16 -------------------------------------------------------------------------------
17
18 # [\#75 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/75) `open`: Integrity Measurement Architecture 
19
20 #### <img src="https://avatars.githubusercontent.com/u/97197406?u=3fc2e7c1b9d9f1b9b1c8e7268aaa11204944694e&v=4" width="50">[JohnVengert](https://github.com/JohnVengert) opened issue at [2022-11-14 04:40](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/75):
21
22 The Integrity Measurement Architecture is a subsystem that is responsible
23  for calculating file hashes. this allows greater security . This option would be ideal
24  to be integrated, 
25
26 Kernel Config -
27
28 ```
29 CONFIG_IMA=y
30 CONFIG_IMA_MEASURE_PCR_IDX=10
31 CONFIG_IMA_LSM_RULES=y
32 CONFIG_IMA_NG_TEMPLATE=y
33 # CONFIG_IMA_SIG_TEMPLATE is not set
34 CONFIG_IMA_DEFAULT_TEMPLATE="ima-ng"
35 # CONFIG_IMA_DEFAULT_HASH_SHA1 is not set
36 # CONFIG_IMA_DEFAULT_HASH_SHA256 is not set
37 CONFIG_IMA_DEFAULT_HASH_SHA512=y
38 CONFIG_IMA_DEFAULT_HASH="sha512"
39 CONFIG_IMA_WRITE_POLICY=y
40 CONFIG_IMA_READ_POLICY=y
41 CONFIG_IMA_APPRAISE=y
42 CONFIG_IMA_ARCH_POLICY=y
43 CONFIG_IMA_APPRAISE_BUILD_POLICY=y
44 CONFIG_IMA_APPRAISE_REQUIRE_FIRMWARE_SIGS=y
45 CONFIG_IMA_APPRAISE_REQUIRE_KEXEC_SIGS=y
46 CONFIG_IMA_APPRAISE_REQUIRE_MODULE_SIGS=y
47 CONFIG_IMA_APPRAISE_REQUIRE_POLICY_SIGS=y
48 CONFIG_IMA_APPRAISE_BOOTPARAM=y
49 CONFIG_IMA_APPRAISE_MODSIG=y
50 CONFIG_IMA_TRUSTED_KEYRING=y
51 CONFIG_IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_OR_SECONDARY=y
52 CONFIG_IMA_BLACKLIST_KEYRING=y
53 CONFIG_IMA_LOAD_X509=y
54 CONFIG_IMA_X509_PATH="/etc/keys/x509_ima.der"
55 CONFIG_IMA_APPRAISE_SIGNED_INIT is not set (This option breaks memory, do not select)
56 CONFIG_IMA_MEASURE_ASYMMETRIC_KEYS=y
57 CONFIG_IMA_QUEUE_EARLY_BOOT_KEYS=y
58 CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT=y
59 CONFIG_IMA_DISABLE_HTABLE=y
60 CONFIG_EVM=y
61 CONFIG_EVM_ATTR_FSUUID=y
62 CONFIG_EVM_EXTRA_SMACK_XATTRS=y
63 CONFIG_EVM_ADD_XATTRS=y
64 CONFIG_EVM_LOAD_X509=y
65 CONFIG_EVM_X509_PATH="/etc/keys/x509_evm.der"
66
67 ```
68 My system integrates this security 
69 https://sourceforge.net/projects/anti-ransomware/
70
71 Thank you very much
72
73
74
75 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2022-12-08 13:29](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/75#issuecomment-1342739444):
76
77 Hello @JohnVengert,
78
79 1. As I understand, IMA doesn't have direct influence on Linux **kernel** security.
80 It's important for the userspace security, isn't it?
81
82 2. Does this functionality require any userspace support or actions to work?
83
84 3. You've provided a large list of options. Could you create a shortlist with the most important of them?
85
86 Thanks!
87
88
89 -------------------------------------------------------------------------------
90
91 # [\#74 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/74) `open`: Add disabling compatibility mode.
92
93 #### <img src="https://avatars.githubusercontent.com/u/7232674?u=dba600128b18073a4e3c33b76f5c601591d8f613&v=4" width="50">[Manouchehri](https://github.com/Manouchehri) opened issue at [2022-10-20 22:00](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/74):
94
95 I'm not a kernel maintainer, so I added myself a new category. I don't think I'm wrong about this one though, here's a few public examples I found within a minute of searching:
96
97 https://google.github.io/security-research/pocs/linux/cve-2021-22555/writeup.html
98 https://bugs.chromium.org/p/project-zero/issues/detail?id=1574
99 https://outflux.net/blog/archives/2010/10/19/cve-2010-2963-v4l-compat-exploit/
100 http://inertiawar.com/compat1/
101 http://inertiawar.com/compat2/
102
103 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2022-10-22 18:57](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/74#issuecomment-1287883856):
104
105 Hello @Manouchehri,
106
107 Thanks for your pull request and the idea.
108
109 I looked up. That's how `CONFIG_COMPAT` is currently implemented:
110 ```
111 config COMPAT
112         def_bool y
113         depends on IA32_EMULATION || X86_X32_ABI
114 ```
115 So we can't enable/disable it in the menuconfig directly.
116
117 The KSPP project already recommends disabling `IA32_EMULATION` and `X86_X32`:
118 ```
119 CONFIG_IA32_EMULATION    |kconfig| is not set |   kspp   |cut_attack_surface
120 CONFIG_X86_X32           |kconfig| is not set |   kspp   |cut_attack_surface
121 ```
122
123 So maybe adding a separate check for `COMPAT` is not needed.
124
125 But wait, `COMPAT` depends on `X86_X32_ABI` and not `X86_X32`.
126
127 There is a Linux kernel commit `83a44a4f47ad20997aebb311fc678a13cde391d7` (Mar 14 2022)
128 that renamed this config option. I will ask to update it at the KSPP wiki.
129 Then I will add a new check for `X86_X32_ABI`.
130
131 Thank you very much!
132
133 This case shows that from time to time we need to look up all config options that should be disabled.
134 Maybe some of them have been renamed in the Linux kernel.
135
136 #### <img src="https://avatars.githubusercontent.com/u/7232674?u=dba600128b18073a4e3c33b76f5c601591d8f613&v=4" width="50">[Manouchehri](https://github.com/Manouchehri) commented at [2022-10-22 19:02](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/74#issuecomment-1287884800):
137
138 CONFIG_COMPAT depends on the arch too. For example, neither `X86_X32_ABI` or `X86_X32` will cover arm64 systems.
139
140 ```
141 menuconfig COMPAT
142         bool "Kernel support for 32-bit EL0"
143         depends on ARM64_4K_PAGES || EXPERT
144 ```
145
146 https://github.com/torvalds/linux/blob/master/arch/arm64/Kconfig#L1526-L1542
147
148 I don't see the harm in a separate check for `COMPAT`. That flag has been around for years and not changed across architectures IIRC.
149
150 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2022-10-22 19:06](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/74#issuecomment-1287885578):
151
152 That's a good point!
153 I'll return with the results.
154
155
156 -------------------------------------------------------------------------------
157
158 # [\#73 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/73) `closed`: ERORR?
159
160 #### <img src="https://avatars.githubusercontent.com/u/77776927?v=4" width="50">[alpahca](https://github.com/alpahca) opened issue at [2022-09-24 15:03](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/73):
161
162 i was try to some book(Billimoria, Kaiwan N. Linux Kernel Debugging: Leverage proven tools and advanced techniques to effectively debug Linux kernels and kernel modules (p. 61). Packt Publishing. Kindle Edition. ).
163
164 but.
165
166 $ bin/kconfig-hardened-check -p X86_64 -c ~/lkd_kernels/kconfig.prod01/.config
167 [!] ERROR: --config and --print can't be used together
168
169 what should i do?
170
171 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2022-09-24 21:18](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/73#issuecomment-1257066908):
172
173 Hi @alpahca,
174
175 Quoting `kconfig-hardened-check --help`:
176 ```
177   -p {X86_64,X86_32,ARM64,ARM}, --print {X86_64,X86_32,ARM64,ARM}
178                         print security hardening preferences for the selected architecture
179   -c CONFIG, --config CONFIG
180                         check the kernel kconfig file against these preferences
181 ```
182
183 So for checking your kernel config simply do this:
184 ```
185 $ bin/kconfig-hardened-check -c ~/lkd_kernels/kconfig.prod01/.config
186 ```
187
188 #### <img src="https://avatars.githubusercontent.com/u/77776927?v=4" width="50">[alpahca](https://github.com/alpahca) commented at [2022-10-11 07:42](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/73#issuecomment-1274233073):
189
190 Oh thx.
191 But... 
192 VirtualBox:~/lkd_kernels/kconfig_prod01$ '/home/ked/kconfig-hardened-check/bin/kconfig-hardened-check' -c '/home/ked/lkd_kernels/kconfig_prod01'
193 [+] Kconfig file to check: /home/ked/lkd_kernels/kconfig_prod01
194 Traceback (most recent call last):
195 File "/home/ked/kconfig-hardened-check/bin/kconfig-hardened-check", line 16, in
196 kconfig_hardened_check.main()
197 File "/home/ked/kconfig-hardened-check/kconfig_hardened_check/init.py", line 976, in main
198 arch, msg = detect_arch(args.config, supported_archs)
199 File "/home/ked/kconfig-hardened-check/kconfig_hardened_check/init.py", line 275, in detect_arch
200 with open(fname, 'r') as f:
201 IsADirectoryError: [Errno 21] Is a directory: '/home/ked/lkd_kernels/kconfig_prod01'
202
203 Uhm... that should be my problem?
204
205 -----Original Message-----
206 From: "Alexander ***@***.***>
207 To: ***@***.***>;
208 Cc: ***@***.***>; ***@***.***>;
209 Sent: 2022-09-25 (일) 06:18:44 (GMT+09:00)
210 Subject: Re: [a13xp0p0v/kconfig-hardened-check] ERORR? (Issue #73)
211
212 Hi @alpahca,
213 Quoting kconfig-hardened-check --help:
214 -p {X86_64,X86_32,ARM64,ARM}, --print {X86_64,X86_32,ARM64,ARM} print security hardening preferences for the selected architecture -c CONFIG, --config CONFIG check the kernel kconfig file against these preferences
215 So for checking your kernel config simply do this:
216 $ bin/kconfig-hardened-check -c ~/lkd_kernels/kconfig.prod01/.config
217
218 Reply to this email directly, view it on GitHub, or unsubscribe.
219 You are receiving this because you were mentioned.Message ID: ***@***.***>
220
221
222 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2022-10-22 19:27](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/73#issuecomment-1287890539):
223
224 Hi @alpahca,
225
226 Please try to use `-c` with the path to the kconfig file, not a directory.
227
228 Best regards,
229 Alexander
230
231
232 -------------------------------------------------------------------------------
233
234 # [\#71 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/71) `closed`: Config change in 5.19.X
235
236 #### <img src="https://avatars.githubusercontent.com/u/11868071?u=d7a5841263276e1f323827fc21b04345df594a60&v=4" width="50">[Churam](https://github.com/Churam) opened issue at [2022-08-31 08:18](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/71):
237
238 Hello,
239
240 The X86_SMAP option is no longer present in 5.19.X kernels. It is now enforced.
241 ( [commit](https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.19.5&id=c5a3d3c01e90e74166f95eec9db6fcc3ba72a9d6) )
242
243 Since it has been removed, the script mark the entry as failed.
244 ```
245 [+] Special report mode: show_fail
246 [+] Kconfig file to check: /opt/KERNEL/linux-5.19.5/.config
247 [+] Detected architecture: X86_64
248 [+] Detected kernel version: 5.19
249 =========================================================================================================================
250               option name               | type  |desired val | decision |      reason      | check result
251 =========================================================================================================================
252 CONFIG_X86_SMAP                         |kconfig|     y      |defconfig | self_protection  | FAIL: not found
253 ```
254
255
256
257 The GCC_PLUGIN_RANDSTRUCT and GCC_PLUGIN_RANDSTRUCT_PERFORMANCE have changed now that CLANG has the feature. ( [commit](https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.19.y&id=595b893e2087de306d0781795fb8ec47873596a6) ). They are now nammed RANDSTRUCT_FULL and RANDSTRUCT_PERFORMANCE respectively. 
258
259 At the moment they don't fail but the new entries should be added in the script I think. 
260 ```
261  grep RANDSTRUCT ./.config
262 # CONFIG_RANDSTRUCT_NONE is not set
263 CONFIG_RANDSTRUCT_FULL=y
264 # CONFIG_RANDSTRUCT_PERFORMANCE is not set
265 CONFIG_RANDSTRUCT=y
266 CONFIG_GCC_PLUGIN_RANDSTRUCT=y
267 ```
268
269
270
271 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2022-09-02 11:42](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/71#issuecomment-1235396338):
272
273 Hi @Churam,
274
275 Thanks for your report!
276
277 I've improved the checks, please have a look.
278
279 #### <img src="https://avatars.githubusercontent.com/u/203012?u=939d6d3b5ff0b9e46e911d8792a40c20408574e2&v=4" width="50">[anthraxx](https://github.com/anthraxx) commented at [2022-09-06 19:29](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/71#issuecomment-1238566204):
280
281 maybe it would make sense to tag a new release after :cat:
282
283 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2022-09-09 08:23](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/71#issuecomment-1241663085):
284
285 Hi @anthraxx,
286
287 I have a complex and time-consuming procedure for preparing the kconfig-hardened-check releases.
288
289 I’m planning to do this work for the next Linux kernel release.
290
291
292 -------------------------------------------------------------------------------
293
294 # [\#70 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/70) `closed`: COPR repo with built kernel with suggested recommendations
295
296 #### <img src="https://avatars.githubusercontent.com/u/75043245?u=eb07d86df642ef04f9e53169e65f500ea367c63f&v=4" width="50">[Krish-sysadmin](https://github.com/Krish-sysadmin) opened issue at [2022-07-21 15:19](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/70):
297
298 Hi. This repository has been incredibly useful to me as of late. I’m trying to do the following: create a COPR repository for example such that it takes the kernel configuration from Fedora’s latest kernel build for say 36 and then applies the recommended options here, handles setting everything on/off etc for everything that depends on that option and everything setting that option depends on while blacklisting certain recommendations such that it doesn’t break certain apps etc. Post doing this it would grab the source code for that kernel versions and build it with those configs and then one would just install the kernel normally.
299
300 How would one go about implementing this? Thank you!
301
302 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2022-07-21 19:48](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/70#issuecomment-1191870587):
303
304 Hi Krish,
305
306 This approach can be called "creating a kernel flavour". Some distros do that.
307
308 For example, see:
309  - Ubuntu kernel flavours: https://wiki.ubuntu.com/Kernel/Dev/Flavours
310  - Suse kernel flavours: https://www.suse.com/support/kb/doc/?id=000017133
311  - The discussion about NixOS hardened kernel: https://github.com/NixOS/nixpkgs/issues/76850
312
313 #### <img src="https://avatars.githubusercontent.com/u/75043245?u=eb07d86df642ef04f9e53169e65f500ea367c63f&v=4" width="50">[Krish-sysadmin](https://github.com/Krish-sysadmin) commented at [2022-07-21 22:18](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/70#issuecomment-1191988714):
314
315 Yes, thank you I understand that but how would I have your script/tool change the .config to be more hardened and then have that grab new kernel sources and automatically build like if I was to hold a COPR?
316
317 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2022-07-22 21:00](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/70#issuecomment-1192931275):
318
319 Thanks Krish, now I see what you mean.
320
321 There is an enhancement #67. Maybe it would help to solve your task.
322 ```
323 Create a tool that changes kconfig options according the recommendations
324 ```
325 It should use the JSON output of `kconfig-hardened-check` and work with kconfig with [kconfiglib](https://pypi.org/project/kconfiglib/).
326
327 What do you think?
328
329 #### <img src="https://avatars.githubusercontent.com/u/75043245?u=eb07d86df642ef04f9e53169e65f500ea367c63f&v=4" width="50">[Krish-sysadmin](https://github.com/Krish-sysadmin) commented at [2022-07-23 03:10](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/70#issuecomment-1193047106):
330
331 For sure, this project is perhaps one of the best and most usable for kernel hardening and I would definitely be able to help if you can get started or others with implementing this. Thank you!
332
333 #### <img src="https://avatars.githubusercontent.com/u/75043245?u=eb07d86df642ef04f9e53169e65f500ea367c63f&v=4" width="50">[Krish-sysadmin](https://github.com/Krish-sysadmin) commented at [2022-07-23 03:12](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/70#issuecomment-1193047378):
334
335 It would be incredibly useful to instead of being developing sideways independent projects like linux-hardened or grsecurity to be working more close with upstream like you are - getting all the performance improvements, bug fixes and applying all available "vanilla" security fixes and pushing this to distributions using that tool. Then people can work off it. Even if it's not "revolutionary" I definitely believe in the long term it would help make Linux even better!
336
337 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2022-07-24 15:44](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/70#issuecomment-1193343924):
338
339 I can't comment about `grsecurity`. This topic is complex... Anyway, they are pioneers in kernel security hardening.
340
341 The goal of `KSPP` is to develop kernel self-protection features for the mainline kernel. I hope my `kconfig-hardened-check` project also promotes these security features among Linux distros.
342
343
344 -------------------------------------------------------------------------------
345
346 # [\#69 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/69) `open`: Create documentation describing Linux kernel security options
347 **Labels**: `enhancement`
348
349
350 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) opened issue at [2022-07-04 10:43](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/69):
351
352
353
354
355
356
357 -------------------------------------------------------------------------------
358
359 # [\#68 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/68) `closed`: Create a tool reporting mainline kernel versions that support a recommended option
360 **Labels**: `enhancement`
361
362
363 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) opened issue at [2022-07-04 00:34](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/68):
364
365
366
367 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2022-07-17 15:25](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/68#issuecomment-1186547339):
368
369 The LKDDb project solves this task. Added info to the README.
370
371 Good. Closing the issue.
372
373
374 -------------------------------------------------------------------------------
375
376 # [\#67 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/67) `open`: Create a tool that changes kconfig options according to the recommendations
377 **Labels**: `enhancement`
378
379
380 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) opened issue at [2022-07-04 00:25](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/67):
381
382 It should use the JSON output of kconfig-hardened-check.
383
384 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2022-07-17 13:43](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/67#issuecomment-1186522515):
385
386 See https://pypi.org/project/kconfiglib/
387
388
389 -------------------------------------------------------------------------------
390
391 # [\#66 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/66) `open`: Evaluate performance penalty of the recommended kernel options
392 **Labels**: `enhancement`
393
394
395 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) opened issue at [2022-07-03 09:57](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/66):
396
397 As the first step, @BlackIkeEagle made some performance tests and described the results in [this article](https://blog.herecura.eu/blog/2020-05-30-kconfig-hardening-tests/).
398
399 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2022-12-08 14:46](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/66#issuecomment-1342846087):
400
401 Create a solution for automating this process:
402  1. Take defconfig as a basic kernel configuration.
403  2. Build the Linux kernel.
404  3. Start test system with this kernel (a hardware machine may give more consistent results than a virtual machine). If the system doesn't boot, go to step 6.
405  4. Run the chosen performance tests (hackbench, kernel compilation, network throughput evaluation, etc).
406  5. Save the test results.
407  6. Set another kernel option from the kconfig-hardened-check json output and go to step 2 (see #67). If all recommendations are already tested, then proceed to step 7.
408  7. Analyze the results of the performance testing.
409
410 That approach would save us from plenty of boring manual routine.
411
412 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2022-12-08 18:58](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/66#issuecomment-1343190811):
413
414 Similar performance testing of a group of  security hardening options may give interesting results as well.
415
416
417 -------------------------------------------------------------------------------
418
419 # [\#65 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/65) `open`: Support checking sysctl security options
420 **Labels**: `enhancement`
421
422
423 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) opened issue at [2022-07-03 09:50](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/65):
424
425 The `OptCheck` class inheritance now allows to implement this feature.
426
427
428
429
430 -------------------------------------------------------------------------------
431
432 # [\#64 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/64) `open`: script fetch configs from different kernel images for current architecture
433
434 #### <img src="https://avatars.githubusercontent.com/u/106462796?v=4" width="50">[o8opi](https://github.com/o8opi) opened issue at [2022-06-01 06:34](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/64):
435
436 This script now tries to fetch and/or build the different kernel images for current architecture and derive the kernel configs from them
437
438 #### <img src="https://avatars.githubusercontent.com/u/106462796?v=4" width="50">[o8opi](https://github.com/o8opi) commented at [2022-06-01 06:36](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/64#issuecomment-1143174866):
439
440 This might resolve #63
441
442 #### <img src="https://avatars.githubusercontent.com/u/65553080?u=1e9e0de760ac0083c86dab588f627a0468cd714e&v=4" width="50">[codecov-commenter](https://github.com/codecov-commenter) commented at [2022-06-08 15:30](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/64#issuecomment-1150072367):
443
444 # [Codecov](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/64?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov) Report
445 > Merging [#64](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/64?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov) (86b6b08) into [master](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/commit/0d5c56f297fca50a48dfc602a5b4118b8ebdbceb?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov) (0d5c56f) will **not change** coverage.
446 > The diff coverage is `n/a`.
447
448 ```diff
449 @@           Coverage Diff           @@
450 ##           master      #64   +/-   ##
451 =======================================
452   Coverage   98.08%   98.08%           
453 =======================================
454   Files           3        3           
455   Lines         625      625           
456   Branches      139      139           
457 =======================================
458   Hits          613      613           
459   Misses          5        5           
460   Partials        7        7           
461 ```
462
463 | Flag | Coverage Δ | |
464 |---|---|---|
465 | functional_test | `98.08% <ø> (ø)` | |
466
467 Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov#carryforward-flags-in-the-pull-request-comment) to find out more.
468
469 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2022-06-10 16:49](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/64#issuecomment-1152552051):
470
471 Hello @o8opi,
472
473 I tried your version of this script in a Docker container with Ubuntu 20.04.2.
474
475 It failed with the error:
476 ```
477 ...
478 copying path '/nix/store/l920bx9bw37jd681pk98dfra0j3lanva-libarchive-3.6.1-lib' from 'https://cache.nixos.org'...
479 copying path '/nix/store/km0c80plib16fp76prmhcdwbag9iqnvf-nix-2.9.1' from 'https://cache.nixos.org'...
480 copying path '/nix/store/0szyscpg632p7vlj9if5gadwlvwcb91d-nix-2.9.1-dev' from 'https://cache.nixos.org'...
481 building '/nix/store/yz1y19d71lp53jymd51h4qw9c2663x6a-builder.pl.drv'...
482 building '/nix/store/c539pzdghlrfcik2qymswm30ycbdj3yz-python3-3.9.13-env.drv'...
483 created 226 symlinks in user environment
484 Traceback (most recent call last):
485   File "/home/a13x/src/kconfig-hardened-check/contrib/./get-nix-kconfig.py", line 61, in <module>
486     main()
487   File "/home/a13x/src/kconfig-hardened-check/contrib/./get-nix-kconfig.py", line 16, in main
488     data = json.loads(proc.stdout)
489   File "/nix/store/553d7c4xcwp9j1a1gb9cb1s9ry3x1pi9-python3-3.9.13/lib/python3.9/json/__init__.py", line 346, in loads
490     return _default_decoder.decode(s)
491   File "/nix/store/553d7c4xcwp9j1a1gb9cb1s9ry3x1pi9-python3-3.9.13/lib/python3.9/json/decoder.py", line 337, in decode
492     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
493   File "/nix/store/553d7c4xcwp9j1a1gb9cb1s9ry3x1pi9-python3-3.9.13/lib/python3.9/json/decoder.py", line 355, in raw_decode
494     raise JSONDecodeError("Expecting value", s, err.value) from None
495 json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
496 ```
497
498 It looks like ` json.loads()` didn't manage to handle the output of `nix search`.
499
500 #### <img src="https://avatars.githubusercontent.com/u/106462796?v=4" width="50">[o8opi](https://github.com/o8opi) commented at [2022-07-16 11:53](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/64#issuecomment-1186164603):
501
502 this should work better now
503
504 #### <img src="https://avatars.githubusercontent.com/u/106462796?v=4" width="50">[o8opi](https://github.com/o8opi) commented at [2022-07-17 21:53](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/64#issuecomment-1186613685):
505
506 I have tested in an Ubuntu-20.04 container and it worked for me, can share Dockerfile if needed :)
507
508 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2022-07-21 19:38](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/64#issuecomment-1191862516):
509
510 Hello @o8opi,
511
512 Now it works better, but gives a bunch of other errors:
513 ```
514 created 223 symlinks in user environment
515 extract-vmlinux: Cannot find vmlinux.
516 Usage: extract-ikconfig <kernel-image>
517 failed to extract config from legacyPackages.x86_64-linux.linuxPackages_5_10_hardened.kernel
518 extract-vmlinux: Cannot find vmlinux.
519 Usage: extract-ikconfig <kernel-image>
520 failed to extract config from legacyPackages.x86_64-linux.linuxPackages_5_15_hardened.kernel
521 extract-vmlinux: Cannot find vmlinux.
522 Usage: extract-ikconfig <kernel-image>
523 failed to extract config from legacyPackages.x86_64-linux.linuxPackages_5_18_hardened.kernel
524 extract-vmlinux: Cannot find vmlinux.
525 Usage: extract-ikconfig <kernel-image>
526 failed to extract config from legacyPackages.x86_64-linux.linuxPackages_hardened.kernel
527 error: Package ‘linux-4.14.180-176’ in /nix/store/xcba8ikxvdzw7ycg5ncnfq37w9491cn9-source/pkgs/os-specific/linux/kernel/linux-hardkernel-4.14.nix:4 is not supported on ‘x86_64-linux’, refusing to evaluate.
528
529        a) To temporarily allow packages that are unsupported for this system, you can use an environment variable
530           for a single invocation of the nix tools.
531
532             $ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1
533
534         Note: For `nix shell`, `nix build`, `nix develop` or any other Nix 2.4+
535         (Flake) command, `--impure` must be passed in order to read this
536         environment variable.
537
538        b) For `nixos-rebuild` you can set
539          { nixpkgs.config.allowUnsupportedSystem = true; }
540        in configuration.nix to override this.
541
542        c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
543          { allowUnsupportedSystem = true; }
544        to ~/.config/nixpkgs/config.nix.
545 (use '--show-trace' to show detailed location information)
546 failed to build legacyPackages.x86_64-linux.linuxPackages_hardkernel_latest.kernel
547 extract-vmlinux: Cannot find vmlinux.
548 Usage: extract-ikconfig <kernel-image>
549 failed to extract config from legacyPackages.x86_64-linux.linuxPackages_latest.kernel
550 extract-vmlinux: Cannot find vmlinux.
551 Usage: extract-ikconfig <kernel-image>
552 failed to extract config from legacyPackages.x86_64-linux.linuxPackages_latest-libre.kernel
553 extract-vmlinux: Cannot find vmlinux.
554 Usage: extract-ikconfig <kernel-image>
555 failed to extract config from legacyPackages.x86_64-linux.linuxPackages_lqx.kernel
556 error: Package ‘linux-5.18.12-bcachefs-unstable-2022-04-25’ in /nix/store/xcba8ikxvdzw7ycg5ncnfq37w9491cn9-source/pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix:15 is marked as broken, refusing to evaluate.
557
558        a) To temporarily allow broken packages, you can use an environment variable
559           for a single invocation of the nix tools.
560
561             $ export NIXPKGS_ALLOW_BROKEN=1
562
563         Note: For `nix shell`, `nix build`, `nix develop` or any other Nix 2.4+
564         (Flake) command, `--impure` must be passed in order to read this
565         environment variable.
566
567        b) For `nixos-rebuild` you can set
568          { nixpkgs.config.allowBroken = true; }
569        in configuration.nix to override this.
570
571        c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
572          { allowBroken = true; }
573        to ~/.config/nixpkgs/config.nix.
574 (use '--show-trace' to show detailed location information)
575 failed to build legacyPackages.x86_64-linux.linuxPackages_testing_bcachefs.kernel
576 extract-vmlinux: Cannot find vmlinux.
577 Usage: extract-ikconfig <kernel-image>
578 failed to extract config from legacyPackages.x86_64-linux.linuxPackages_xanmod.kernel
579 extract-vmlinux: Cannot find vmlinux.
580 Usage: extract-ikconfig <kernel-image>
581 failed to extract config from legacyPackages.x86_64-linux.linuxPackages_xanmod_latest.kernel
582 extract-vmlinux: Cannot find vmlinux.
583 Usage: extract-ikconfig <kernel-image>
584 failed to extract config from legacyPackages.x86_64-linux.linuxPackages_zen.kernel
585 ```
586
587 I see at least three different kinds of errors here.
588 Could you have a look?
589
590 I would also ask you to rebase your branch over `origin/master`.
591
592 Thanks!
593
594
595 -------------------------------------------------------------------------------
596
597 # [\#63 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/63) `open`: Fix getting Nix kconfig (contrib)
598 **Labels**: `bug`
599
600
601 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) opened issue at [2022-04-27 23:30](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/63):
602
603 Hello @Mic92, could you help with this Nix problem?
604
605 I tested the installation of `kconfig-hardened-check` in a Docker container with Ubuntu 20.04.4 LTS.
606
607 It failed with the following error:
608
609 ```
610 a13x@dc92d9d74557:~/src/1/kconfig-hardened-check/contrib$ ./get-nix-kconfig.py 
611 these 50 paths will be fetched (94.58 MiB download, 374.80 MiB unpacked):
612   /nix/store/058drky7qcyd04rzqcmxh86xmifw96dx-glibc-2.34-115-bin
613   /nix/store/1442kn5q9ah0bhhqm99f8nr76diczqgm-gnused-4.8
614   /nix/store/19xbyxc31snlk60cil7cx6l4xw126ids-gcc-11.2.0
615   /nix/store/4r26nvzfa1qfjaqgr2bpw2fz8c6qnk3s-gnutar-1.34
616   /nix/store/58pwclg9yr437h0pfgrnbd0jis8fqasd-gcc-wrapper-11.2.0
617   /nix/store/5h6q8cmqjd8iqpd99566hrg2a56pwdkc-acl-2.3.1
618   /nix/store/6rbwy3mf0w8z119bwqs7dcrc2vyql9sf-expand-response-params
619   /nix/store/7b2vmi7cq7lzw8g6kaihzg2kyilj4slm-bash-interactive-5.1-p16-dev
620   /nix/store/87xq1difvspida4391y23vylkjdcgllf-linux-headers-5.16
621   /nix/store/9l06npv9sp8avdraahzi4kqhcp607d8p-tzdata-2022a
622   /nix/store/9pxskbhf92x9cxvg87nbzw2q1kmkrym6-bash-interactive-5.1-p16-info
623   /nix/store/9wq21cbqsxpdx4dk0q6gab00fcir04d1-gzip-1.12
624   /nix/store/a0k6rfn47h9f69p15pg415x6pfpxhsl5-gdbm-1.23
625   /nix/store/a5xpjds3mlln26469h72v1jmd00jq6lv-xz-5.2.5
626   /nix/store/ayrsyv7npr0lcbann4k9lxr19x813f0z-glibc-2.34-115
627   /nix/store/b36ilvc5hhfpcp7kv1kvrkgcxxpmxfsd-zlib-1.2.12
628   /nix/store/bavmqg7c4366hbiccpsdawbilh68dajy-xz-5.2.5-bin
629   /nix/store/bndvc0y3v4djij152wiqbyn13zs2xivy-pcre-8.45
630   /nix/store/bqkx3pi50phcglv0l551jhp96bq8njl0-gnugrep-3.7
631   /nix/store/c7062r0rh84w3v77pqwdcggrsdlvy1df-findutils-4.9.0
632   /nix/store/clkdigybx5w29rjxnwnsk76q49gb12k7-ncurses-6.3
633   /nix/store/d60gkg5dkw4y5kc055n4m0xyvcjz65im-bash-interactive-5.1-p16
634   /nix/store/dgic5ks4yixhh0havidjwd02rskmqlgp-binutils-wrapper-2.38
635   /nix/store/dxj6b99zh4fh5z65rqirmcfvffxx5ig0-readline-8.1p2
636   /nix/store/f2fnhhjanmxganm3xa5inwgvi6wj2ran-bash-interactive-5.1-p16-doc
637   /nix/store/fcd0m68c331j7nkdxvnnpb8ggwsaiqac-bash-5.1-p16
638   /nix/store/gm6q7jmajjmnwd29wgbq2jm3x37vsw3h-libffi-3.4.2
639   /nix/store/hgl0ydlkgs6y6hx9h7k209shw3v7z77j-coreutils-9.0
640   /nix/store/hym1n0ygqp9wcm7pxn4sfrql3fg7xa09-python3-3.9.12
641   /nix/store/ik4qlj53grwmg7avzrfrn34bjf6a30ch-libunistring-1.0
642   /nix/store/jm3nxvmxcm5nvalbv28acvygismcykvj-gnumake-4.3
643   /nix/store/k3wp5kdxwa4ysb6nh5y9yll5n30cja5m-patch-2.7.6
644   /nix/store/m2vh2ny7bqpwij1gpmvl5gxj7y4dgr4f-binutils-2.38
645   /nix/store/n239ln3v669s5fkir2fd8niqawyg6qrv-attr-2.5.1
646   /nix/store/pmyiksh5sgqzakbr84qsfxqy8fgirmic-stdenv-linux
647   /nix/store/psijdi9190zgbp053y6dj3ax4y2l70gk-gcc-11.2.0-lib
648   /nix/store/pvn23vycg674bj6nypjcfyhqbr85rqxa-glibc-2.34-115-dev
649   /nix/store/qd3g8rk5hx5zkb70idjh6fa12sh6bipg-mailcap-2.1.53
650   /nix/store/qvs678k05yrv566dmqdnxfbzi4s6ir1n-sqlite-3.38.2
651   /nix/store/rf3j3p8cvn0dr5wdl65ns9f8wnlca8h6-readline-6.3p08
652   /nix/store/sj2plsn7wz94dkwvg1wlb11pjch6r70v-diffutils-3.8
653   /nix/store/v8vpzh3slc5hm4d9id5bim4dsb4d2ndh-openssl-1.1.1n
654   /nix/store/v990x4cib4dssspn4778rlz46jmm3a9k-expat-2.4.7
655   /nix/store/vz05jxs509mgp5i5jbrgvgvg4a2p3a3m-ed-1.18
656   /nix/store/w3zngkrag7vnm7v1q8vnqb71q6a1w8gn-libidn2-2.3.2
657   /nix/store/wcj03nlvxsjrc1cmpl2nhpn80l5wvf8j-gawk-5.1.1
658   /nix/store/x6jr3j9hxs8ld8cy69gy9aykrm3iz8rv-patchelf-0.14.5
659   /nix/store/yjndwl7872iqhw7m97gv7kwgwd5d66s5-bzip2-1.0.6.0.2-bin
660   /nix/store/zf03nlnk9h724gz7qzzbrzyqif8gbwhq-bzip2-1.0.6.0.2
661   /nix/store/zghsxxqb2gyz460q4r7jfdc2lpg3rgjw-bash-interactive-5.1-p16-man
662 copying path '/nix/store/f2fnhhjanmxganm3xa5inwgvi6wj2ran-bash-interactive-5.1-p16-doc' from 'https://cache.nixos.org'...
663 copying path '/nix/store/9pxskbhf92x9cxvg87nbzw2q1kmkrym6-bash-interactive-5.1-p16-info' from 'https://cache.nixos.org'...
664 copying path '/nix/store/zghsxxqb2gyz460q4r7jfdc2lpg3rgjw-bash-interactive-5.1-p16-man' from 'https://cache.nixos.org'...
665 copying path '/nix/store/ik4qlj53grwmg7avzrfrn34bjf6a30ch-libunistring-1.0' from 'https://cache.nixos.org'...
666 copying path '/nix/store/87xq1difvspida4391y23vylkjdcgllf-linux-headers-5.16' from 'https://cache.nixos.org'...
667 copying path '/nix/store/w3zngkrag7vnm7v1q8vnqb71q6a1w8gn-libidn2-2.3.2' from 'https://cache.nixos.org'...
668 copying path '/nix/store/qd3g8rk5hx5zkb70idjh6fa12sh6bipg-mailcap-2.1.53' from 'https://cache.nixos.org'...
669 copying path '/nix/store/ayrsyv7npr0lcbann4k9lxr19x813f0z-glibc-2.34-115' from 'https://cache.nixos.org'...
670 copying path '/nix/store/9l06npv9sp8avdraahzi4kqhcp607d8p-tzdata-2022a' from 'https://cache.nixos.org'...
671 copying path '/nix/store/n239ln3v669s5fkir2fd8niqawyg6qrv-attr-2.5.1' from 'https://cache.nixos.org'...
672 copying path '/nix/store/fcd0m68c331j7nkdxvnnpb8ggwsaiqac-bash-5.1-p16' from 'https://cache.nixos.org'...
673 copying path '/nix/store/5h6q8cmqjd8iqpd99566hrg2a56pwdkc-acl-2.3.1' from 'https://cache.nixos.org'...
674 copying path '/nix/store/zf03nlnk9h724gz7qzzbrzyqif8gbwhq-bzip2-1.0.6.0.2' from 'https://cache.nixos.org'...
675 copying path '/nix/store/hgl0ydlkgs6y6hx9h7k209shw3v7z77j-coreutils-9.0' from 'https://cache.nixos.org'...
676 copying path '/nix/store/yjndwl7872iqhw7m97gv7kwgwd5d66s5-bzip2-1.0.6.0.2-bin' from 'https://cache.nixos.org'...
677 copying path '/nix/store/sj2plsn7wz94dkwvg1wlb11pjch6r70v-diffutils-3.8' from 'https://cache.nixos.org'...
678 copying path '/nix/store/vz05jxs509mgp5i5jbrgvgvg4a2p3a3m-ed-1.18' from 'https://cache.nixos.org'...
679 copying path '/nix/store/6rbwy3mf0w8z119bwqs7dcrc2vyql9sf-expand-response-params' from 'https://cache.nixos.org'...
680 copying path '/nix/store/v990x4cib4dssspn4778rlz46jmm3a9k-expat-2.4.7' from 'https://cache.nixos.org'...
681 copying path '/nix/store/c7062r0rh84w3v77pqwdcggrsdlvy1df-findutils-4.9.0' from 'https://cache.nixos.org'...
682 copying path '/nix/store/wcj03nlvxsjrc1cmpl2nhpn80l5wvf8j-gawk-5.1.1' from 'https://cache.nixos.org'...
683 copying path '/nix/store/psijdi9190zgbp053y6dj3ax4y2l70gk-gcc-11.2.0-lib' from 'https://cache.nixos.org'...
684 copying path '/nix/store/a0k6rfn47h9f69p15pg415x6pfpxhsl5-gdbm-1.23' from 'https://cache.nixos.org'...
685 copying path '/nix/store/058drky7qcyd04rzqcmxh86xmifw96dx-glibc-2.34-115-bin' from 'https://cache.nixos.org'...
686 copying path '/nix/store/jm3nxvmxcm5nvalbv28acvygismcykvj-gnumake-4.3' from 'https://cache.nixos.org'...
687 copying path '/nix/store/pvn23vycg674bj6nypjcfyhqbr85rqxa-glibc-2.34-115-dev' from 'https://cache.nixos.org'...
688 copying path '/nix/store/1442kn5q9ah0bhhqm99f8nr76diczqgm-gnused-4.8' from 'https://cache.nixos.org'...
689 copying path '/nix/store/4r26nvzfa1qfjaqgr2bpw2fz8c6qnk3s-gnutar-1.34' from 'https://cache.nixos.org'...
690 copying path '/nix/store/9wq21cbqsxpdx4dk0q6gab00fcir04d1-gzip-1.12' from 'https://cache.nixos.org'...
691 copying path '/nix/store/gm6q7jmajjmnwd29wgbq2jm3x37vsw3h-libffi-3.4.2' from 'https://cache.nixos.org'...
692 copying path '/nix/store/clkdigybx5w29rjxnwnsk76q49gb12k7-ncurses-6.3' from 'https://cache.nixos.org'...
693 copying path '/nix/store/v8vpzh3slc5hm4d9id5bim4dsb4d2ndh-openssl-1.1.1n' from 'https://cache.nixos.org'...
694 copying path '/nix/store/k3wp5kdxwa4ysb6nh5y9yll5n30cja5m-patch-2.7.6' from 'https://cache.nixos.org'...
695 copying path '/nix/store/x6jr3j9hxs8ld8cy69gy9aykrm3iz8rv-patchelf-0.14.5' from 'https://cache.nixos.org'...
696 copying path '/nix/store/bndvc0y3v4djij152wiqbyn13zs2xivy-pcre-8.45' from 'https://cache.nixos.org'...
697 copying path '/nix/store/rf3j3p8cvn0dr5wdl65ns9f8wnlca8h6-readline-6.3p08' from 'https://cache.nixos.org'...
698 copying path '/nix/store/bqkx3pi50phcglv0l551jhp96bq8njl0-gnugrep-3.7' from 'https://cache.nixos.org'...
699 copying path '/nix/store/dxj6b99zh4fh5z65rqirmcfvffxx5ig0-readline-8.1p2' from 'https://cache.nixos.org'...
700 copying path '/nix/store/a5xpjds3mlln26469h72v1jmd00jq6lv-xz-5.2.5' from 'https://cache.nixos.org'...
701 copying path '/nix/store/d60gkg5dkw4y5kc055n4m0xyvcjz65im-bash-interactive-5.1-p16' from 'https://cache.nixos.org'...
702 copying path '/nix/store/bavmqg7c4366hbiccpsdawbilh68dajy-xz-5.2.5-bin' from 'https://cache.nixos.org'...
703 copying path '/nix/store/7b2vmi7cq7lzw8g6kaihzg2kyilj4slm-bash-interactive-5.1-p16-dev' from 'https://cache.nixos.org'...
704 copying path '/nix/store/b36ilvc5hhfpcp7kv1kvrkgcxxpmxfsd-zlib-1.2.12' from 'https://cache.nixos.org'...
705 copying path '/nix/store/m2vh2ny7bqpwij1gpmvl5gxj7y4dgr4f-binutils-2.38' from 'https://cache.nixos.org'...
706 copying path '/nix/store/19xbyxc31snlk60cil7cx6l4xw126ids-gcc-11.2.0' from 'https://cache.nixos.org'...
707 copying path '/nix/store/dgic5ks4yixhh0havidjwd02rskmqlgp-binutils-wrapper-2.38' from 'https://cache.nixos.org'...
708 copying path '/nix/store/qvs678k05yrv566dmqdnxfbzi4s6ir1n-sqlite-3.38.2' from 'https://cache.nixos.org'...
709 copying path '/nix/store/58pwclg9yr437h0pfgrnbd0jis8fqasd-gcc-wrapper-11.2.0' from 'https://cache.nixos.org'...
710 copying path '/nix/store/hym1n0ygqp9wcm7pxn4sfrql3fg7xa09-python3-3.9.12' from 'https://cache.nixos.org'...
711
712 copying path '/nix/store/pmyiksh5sgqzakbr84qsfxqy8fgirmic-stdenv-linux' from 'https://cache.nixos.org'...
713 Traceback (most recent call last):
714   File "/home/a13x/src/1/kconfig-hardened-check/contrib/./get-nix-kconfig.py", line 30, in <module>
715     main()
716   File "/home/a13x/src/1/kconfig-hardened-check/contrib/./get-nix-kconfig.py", line 16, in main
717     data = json.loads(proc.stdout)
718   File "/nix/store/hym1n0ygqp9wcm7pxn4sfrql3fg7xa09-python3-3.9.12/lib/python3.9/json/__init__.py", line 346, in loads
719     return _default_decoder.decode(s)
720   File "/nix/store/hym1n0ygqp9wcm7pxn4sfrql3fg7xa09-python3-3.9.12/lib/python3.9/json/decoder.py", line 337, in decode
721     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
722   File "/nix/store/hym1n0ygqp9wcm7pxn4sfrql3fg7xa09-python3-3.9.12/lib/python3.9/json/decoder.py", line 355, in raw_decode
723     raise JSONDecodeError("Expecting value", s, err.value) from None
724 json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
725 ```
726
727 Hoping for your help with Nix, @Mic92!
728
729
730
731
732 -------------------------------------------------------------------------------
733
734 # [\#62 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/62) `merged`: Add BLK_DEV_FD_RAWCMD
735 **Labels**: `kernel_maintainer_feedback`
736
737
738 #### <img src="https://avatars.githubusercontent.com/u/150761?u=f98bb82be5009ecefd6ee9bc3d60fcf082f8cf49&v=4" width="50">[evdenis](https://github.com/evdenis) opened issue at [2022-04-27 18:15](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/62):
739
740 See commit torvalds/linux@233087ca0636 ("floppy: disable FDRAWCMD by default")
741
742 Signed-off-by: Denis Efremov <efremov@linux.com>
743
744 #### <img src="https://avatars.githubusercontent.com/u/65553080?u=1e9e0de760ac0083c86dab588f627a0468cd714e&v=4" width="50">[codecov-commenter](https://github.com/codecov-commenter) commented at [2022-04-27 18:16](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/62#issuecomment-1111331853):
745
746 # [Codecov](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/62?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov) Report
747 > Merging [#62](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/62?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov) (bbe60e7) into [master](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/commit/61bfef8931bcefc1abb6d3d46e169c8372ce729b?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov) (61bfef8) will **increase** coverage by `0.01%`.
748 > The diff coverage is `100.00%`.
749
750 ```diff
751 @@            Coverage Diff             @@
752 ##           master      #62      +/-   ##
753 ==========================================
754 + Coverage   90.32%   90.33%   +0.01%     
755 ==========================================
756   Files           3        3              
757   Lines         589      590       +1     
758   Branches      137      137              
759 ==========================================
760 + Hits          532      533       +1     
761   Misses         29       29              
762   Partials       28       28              
763 ```
764
765 | Flag | Coverage Δ | |
766 |---|---|---|
767 | functional_test | `90.33% <100.00%> (+0.01%)` | :arrow_up: |
768
769 Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov#carryforward-flags-in-the-pull-request-comment) to find out more.
770
771 | [Impacted Files](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/62?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov) | Coverage Δ | |
772 |---|---|---|
773 | [kconfig\_hardened\_check/\_\_init\_\_.py](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/62/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov#diff-a2NvbmZpZ19oYXJkZW5lZF9jaGVjay9fX2luaXRfXy5weQ==) | `90.34% <100.00%> (+0.01%)` | :arrow_up: |
774
775 ------
776
777 [Continue to review full report at Codecov](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/62?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov).
778 > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov)
779 > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
780 > Powered by [Codecov](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/62?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov). Last update [61bfef8...bbe60e7](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/62?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov).
781
782 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2022-04-28 11:41](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/62#issuecomment-1112102364):
783
784 Thanks @evdenis!
785 👍
786
787
788 -------------------------------------------------------------------------------
789
790 # [\#61 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/61) `closed`: Let user select configs without absolute path
791
792 #### <img src="https://avatars.githubusercontent.com/u/29118926?v=4" width="50">[dmknght](https://github.com/dmknght) opened issue at [2022-03-26 15:15](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/61):
793
794 ## System info:
795 Parrot OS 5.0, python 3
796 kconfig-hardened-check version 5.14
797 I've tried all options in help menu and I didn't find anything similar to my idea
798
799 ## Idea
800 1. Create an option to list all config. Maybe it supports search as well.
801 2. Let user select module without absolute path. For example, when I do Debian packaging for this tool, the configs are at `/usr/lib/python3/dist-packages/kconfig_hardened_check/config_files/` and users don't know where to search configs / modules.
802 Solution:
803 1. Add a `__init__.py` file into `config_files`. By this, folder `configs` is a module of the whole project.
804 2. You can do `from kconfig-hardnerned-check.<any path> import config_files`. Absolute path of the module will be `config_files.__path__[0]`
805 3. All modules are listed by `walk_dir(config_files.__path__[0])`. By this, you can have an option in argv to list all configs
806 4. When user provide `-c` flag, like `-c distros/debian.config`, absolute path is merged with `config_files.__path__[0]` so there's no need to know absolute path.
807
808 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2022-04-08 18:06](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/61#issuecomment-1093149751):
809
810 Hello @dmknght,
811
812 Thanks for writing!
813
814 Actually, the config files in `kconfig_hardened_check/config_files/` are provided as examples that are used for developing and testing of this tool. These configs are updated not that often, they don't cover all major distros.
815
816 The main use case for users is to check their own kernel config. The example from Fedora:
817 ```
818 ./bin/kconfig-hardened-check -c /boot/config-5.16.11-100.fc34.x86_64
819 ```
820 So I don't think users care about the location of these example config files. How do you think?
821
822 #### <img src="https://avatars.githubusercontent.com/u/29118926?v=4" width="50">[dmknght](https://github.com/dmknght) commented at [2022-05-06 05:37](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/61#issuecomment-1119275930):
823
824 > Hello @dmknght,
825
826 > Thanks for writing!
827
828 > Actually, the config files in `kconfig_hardened_check/config_files/` are provided as examples that are used for developing and testing of this tool. These configs are updated not that often, they don't cover all major distros.
829
830 > The main use case for users is to check their own kernel config. The example from Fedora:
831
832 > ```
833 > ./bin/kconfig-hardened-check -c /boot/config-5.16.11-100.fc34.x86_64
834 > ```
835
836 > So I don't think users care about the location of these example config files. How do you think?
837
838 Hello! Sorry for very late reply. I had issue with my mail notification LuL. Anyway, I think that's a very interesting point that i didn't know. In this case, I think `kconfig-hardened-check` can have a flag like `auto check` to do the command automatically. The workflow is like:
839 1. Check if there is `config file` that matches `kernel version` at `/boot/`
840 2. If exists, run the system check automatically
841 3. If doesn't exists, tells user to try some examples. In this case, i think absolute path of examples is needed.
842
843 What do you think about this? To me I think it's easier to user to just do `run and read` the result without thinking about wrong profiles.
844
845 #### <img src="https://avatars.githubusercontent.com/u/32568352?v=4" width="50">[Bernhard40](https://github.com/Bernhard40) commented at [2022-05-07 12:00](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/61#issuecomment-1120197457):
846
847 Some distros don't expose kernel config at /boot and I don't see why average user would be interested in checking example config which is probably totally unrelated to their system.
848
849 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2022-05-08 13:33](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/61#issuecomment-1120420075):
850
851 I agree with @Bernhard40.
852
853 @dmknght, I would avoid adding the code for searching the kernel config on a local machine.
854
855 Moreover, Linux kernel developers often use the `kconfig-hardened-check` tool for the configs of the kernels that they develop (not the config of the local machine).
856
857 Thanks!
858
859 #### <img src="https://avatars.githubusercontent.com/u/29118926?v=4" width="50">[dmknght](https://github.com/dmknght) commented at [2022-05-09 08:49](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/61#issuecomment-1120822656):
860
861 > @dmknght, I would avoid adding the code for searching the kernel config on a local machine.
862
863 Well it's not that hard. From what i checked, you just need to get kernel version, and map the path `/boot/config-<kernel version>`
864
865 > Moreover, Linux kernel developers often use the kconfig-hardened-check tool for the configs of the kernels that they develop (not the config of the local machine).
866 Well i see. So i guess I can close the issue now because the scope is different.
867
868
869 -------------------------------------------------------------------------------
870
871 # [\#60 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/60) `merged`: UBSAN_SANITIZE_ALL not available on ARM
872
873 #### <img src="https://avatars.githubusercontent.com/u/7194705?u=be917f131efce086bc9785f2b606107afe2d2fc3&v=4" width="50">[cyanidium](https://github.com/cyanidium) opened issue at [2022-03-26 14:29](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/60):
874
875 ARCH_HAS_UBSAN_SANITIZE_ALL is not selected for arm arch, which prevents selection of CONFIG_UBSAN_SANITIZE_ALL
876
877 https://github.com/torvalds/linux/blob/master/arch/arm/Kconfig
878 https://github.com/torvalds/linux/blob/master/lib/Kconfig.ubsan
879
880 #### <img src="https://avatars.githubusercontent.com/u/65553080?u=1e9e0de760ac0083c86dab588f627a0468cd714e&v=4" width="50">[codecov-commenter](https://github.com/codecov-commenter) commented at [2022-03-26 14:30](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/60#issuecomment-1079705754):
881
882 # [Codecov](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/60?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov) Report
883 > Merging [#60](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/60?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov) (b9c72b3) into [master](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/commit/b0b91b58adc962da01c7fc45cef662ae1b462828?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov) (b0b91b5) will **increase** coverage by `0.01%`.
884 > The diff coverage is `100.00%`.
885
886 ```diff
887 @@            Coverage Diff             @@
888 ##           master      #60      +/-   ##
889 ==========================================
890 + Coverage   91.46%   91.48%   +0.01%     
891 ==========================================
892   Files           3        3              
893   Lines         586      587       +1     
894   Branches      133      134       +1     
895 ==========================================
896 + Hits          536      537       +1     
897   Misses         25       25              
898   Partials       25       25              
899 ```
900
901 | Flag | Coverage Δ | |
902 |---|---|---|
903 | functional_test | `91.48% <100.00%> (+0.01%)` | :arrow_up: |
904
905 Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov#carryforward-flags-in-the-pull-request-comment) to find out more.
906
907 | [Impacted Files](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/60?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov) | Coverage Δ | |
908 |---|---|---|
909 | [kconfig\_hardened\_check/\_\_init\_\_.py](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/60/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov#diff-a2NvbmZpZ19oYXJkZW5lZF9jaGVjay9fX2luaXRfXy5weQ==) | `91.50% <100.00%> (+0.01%)` | :arrow_up: |
910
911 ------
912
913 [Continue to review full report at Codecov](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/60?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov).
914 > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov)
915 > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
916 > Powered by [Codecov](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/60?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov). Last update [b0b91b5...b9c72b3](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/60?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov).
917
918 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2022-04-08 16:43](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/60#issuecomment-1093077908):
919
920 Hello @cyanidium, 
921
922 Thanks for your PR.
923
924 You are right, UBSAN_SANITIZE_ALL is not available for arm for now.
925 See the discussion for more info https://github.com/KSPP/linux/issues/25#issuecomment-928154612
926
927 I'm going to merge your branch.
928 Thanks!
929
930
931 -------------------------------------------------------------------------------
932
933 # [\#59 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/59) `merged`: EFI mitigations can't be enabled if EFI is not set
934
935 #### <img src="https://avatars.githubusercontent.com/u/7194705?u=be917f131efce086bc9785f2b606107afe2d2fc3&v=4" width="50">[cyanidium](https://github.com/cyanidium) opened issue at [2022-03-15 12:38](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/59):
936
937 Both EFI_DISABLE_PCI_DMA and RESET_ATTACK_MITIGATION depend on EFI, but if EFI is not set, neither config is required.
938
939 Useful on embedded devices that use u-boot or similar instead of EFI.
940
941
942
943
944 -------------------------------------------------------------------------------
945
946 # [\#58 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/58) `closed`: CONFIG_TRIM_UNUSED_KSYMS and CONFIG_MODULES not in sync
947
948 #### <img src="https://avatars.githubusercontent.com/u/11868071?u=d7a5841263276e1f323827fc21b04345df594a60&v=4" width="50">[Churam](https://github.com/Churam) opened issue at [2022-01-17 17:17](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/58):
949
950 It seems there is a problem with the current stable kernel (5.15.14 at the date of this issue). 
951
952 The kernel option TRIM_UNUSED_KSYMS is defined in my config as: 
953 ```
954 Symbol: TRIM_UNUSED_KSYMS [=n]
955 Type  : bool
956 Defined at init/Kconfig:2301
957 Prompt: Trim unused exported kernel symbols
958 Depends on: MODULES [=n] && !COMPILE_TEST [=n]
959 Visible if: MODULES [=n] && !COMPILE_TEST [=n] && EXPERT [=y]
960 Location: 
961 (1) -> Enable loadable module support (MODULES [=n])
962
963 ```
964 Or the script (with the setup above) outputs me: 
965 CONFIG_TRIM_UNUSED_KSYMS                     |      y      |    my    | cut_attack_surface |   FAIL: not found
966
967 But as the hardening requires to have MODULES = n (is not set) it is impossible to set TRIM_UNUSED_KSYMS through menuconfig.
968
969
970
971 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2022-01-21 15:53](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/58#issuecomment-1018632628):
972
973 @Churam thanks for your report!
974
975 Fixed.
976
977 The output for your case now:
978 ```
979 CONFIG_TRIM_UNUSED_KSYMS   |   y   |   my   | cut_attack_surface |  OK: CONFIG_MODULES "is not set"
980 ```
981
982 #### <img src="https://avatars.githubusercontent.com/u/11868071?u=d7a5841263276e1f323827fc21b04345df594a60&v=4" width="50">[Churam](https://github.com/Churam) commented at [2022-01-24 11:04](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/58#issuecomment-1019976819):
983
984 Fix OK
985 Output is now as expected, closing issue
986
987
988 -------------------------------------------------------------------------------
989
990 # [\#57 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/57) `closed`: CONFIG_AMD_IOMMU_V2 = m appears also to be correct
991
992 #### <img src="https://avatars.githubusercontent.com/u/15869?u=31910a5ba7214eaf12efd39cbdf71b69af1b7db0&v=4" width="50">[brandonweeks](https://github.com/brandonweeks) opened issue at [2022-01-10 09:40](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/57):
993
994 ```
995 CONFIG_AMD_IOMMU = y
996 CONFIG_AMD_IOMMU_V2 = m
997 ```
998 appears to correctly setup the AMD v2 IOMMU on supported hardware (tested on NixOS) and is the config option used by [Fedora/RHEL](https://gitlab.com/cki-project/kernel-ark/-/blob/os-build/redhat/configs/common/generic/x86/x86_64/CONFIG_AMD_IOMMU_V2).
999
1000 If you agree with this assessment, any pointers on how to add an OR to the existing AND conditional for `CONFIG_AMD_IOMMU`?
1001
1002 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2022-01-21 15:29](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/57#issuecomment-1018612527):
1003
1004 Hello @brandonweeks 
1005
1006 Could you give any details on tests you mentioned?
1007
1008 Thanks!
1009
1010
1011 -------------------------------------------------------------------------------
1012
1013 # [\#56 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/56) `open`: Add RISC-V support
1014 **Labels**: `enhancement`
1015
1016
1017 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) opened issue at [2021-11-21 12:07](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/56):
1018
1019 It would be nice to have `kconfig-hardened-check` adapted for `RISC-V` kernel configs.  
1020
1021 #### <img src="https://avatars.githubusercontent.com/u/125879?v=4" width="50">[cybernet](https://github.com/cybernet) commented at [2021-12-24 13:35](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/56#issuecomment-1000842582):
1022
1023 👍
1024
1025
1026 -------------------------------------------------------------------------------
1027
1028 # [\#55 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/55) `closed`: Should slub_debug be considered a hardening cmd line parameter?
1029 **Labels**: `question`
1030
1031
1032 #### <img src="https://avatars.githubusercontent.com/u/3797768?v=4" width="50">[morfikov](https://github.com/morfikov) opened issue at [2021-10-28 21:16](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/55):
1033
1034 [According to this](https://github.com/a13xp0p0v/kconfig-hardened-check/blob/2b5bf3548b6a7edbf7cd74278d570b658f9ab34a/kconfig_hardened_check/__init__.py#L13-L21), the `slub_debug` is a hardening cmd line parameter. But when you use this option, you will see the following in the syslog on newer kernels:
1035
1036 ```
1037 kernel: **********************************************************
1038 kernel: **   NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE   **
1039 kernel: **                                                      **
1040 kernel: ** This system shows unhashed kernel memory addresses   **
1041 kernel: ** via the console, logs, and other interfaces. This    **
1042 kernel: ** might reduce the security of your system.            **
1043 kernel: **                                                      **
1044 kernel: ** If you see this message and you are not debugging    **
1045 kernel: ** the kernel, report this immediately to your system   **
1046 kernel: ** administrator!                                       **
1047 kernel: **                                                      **
1048 kernel: **   NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE   **
1049 kernel: **********************************************************
1050 ```
1051 More [here](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=792702911f581f7793962fbeb99d5c3a1b28f4c3) and [here](https://patchwork.kernel.org/project/linux-mm/patch/20210214161348.369023-4-timur@kernel.org/).
1052
1053 So, should users use slub_debug=FZP or slub_debug=ZP?
1054
1055 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2021-11-09 19:26](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/55#issuecomment-964465176):
1056
1057 Hello @morfikov!
1058
1059 My code comment in `__init__.py` is a note for future development within https://github.com/a13xp0p0v/kconfig-hardened-check/issues/46. It's not a final decision.
1060
1061 Currently I consider `slub_debug=F` and `slub_debug=Z` as debugging features, as you can see at the [Linux Kernel Defence Map](https://github.com/a13xp0p0v/linux-kernel-defence-map).
1062
1063 And I will have to learn more about `init_on_free` and `slub_debug=P` to choose between them.
1064
1065 Thanks!
1066
1067
1068 -------------------------------------------------------------------------------
1069
1070 # [\#54 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/54) `merged`: Add BLK_DEV_FD
1071 **Labels**: `kernel_maintainer_feedback`
1072
1073
1074 #### <img src="https://avatars.githubusercontent.com/u/150761?u=f98bb82be5009ecefd6ee9bc3d60fcf082f8cf49&v=4" width="50">[evdenis](https://github.com/evdenis) opened issue at [2021-09-10 15:41](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/54):
1075
1076 Floppy driver was written many years ago. It was designed to
1077 work in a single-threaded environment (many global variables)
1078 and to work on real hardware which has significant delays
1079 (floppy drives are slow). Nowadays, when we use virtual
1080 devices (which are fast) and multi-core cpus, floppy driver
1081 shows its problems including deadlocking/livelocking and
1082 other security-related issues. However, we can't just
1083 rewrite it because lack of real hardware and compatibility
1084 with existing userspace tools, many of which rely on
1085 undocumented driver behavior.
1086
1087 Here are some CVEs related to floppy driver:
1088  - CVE-2014-1737 privileges escalation in FDRAWCMD ioctl
1089  - CVE-2014-1738 info leak from kernel heap in FDRAWCMD ioctl
1090  - CVE-2018-7755 kernel pointer lead in FDGETPRM ioctl
1091  - CVE-2019-14283 integer overflow and out-of-bounds read in set_geometry
1092  - CVE-2019-14284 denial of service in setup_format_params
1093  - CVE-2020-9383 out-of-bounds read in set_fdc
1094  - CVE-2021-20261 race condition in floppy_revalidate,
1095    floppy_check_events
1096
1097 As pointed by Linus [1]:
1098 > The only users are virtualization, and even they are going away
1099 > because floppies are so small, and other things have become more
1100 > standard anyway (ie USB disk) or easier to emulate (NVMe or whatever).
1101 > So I suspect the only reason floppy is used even in that area is just
1102 > legacy "we haven't bothered updating to anything better and we have
1103 > old scripts and images that work".
1104
1105 CONFIG_BLK_DEV_FD is not enabled in defconfig on x86_64.
1106 Many distros already require root access for /dev/fd0.
1107 However, qemu (5.2.0) still enables floppy device by default.
1108
1109 [1] https://lore.kernel.org/all/CAHk-=whFAAV_TOLFNnj=wu4mD2L9OvgB6n2sKDdmd8buMKFv8A@mail.gmail.com/
1110
1111 #### <img src="https://avatars.githubusercontent.com/u/65553080?u=1e9e0de760ac0083c86dab588f627a0468cd714e&v=4" width="50">[codecov-commenter](https://github.com/codecov-commenter) commented at [2021-09-10 21:23](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/54#issuecomment-917220941):
1112
1113 # [Codecov](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/54?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov) Report
1114 > Merging [#54](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/54?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov) (17d70c5) into [master](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/commit/b54dca6a96b7a07d3d1aec56b5a1df6386bb7d61?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov) (b54dca6) will **increase** coverage by `0.01%`.
1115 > The diff coverage is `100.00%`.
1116
1117 [![Impacted file tree graph](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/54/graphs/tree.svg?width=650&height=150&src=pr&token=GOOVXMV5Kb&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov)](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/54?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov)
1118
1119 ```diff
1120 @@            Coverage Diff             @@
1121 ##           master      #54      +/-   ##
1122 ==========================================
1123 + Coverage   92.95%   92.96%   +0.01%     
1124 ==========================================
1125   Files           3        3              
1126   Lines         511      512       +1     
1127   Branches      116      116              
1128 ==========================================
1129 + Hits          475      476       +1     
1130   Misses         18       18              
1131   Partials       18       18              
1132 ```
1133
1134 | Flag | Coverage Δ | |
1135 |---|---|---|
1136 | functional_test | `92.96% <100.00%> (+0.01%)` | :arrow_up: |
1137
1138 Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov#carryforward-flags-in-the-pull-request-comment) to find out more.
1139
1140 | [Impacted Files](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/54?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov) | Coverage Δ | |
1141 |---|---|---|
1142 | [kconfig\_hardened\_check/\_\_init\_\_.py](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/54/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov#diff-a2NvbmZpZ19oYXJkZW5lZF9jaGVjay9fX2luaXRfXy5weQ==) | `93.02% <100.00%> (+0.01%)` | :arrow_up: |
1143
1144 ------
1145
1146 [Continue to review full report at Codecov](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/54?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov).
1147 > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov)
1148 > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
1149 > Powered by [Codecov](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/54?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov). Last update [b54dca6...17d70c5](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/54?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov).
1150
1151 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2021-09-10 21:28](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/54#issuecomment-917223378):
1152
1153 Thanks a lot @evdenis :)
1154 The pull request is merged.
1155
1156
1157 -------------------------------------------------------------------------------
1158
1159 # [\#53 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/53) `closed`: Justification of UBSAN-related choices?
1160 **Labels**: `kernel_maintainer_feedback`
1161
1162
1163 #### <img src="https://avatars.githubusercontent.com/u/601177?v=4" width="50">[equaeghe](https://github.com/equaeghe) opened issue at [2021-09-04 21:22](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/53):
1164
1165 Currently, `UBSAN`-related choices are as follows:
1166
1167 https://github.com/a13xp0p0v/kconfig-hardened-check/blob/4dc94be8a5e0c3a0889679f7079aa93c7f44464d/kconfig_hardened_check/__init__.py#L421-L423
1168
1169 It is unclear to me why the last two are chosen. `UBSAN_MISC=y` seems like a good thing, as it enables more checks. `UBSAN_TRAP=y` seems like a bad thing, as it enables denial of service attacks. Furthermore, if I understand things correctly, `UBSAN_SANITIZE_ALL=y` would be needed to practically activate `UBSAN`.
1170
1171 Is my understanding correct, or a misunderstanding (which is perfectly possible). In the latter case, I would be grateful for a pointer to an appropriate resource.
1172
1173 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2021-09-10 13:40](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/53#issuecomment-916912883):
1174
1175 Hello @equaeghe 
1176
1177 Thanks for your question.
1178
1179 Please have a look, @kees wrote about that in his article about security-related things in the Linux kernel 5.7:
1180 https://outflux.net/blog/archives/2020/09/21/security-things-in-linux-v5-7/
1181
1182 Quote:
1183 ```
1184 For runtime checking, the Undefined Behavior Sanitizer has an option for adding runtime array bounds checking
1185 for catching things like this where the compiler cannot perform a static analysis of the index values.
1186
1187 ...
1188
1189 It was, however, not separate (via kernel Kconfig) until Elena Petrova and I split it out into
1190 CONFIG_UBSAN_BOUNDS, which is fast enough for production kernel use. 
1191
1192 ...
1193
1194 Since UBSAN (and the other Sanitizers) only WARN() by default, system owners need to
1195 set panic_on_warn=1 too if they want to defend against attacks targeting these kinds of flaws.
1196 Because of this, and to avoid bloating the kernel image with all the warning messages, I introduced
1197 CONFIG_UBSAN_TRAP which effectively turns these conditions into a BUG() without needing
1198 additional sysctl settings.
1199 ```
1200
1201 Does that provide answers to your questions?
1202
1203 #### <img src="https://avatars.githubusercontent.com/u/601177?v=4" width="50">[equaeghe](https://github.com/equaeghe) commented at [2021-09-10 14:04](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/53#issuecomment-916929875):
1204
1205 Thanks, that explains why `UBSAN_TRAP=y`. I am still unclear why `UBSAN_MISC is not set` and why nothing is said about `UBSAN_SANITIZE_ALL`.
1206
1207 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2021-09-10 14:56](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/53#issuecomment-916967782):
1208
1209 It looks like other UBSAN modes are for kernel debugging, not for hardening:
1210 ```
1211 [*]   Perform checking for bit-shift overflows
1212 [*]   Perform checking for integer divide-by-zero
1213 [*]   Perform checking for non-boolean values used as boolean
1214 [*]   Perform checking for out of bounds enum values
1215 [*]   Perform checking for misaligned pointer usage
1216 ```
1217 Previously they were collected under UBSAN_MISC, but now I see that they are separate since the kernel commit  c637693b20da8706b7f48d96882c9c80ae935151. I will have a closer look at them.
1218
1219 I will also test UBSAN_SANITIZE_ALL behavior.
1220
1221 Thanks @equaeghe !
1222
1223 #### <img src="https://avatars.githubusercontent.com/u/1110841?u=e5e99e1ac8260e791433baa2423f7d173eea4c1c&v=4" width="50">[kees](https://github.com/kees) commented at [2021-09-10 18:50](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/53#issuecomment-917133371):
1224
1225 `UBSAN_SANITIZE_ALL` is needed to gain coverage over the kernel as a whole. Otherwise, only opted-in things will have the UBSAN features applied.
1226
1227 I.e. for production workloads, I recommend:
1228
1229 ```
1230 CONFIG_UBSAN=y
1231 CONFIG_UBSAN_BOUNDS=y
1232 CONFIG_UBSAN_SANITIZE_ALL=y
1233 ```
1234
1235 and depending on one's crash tolerances, either use `panic_on_warn=1` or `CONFIG_UBSAN_TRAP=y`.
1236
1237 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2021-09-10 21:20](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/53#issuecomment-917219349):
1238
1239 Thank you very much @kees !
1240
1241
1242 -------------------------------------------------------------------------------
1243
1244 # [\#52 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/52) `closed`: Add RANDOMIZE_KSTACK_OFFSET_DEFAULT
1245
1246 #### <img src="https://avatars.githubusercontent.com/u/203012?u=939d6d3b5ff0b9e46e911d8792a40c20408574e2&v=4" width="50">[anthraxx](https://github.com/anthraxx) opened issue at [2021-08-25 19:44](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/52):
1247
1248 Randomize kernel stack offset on syscall entry
1249
1250 The kernel stack offset can be randomized (after pt_regs) by
1251 roughly 5 bits of entropy, frustrating memory corruption
1252 attacks that depend on stack address determinism or
1253 cross-syscall address exposures. This feature is controlled
1254 by kernel boot param "randomize_kstack_offset=on/off", and this
1255 config chooses the default boot state.
1256
1257 #### <img src="https://avatars.githubusercontent.com/u/65553080?u=1e9e0de760ac0083c86dab588f627a0468cd714e&v=4" width="50">[codecov-commenter](https://github.com/codecov-commenter) commented at [2021-08-25 19:46](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/52#issuecomment-905823752):
1258
1259 # [Codecov](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/52?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov) Report
1260 > Merging [#52](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/52?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov) (5d12e64) into [master](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/commit/57379d8c851656116e2b149e3f1d4003c17d22d9?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov) (57379d8) will **increase** coverage by `0.01%`.
1261 > The diff coverage is `100.00%`.
1262
1263 [![Impacted file tree graph](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/52/graphs/tree.svg?width=650&height=150&src=pr&token=GOOVXMV5Kb&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov)](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/52?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov)
1264
1265 ```diff
1266 @@            Coverage Diff             @@
1267 ##           master      #52      +/-   ##
1268 ==========================================
1269 + Coverage   92.87%   92.88%   +0.01%     
1270 ==========================================
1271   Files           3        3              
1272   Lines         505      506       +1     
1273   Branches      115      115              
1274 ==========================================
1275 + Hits          469      470       +1     
1276   Misses         18       18              
1277   Partials       18       18              
1278 ```
1279
1280 | Flag | Coverage Δ | |
1281 |---|---|---|
1282 | functional_test | `92.88% <100.00%> (+0.01%)` | :arrow_up: |
1283
1284 Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov#carryforward-flags-in-the-pull-request-comment) to find out more.
1285
1286 | [Impacted Files](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/52?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov) | Coverage Δ | |
1287 |---|---|---|
1288 | [kconfig\_hardened\_check/\_\_init\_\_.py](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/52/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov#diff-a2NvbmZpZ19oYXJkZW5lZF9jaGVjay9fX2luaXRfXy5weQ==) | `92.94% <100.00%> (+0.01%)` | :arrow_up: |
1289
1290 ------
1291
1292 [Continue to review full report at Codecov](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/52?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov).
1293 > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov)
1294 > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
1295 > Powered by [Codecov](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/52?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov). Last update [57379d8...5d12e64](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/52?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov).
1296
1297 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2021-09-10 12:14](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/52#issuecomment-916859414):
1298
1299 Hi @anthraxx 
1300
1301 You might be busy, so I've made the fixes myself in the commit b54dca6a96b7a07d3d1aec56b5a1df6386bb7d61.
1302 Hope you wouldn't mind.
1303
1304 Thanks!
1305 Alexander
1306
1307 #### <img src="https://avatars.githubusercontent.com/u/203012?u=939d6d3b5ff0b9e46e911d8792a40c20408574e2&v=4" width="50">[anthraxx](https://github.com/anthraxx) commented at [2021-09-10 12:15](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/52#issuecomment-916860190):
1308
1309 @a13xp0p0v nah, i was just about to make it KSPP official hence the delay. should have communicated it. Will create a followup PR marking it as kspp soon :cat:
1310
1311 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2021-09-10 13:45](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/52#issuecomment-916916530):
1312
1313 @anthraxx , ah, OK!
1314
1315 Sure, looking forward to your new pull request!
1316
1317
1318 -------------------------------------------------------------------------------
1319
1320 # [\#51 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/51) `merged`: Added cbl-mariner kernel configuration file.
1321
1322 #### <img src="https://avatars.githubusercontent.com/u/25109036?u=507c0397c0e27f6fc1a1b3115f293c66b8056199&v=4" width="50">[Hacks4Snacks](https://github.com/Hacks4Snacks) opened issue at [2021-08-19 20:49](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/51):
1323
1324 Hello,
1325
1326 I have added the CBL-Mariner 1.0 distribution kernel configuration file.
1327
1328 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2021-08-20 17:22](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/51#issuecomment-902842367):
1329
1330 Hello @Hacks4Snacks,
1331 Could you please add the corresponding info to `kconfig_hardened_check/config_files/links.txt` and update your pull request?
1332 Thank you!
1333
1334 #### <img src="https://avatars.githubusercontent.com/u/25109036?u=507c0397c0e27f6fc1a1b3115f293c66b8056199&v=4" width="50">[Hacks4Snacks](https://github.com/Hacks4Snacks) commented at [2021-08-20 17:42](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/51#issuecomment-902853201):
1335
1336 Sure thing! A link to the publicly available configuration has been added. @a13xp0p0v
1337
1338 #### <img src="https://avatars.githubusercontent.com/u/65553080?u=1e9e0de760ac0083c86dab588f627a0468cd714e&v=4" width="50">[codecov-commenter](https://github.com/codecov-commenter) commented at [2021-08-20 18:11](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/51#issuecomment-902869062):
1339
1340 # [Codecov](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/51?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov) Report
1341 > Merging [#51](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/51?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov) (a5686b1) into [master](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/commit/38bde65d9df70a6b1ec772b93b07e98778cb7e34?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov) (38bde65) will **not change** coverage.
1342 > The diff coverage is `n/a`.
1343
1344 [![Impacted file tree graph](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/51/graphs/tree.svg?width=650&height=150&src=pr&token=GOOVXMV5Kb&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov)](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/51?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov)
1345
1346 ```diff
1347 @@           Coverage Diff           @@
1348 ##           master      #51   +/-   ##
1349 =======================================
1350   Coverage   92.87%   92.87%           
1351 =======================================
1352   Files           3        3           
1353   Lines         505      505           
1354   Branches      115      115           
1355 =======================================
1356   Hits          469      469           
1357   Misses         18       18           
1358   Partials       18       18           
1359 ```
1360
1361 | Flag | Coverage Δ | |
1362 |---|---|---|
1363 | functional_test | `92.87% <ø> (ø)` | |
1364
1365 Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov#carryforward-flags-in-the-pull-request-comment) to find out more.
1366
1367
1368 ------
1369
1370 [Continue to review full report at Codecov](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/51?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov).
1371 > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov)
1372 > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
1373 > Powered by [Codecov](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/51?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov). Last update [38bde65...a5686b1](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/51?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alexander+Popov).
1374
1375 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2021-08-20 18:22](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/51#issuecomment-902874845):
1376
1377 Merged. Thanks @Hacks4Snacks!
1378
1379
1380 -------------------------------------------------------------------------------
1381
1382 # [\#50 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/50) `open`: Allow redefining rules and expanding rule sets
1383 **Labels**: `enhancement`
1384
1385
1386 #### <img src="https://avatars.githubusercontent.com/u/65050545?u=3d095cc7726e6bbf544ea4857c4223033ea90921&v=4" width="50">[petervanvugt](https://github.com/petervanvugt) opened issue at [2021-02-20 01:10](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/50):
1387
1388 I have found this tool quite helpful for quickly auditing embedded kernel configs. However, I've been finding that on embedded systems, I often have unique, application-specific security requirements:
1389
1390 - Embedded SoC vendors often have drivers that haven't made it into mainline that need to be checked (e.g. special HW RNG drivers, TZ drivers, PMIC drivers)
1391 - The application may want to even further prioritize the correct operation of the system over performance or reliability (i.e. be willing to sacrifice battery life, CPU bandwidth, or resistance to DoS attacks to increase hardness)
1392 - Since the required kernel functionality is fully defined (e.g. we know we'll _never_ need FAT filesystem support, don't want UART or kernel console driver, don't want USB gadget drivers, etc.), specify that unused drivers must be removed, lest they be leveraged by an attacker
1393
1394 I propose moving the config tests currently hard-coded in `__init__` into a set of yaml configs that can be included by a top-level config, like this:
1395 ```
1396 # Includes are optional. Recursively walk through them, each test/error will be tagged with the source yaml
1397 # Last included definition for a CONFIG_ is used
1398 includes:
1399   - kspp.yaml
1400   - clipos.yaml
1401   - my.yaml
1402   - soc_a.yaml
1403 # Tests
1404 tests: !!seq [
1405   # Description of test
1406   RANDOMIZE_BASE: {
1407     # Test passes if CONFIG=value
1408     require: value,
1409     # Test passes if config not found, or "is not set"
1410     # require: is not set,
1411     # Optional: only test if other config is set to something
1412     if_config: MODULES,
1413     # Optional: only test specific kernel versions
1414     if_kernel_ver_gt_eq: 5.9,
1415     if_kernel_ver_lt: 5.8,
1416     # Optional: only test specific architectures
1417     if_arch: [X86_64, ARM64, X86_32],
1418   },
1419   # Example: require CONFIG_BUG=y
1420   BUG: {
1421     require: y,
1422   },
1423 ]
1424 ```
1425 This would enable the config requirements to be layered, similar to the way kernel `defconfigs` can be layered (i.e. arch | Android | SoC vendor | device). I have some free time next week to implement this if you're open to it.
1426
1427 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2021-02-21 22:15](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/50#issuecomment-782937216):
1428
1429 Hello @petervanvugt,
1430
1431 Thanks for your initiative!
1432
1433 May I ask you to describe your use-case in details?
1434 Which new requirements to `kconfig-hardened-check` behavior does it have?
1435
1436 Maybe a layered yaml that you propose is not a single solution for your use-case.
1437
1438 Moreover, I see that your use-case relates to this discussion: https://github.com/a13xp0p0v/kconfig-hardened-check/pull/9#issuecomment-453810119
1439 I think we can define some common solution.
1440
1441 Now about the syntax of check definitions.
1442 - Currently all checks are grouped together in `kconfig_hardened_check/__init__.py`.
1443 - The check definitions are very short.
1444
1445 So I can observe them altogether. That helps me to understand and maintain these checks, which is not an easy task.
1446 That is my main rationale.
1447
1448 Here you propose a completely different syntax.
1449 I think we should discuss it before we start coding.
1450 My thoughts:
1451 1. Can we separate changing check definition syntax from changing `kconfig-hardened-check` behavior?
1452 2. The given syntax example doesn't cover all check types that we have. Could you please write *all* current checks in your new syntax? I think we need that for making the decision.
1453
1454 (I'm travelling till the beginning of March, excuse me for delayed replies)
1455
1456 Best regards,
1457 Alexander
1458
1459 #### <img src="https://avatars.githubusercontent.com/u/65050545?u=3d095cc7726e6bbf544ea4857c4223033ea90921&v=4" width="50">[petervanvugt](https://github.com/petervanvugt) commented at [2021-02-23 02:26](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/50#issuecomment-783833502):
1460
1461 Hi @a13xp0p0v ,
1462
1463 My use essentially falls into three cases:
1464
1465 1. My system has kconfigs **not in mainline that must always be set**.
1466  
1467 _For example_, I might want to verify `PANIC_ON_DATA_CORRUPTION` [from Android](https://android.googlesource.com/kernel/msm/+/7b49b86d3aa3d0c6400454a346bad1bbdf0cc78f%5E%21/) is enabled, as a defensive measure, because I'd rather the system immediately reboot at the first sign things are going off the rails, rather than risk being exploited by an attacker.
1468
1469 2. My system has kconfigs that **are in mainline, which are only in play for my hardware**.
1470
1471 _For example_, I may want to verify that my chip's `CONFIG_<HWVENDOR>_HWRANDOM` is enabled, because I'm using it as a cryptographically secure source of enropy.
1472
1473 3. My system has kconfigs that **are in mainline, which many/most users want enabled, but I want disabled**, because they add no benefit, and some nonzero risk.
1474
1475 _For example_, if I'm building an embedded system that uses NXP's i.MX line, I may want to verify `CONFIG_SERIAL_IMX` and `CONFIG_SERIAL_IMX_CONSOLE` are not enabled, because I want to be absolutely certain that the serial drivers and associated kernel console drivers haven't been included. Or, in a similar vein to **(1)**, I may want to enable `CONFIG_PANIC_ON_OOPS` because I prioritize the correctness of my system over its availability.
1476
1477 [EDIT] Another, potentially stronger example I have run into recently is `PROC_PAGE_MONITOR`. The grsecurity patch set removes it for good reason, because access to `/proc/<pid>/smaps` can leak memory mapping information defeating ASLR. While there are mitigations all recent versions of the kernel to prevent insufficiently privileged processes from reading the map of a more privileged process, there have been a few race conditions and side channels that have been shown to circumvent this. So, it is reasonable that many users will want to disable this altogether. However, Android's *libmeminfo* needs to read this entry to compute process memory utilization, which is pretty hard to live without in some applications.
1478
1479 Can we serve all these use cases?
1480
1481 Clearly, there a few paths that could be taken here. We could add these requirements to the very compact representation in `kconfig_hardened_check/__init__.py`. And for **(1)** and **(2)**, we could likely produce some combination of AND/OR kconfig checks (albeit sometimes non-trivial) that keeps the check from generating unnecessarily noisy output/false positives when run on configs for non-applicable hardware, or for kernels that don't fully track mainline. But this wouldn't solve for **(3)**, unless we require the tool be specially patched for such cases, or we add runtime args that turn on each of these checks.
1482
1483 If we want to be able to specify additional requirements at runtime and/or override requirements at runtime, we need a way to specify alternate requirements. This is why I am proposing representing the requirements as runtime configuration, rather than code. As to how we would represent some of the more complex requirements, I am proposing we break them down into requirements that each only check one config each, optionally only checked for some combination of specific architectures/kernel versions/`CONFIG_`s.
1484
1485 We could take configs whose names changed, such as this:
1486 ```
1487 282     l += [OR(OptCheck('self_protection', 'defconfig', 'STACKPROTECTOR_STRONG', 'y'),
1488 283              OptCheck('self_protection', 'defconfig', 'CC_STACKPROTECTOR_STRONG', 'y'))]
1489 ```
1490 and split them into two separate requirements, the first one for kernels >= 4.18, and the second one for kernels >= 3.14 and < 4.18.
1491
1492 The most complex requirement I see is this one:
1493 ```
1494 307     if arch == 'ARM64':
1495 ...
1496 310         l += [OR(OptCheck('self_protection', 'defconfig', 'HARDEN_EL2_VECTORS', 'y'),
1497 311                  AND(OptCheck('self_protection', 'defconfig', 'RANDOMIZE_BASE', 'y'),
1498 312                      VerCheck((5, 9))))] # HARDEN_EL2_VECTORS was included in RANDOMIZE_BASE in v5.9
1499 ```
1500 which could be split into two requirements: one for `RANDOMIZE_BASE` on kernels >= 5.9 for ARM64, and a second check for `HARDEN_EL2_VECTORS` on older kernels >= 4.17 and < 5.9, also for ARM64. This would keep the requirements more readable in the long run.
1501
1502 What do you think?
1503
1504 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2021-03-05 19:16](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/50#issuecomment-791625966):
1505
1506 @petervanvugt thanks a lot for describing your use-cases.
1507 I think they match with [this one](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/9#issuecomment-453810119).
1508 I want to make them possible.
1509
1510 I think `kconfig-hardened-check` should allow to override the default checks and append custom checks.
1511 As a first step, we need some simple solution without changing the check description syntax.
1512 Then we can ponder over the check description syntax.
1513
1514 I will experiment with that.
1515 If you create any prototype, please share!
1516
1517 #### <img src="https://avatars.githubusercontent.com/u/10352354?u=97ab0d446ea4204b959ae74734f8436c78de18e7&v=4" width="50">[egberts](https://github.com/egberts) commented at [2021-08-31 13:08](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/50#issuecomment-909221366):
1518
1519 other use case is prevent leakage of kernel pointers to log file, /proc directory files, or terminal output.  
1520
1521 Which is just a bunch of debugs and dmesg turned off. 
1522
1523
1524 another one is the one provided by Whonix.org (a KSPP variant) which is more rigorous form of kernel security. 
1525
1526 Another one is for Spectre, et. al., mitigation and that has a bunch of config s as well.
1527
1528
1529 -------------------------------------------------------------------------------
1530
1531 # [\#49 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/49) `closed`: Some checks seem to be at odds with what the recommended settings are
1532
1533 #### <img src="https://avatars.githubusercontent.com/u/14325582?v=4" width="50">[wdormann](https://github.com/wdormann) opened issue at [2021-02-11 14:34](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/49):
1534
1535 I did not go through them all, but these in particular stuck out to me:
1536
1537 ```
1538 CONFIG_GCC_PLUGIN_RANDSTRUCT_PERFORMANCE     | is not set  |  clipos  |  self_protection   |   FAIL: CONFIG_GCC_PLUGIN_RANDSTRUCT not "y"
1539 CONFIG_STACKLEAK_METRICS                     | is not set  |  clipos  |  self_protection   |   FAIL: CONFIG_GCC_PLUGIN_STACKLEAK not "y"
1540 CONFIG_STACKLEAK_RUNTIME_DISABLE             | is not set  |  clipos  |  self_protection   |   FAIL: CONFIG_GCC_PLUGIN_STACKLEAK not "y"
1541 ```
1542
1543 If I'm reading this properly, the recommended setting for these is ```not set```
1544 However, the specific tests show as ```FAIL``` because they are ```not "y"```
1545
1546 Perhaps I'm just interpreting the report incorrectly, but at first glance it would appear that the check for the desired result is wrong.
1547
1548
1549 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2021-02-11 15:06](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/49#issuecomment-777552022):
1550
1551 Hi @wdormann,
1552
1553 Thanks for your question.
1554 The output is correct, let me explain.
1555
1556 ```
1557 CONFIG_GCC_PLUGIN_RANDSTRUCT                 |      y      |   kspp   |  self_protection   |   FAIL: not found
1558 ...
1559 CONFIG_GCC_PLUGIN_RANDSTRUCT_PERFORMANCE     | is not set  |  clipos  |  self_protection   |   FAIL: CONFIG_GCC_PLUGIN_RANDSTRUCT not "y"
1560 ```
1561 `RANDSTRUCT` is disabled and the first check fails.
1562 The `RANDSTRUCT_PERFORMANCE` feature is dependent on `RANDSTRUCT`.
1563 That's why the second check fails too with the explanation: `CONFIG_GCC_PLUGIN_RANDSTRUCT not "y"`.
1564
1565 The situation with `STACKLEAK_METRICS` and `STACKLEAK_RUNTIME_DISABLE` is similar.
1566 These checks fail because they depend on `STACKLEAK` which is not `"y"`.
1567
1568 #### <img src="https://avatars.githubusercontent.com/u/14325582?v=4" width="50">[wdormann](https://github.com/wdormann) commented at [2021-02-11 15:19](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/49#issuecomment-777570144):
1569
1570 Reading comprehension is apparently important!
1571 Thanks for the clarification.
1572
1573
1574 -------------------------------------------------------------------------------
1575
1576 # [\#48 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/48) `merged`: Do not check CONFIG_HARDEN_EL2_VECTORS for v5.9+
1577
1578 #### <img src="https://avatars.githubusercontent.com/u/20878259?v=4" width="50">[pgils](https://github.com/pgils) opened issue at [2020-10-19 13:45](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/48):
1579
1580 The CONFIG_HARDEN_EL2_VECTORS Kconfig was removed in Linux 5.9: torvalds/linux@a59a2ed.
1581
1582 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-10-21 15:06](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/48#issuecomment-713644849):
1583
1584 Hi @pgils, thanks for your pull request!
1585
1586 In fact HARDEN_EL2_VECTORS is now included in RANDOMIZE_BASE.
1587 So simple check of the kernel version is not enough.
1588
1589 I think of making nested ComplexOptCheck possible to write such a rule.
1590
1591 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-10-22 16:12](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/48#issuecomment-714601175):
1592
1593 Hi @pgils,
1594 I added nested `ComplexOptChecks` support, merged and improved your rule.
1595 Thanks!
1596
1597 #### <img src="https://avatars.githubusercontent.com/u/20878259?v=4" width="50">[pgils](https://github.com/pgils) commented at [2020-10-24 14:14](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/48#issuecomment-715921069):
1598
1599 thanks @a13xp0p0v, that's a nice feature!
1600
1601 Do you think it would be worthwhile using this for complex dependencies such as this one for `ARM64_PTR_AUTH` which currently `'FAIL'`s for my ARMv8-A config but is not selectable in `menuconfig`?:
1602 ```
1603 (CC_HAS_SIGN_RETURN_ADDRESS [=n] || CC_HAS_BRANCH_PROT_PAC_RET [=n]) \
1604     && AS_HAS_PAC [=n] \
1605     && (LD_IS_LLD [=n] \
1606         || LD_VERSION [=235000000]>=233010000 
1607         || CC_IS_GCC [=y] && GCC_VERSION [=100200]<90100) \
1608     && (!CC_IS_CLANG [=n] || AS_HAS_CFI_NEGATE_RA_STATE [=y]) \
1609     && (!FUNCTION_GRAPH_TRACER [=n] || DYNAMIC_FTRACE_WITH_REGS [=n])
1610 ```
1611
1612 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-10-30 18:16](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/48#issuecomment-719717934):
1613
1614 @pgils, I guess you can't enable `ARM64_PTR_AUTH` because your current toolchain doesn't fit the requirements.
1615 I would recommend improving the toolchain to get this nice feature.
1616
1617 See the output about my toolchain (in Fedora 32):
1618 ```
1619 Depends on: (CC_HAS_SIGN_RETURN_ADDRESS [=y] || CC_HAS_BRANCH_PROT_PAC_RET [=y]) && AS_HAS_PAC [=y] && (LD_IS_LLD [=n] || LD_VERSION [=234000000]>=233010000 || CC_IS_GCC [=y] && GCC_VERSION [=90201]<90100) && (!CC_IS_CLANG [=n] || AS_HAS_CFI_NEGATE_RA_STATE [=y]) && (!FUNCTION_GRAPH_TRACER [=n] || DYNAMIC_FTRACE_WITH_REGS [=n])
1620 ```
1621
1622
1623 -------------------------------------------------------------------------------
1624
1625 # [\#47 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/47) `closed`: Please support /proc/config.gz
1626
1627 #### <img src="https://avatars.githubusercontent.com/u/3797768?v=4" width="50">[morfikov](https://github.com/morfikov) opened issue at [2020-10-13 14:58](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/47):
1628
1629 Currently only uncompressed `config-*` files in /boot/ are supported, but the current kernel config can also be accessed via `/proc/config.gz` . There's no way to use this file. Please support this path as well. 
1630
1631 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-10-14 12:25](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/47#issuecomment-708366463):
1632
1633 No problem, I would recommend this:
1634 ```
1635   # zcat /proc/config.gz > my.config
1636   # ./bin/kconfig-hardened-check -c my.config
1637 ```
1638
1639 #### <img src="https://avatars.githubusercontent.com/u/3797768?v=4" width="50">[morfikov](https://github.com/morfikov) commented at [2020-10-14 13:43](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/47#issuecomment-708410948):
1640
1641 Yes, I know, but this is the same as just using `-c /boot/config-*` . I thought of using `/proc/config.gz` because in such case a user would just use one file no matter what kernel version he's using. When you decompress the file first, it's an extra step which could be eliminated to simplify the whole process and make it easier.
1642
1643 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-10-21 14:44](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/47#issuecomment-713629103):
1644
1645 Not all kernels provide the kernel config via `/proc/config.gz`.
1646 For example, RHEL, Fedora, Ubuntu, Debian don't do that.
1647
1648 I think we can use `zcat` separately, if we need.
1649
1650
1651 -------------------------------------------------------------------------------
1652
1653 # [\#46 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/46) `closed`: CPU specific options and the kernel cmd line 
1654 **Labels**: `enhancement`
1655
1656
1657 #### <img src="https://avatars.githubusercontent.com/u/3797768?v=4" width="50">[morfikov](https://github.com/morfikov) opened issue at [2020-10-04 15:39](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/46):
1658
1659 I have an Intel CPU, and when I run `kconfig-hardened-check` I get the following FAILs:
1660
1661 ```
1662 CONFIG_AMD_IOMMU                             |      y      |defconfig |  self_protection   |   FAIL: "is not set"
1663 CONFIG_AMD_IOMMU_V2                          |      y      |    my    |  self_protection   |   FAIL: not found
1664 ```
1665
1666 It would be nice to have such CPU specific options hidden in the results. 
1667
1668 The behavior of some options can be controlled via the kernel cmd line, for instance:
1669
1670 ```
1671 CONFIG_SLUB_DEBUG_ON                         |      y      |    my    |  self_protection   |   FAIL: "is not set"
1672 CONFIG_X86_VSYSCALL_EMULATION                | is not set  |  clipos  | cut_attack_surface |   FAIL: "y"
1673 ```
1674
1675 If a user set `slub_debug=FZP` and `vsyscall=none` in the kernel cmd line, I think he would achieve the same behavior. So, `kconfig-hardened-check` could check such kernel cmd line options before giving a FAIL. 
1676
1677 What do you think about such improvements? 
1678
1679 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-10-05 10:09](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/46#issuecomment-703535817):
1680
1681 Hi @morfikov, thanks for your ideas.
1682
1683 1. I think we can group AMD_IOMMU recommendations with the corresponding ones for Intel using `OR`.
1684 That would allow to avoid incorrect FAIL reports.
1685
1686 2. Parsing the kernel command line is a nice feature, it's on my TODO list. Moreover, we can get it from `/proc/cmdline` without additional privileges, which is nice.
1687
1688 I'm going to work on `kconfig-hardened-check` in the coming days.
1689 If you want to participate, come on, your pull requests will be welcome!
1690
1691 #### <img src="https://avatars.githubusercontent.com/u/32568352?v=4" width="50">[Bernhard40](https://github.com/Bernhard40) commented at [2020-10-05 11:03](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/46#issuecomment-703560552):
1692
1693 I always seen this project scope as simple kernel config checker not running system audit tool and I believe in old  unix mantra _Do One Thing and Do It Well_ so I'm skeptical about this additions. Taking  `/proc/cmdline` into account would mean same config would yield different result across systems. Having OR between amd and intel features make it less useful for distros which would want them all.
1694
1695 I think end users are capable of ignoring amd warnings when they have intel cpu and the opposite and also be aware o what they added to their cmdline.
1696
1697 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-10-05 11:55](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/46#issuecomment-703583549):
1698
1699 Hi @Bernhard40 
1700
1701 > Having OR between amd and intel features make it less useful for distros which would want them all.
1702
1703 Hm, you are right. I would agree on that point.
1704
1705 > Taking /proc/cmdline into account would mean same config would yield different result across systems
1706
1707 I would propose a compromise: add a separate flag for checking `/proc/cmdline` (disabled by default).
1708 Is it OK for you?
1709
1710 In fact, I see checking cmdline parameters as a very big improvement.
1711 There are several important cases when checking kernel config is not enough for a correct conclusion about the kernel security.
1712 Examples: `mitigations`, `page_poison`, `init_on_alloc/init_on_free` and some others.
1713
1714 #### <img src="https://avatars.githubusercontent.com/u/32568352?v=4" width="50">[Bernhard40](https://github.com/Bernhard40) commented at [2020-10-05 20:35](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/46#issuecomment-703873764):
1715
1716 > I would propose a compromise: add a separate flag for checking /proc/cmdline (disabled by default).
1717 > Is it OK for you?
1718
1719 I don't mind if you are ready to maintain it.
1720
1721 > In fact, I see checking cmdline parameters as a very big improvement.
1722 > There are several important cases when checking kernel config is not enough for a correct conclusion about the kernel security.
1723
1724 Yes but for now checking kernel config is the only thing this project ever promised (see readme). Conclusions about kernel security needs expanding the project scope which may be a rabbit hole as if you add cmdlne support then sysctl support should be next etc.
1725
1726 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-10-05 21:01](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/46#issuecomment-703886769):
1727
1728 @Bernhard40, I'll do my best.
1729
1730 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2022-05-28 19:19](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/46#issuecomment-1140317020):
1731
1732 Now kconfig-hardened-check supports checking kernel cmdline parameters.
1733
1734 Cool!
1735
1736 ```
1737 usage: kconfig-hardened-check [-h] [--version] [-p {X86_64,X86_32,ARM64,ARM}]
1738                               [-c CONFIG]
1739                               [-l CMDLINE]
1740                               [-m {verbose,json,show_ok,show_fail}]
1741
1742 A tool for checking the security hardening options of the Linux kernel
1743
1744 optional arguments:
1745   -h, --help            show this help message and exit
1746   --version             show program's version number and exit
1747   -p {X86_64,X86_32,ARM64,ARM}, --print {X86_64,X86_32,ARM64,ARM}
1748                         print security hardening preferences for the selected architecture
1749   -c CONFIG, --config CONFIG
1750                         check the kernel kconfig file against these preferences
1751   -l CMDLINE, --cmdline CMDLINE
1752                         check the kernel cmdline file against these preferences
1753   -m {verbose,json,show_ok,show_fail}, --mode {verbose,json,show_ok,show_fail}
1754                         choose the report mode
1755 ```
1756
1757
1758 -------------------------------------------------------------------------------
1759
1760 # [\#45 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/45) `closed`: Request for command line options to display only OK/FAIL items
1761
1762 #### <img src="https://avatars.githubusercontent.com/u/14027079?u=09634a743d6bc4698e252f4c692982df45481846&v=4" width="50">[fonic](https://github.com/fonic) opened issue at [2020-07-13 10:07](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/45):
1763
1764 I'd like to request command line options to reduce output to OK/FAIL items only, e.g.
1765 ```
1766 -o, --ok      only list items checked as OK
1767 -f, --fail    only list items checked as FAIL
1768 ```
1769
1770 This would make it much easier to work through the list of settings when hardening kernel configurations, especially if one only applies few at a time to test their impact.
1771
1772 This tool is great, many thanks!
1773
1774 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-07-15 11:55](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/45#issuecomment-658724615):
1775
1776 Hello @fonic,
1777
1778 Please see `show_ok` and `show_fail` modes:
1779 ```
1780 usage: kconfig-hardened-check [-h] [--version] [-p {X86_64,X86_32,ARM64,ARM}]
1781                               [-c CONFIG]
1782                               [-m {verbose,json,show_ok,show_fail}]
1783
1784 Checks the hardening options in the Linux kernel config
1785
1786 optional arguments:
1787   -h, --help            show this help message and exit
1788   --version             show program's version number and exit
1789   -p {X86_64,X86_32,ARM64,ARM}, --print {X86_64,X86_32,ARM64,ARM}
1790                         print hardening preferences for selected architecture
1791   -c CONFIG, --config CONFIG
1792                         check the kernel config file against these preferences
1793   -m {verbose,json,show_ok,show_fail}, --mode {verbose,json,show_ok,show_fail}
1794                         choose the report mode
1795 ```
1796
1797 Output example:
1798 ```
1799 $ ./bin/kconfig-hardened-check -c kconfig_hardened_check/config_files/distros/ubuntu-focal.config -m show_ok
1800 [+] Special report mode: show_ok
1801 [+] Config file to check: kconfig_hardened_check/config_files/distros/ubuntu-focal.config
1802 [+] Detected architecture: X86_64
1803 [+] Detected kernel version: 5.4
1804 =========================================================================================================================
1805                  option name                 | desired val | decision |       reason       |   check result
1806 =========================================================================================================================
1807 CONFIG_BUG                                   |      y      |defconfig |  self_protection   |   OK
1808 CONFIG_SLUB_DEBUG                            |      y      |defconfig |  self_protection   |   OK
1809 CONFIG_STACKPROTECTOR_STRONG                 |      y      |defconfig |  self_protection   |   OK
1810 CONFIG_STRICT_KERNEL_RWX                     |      y      |defconfig |  self_protection   |   OK
1811 CONFIG_STRICT_MODULE_RWX                     |      y      |defconfig |  self_protection   |   OK
1812 CONFIG_IOMMU_SUPPORT                         |      y      |defconfig |  self_protection   |   OK
1813 CONFIG_MICROCODE                             |      y      |defconfig |  self_protection   |   OK
1814 CONFIG_RETPOLINE                             |      y      |defconfig |  self_protection   |   OK
1815 CONFIG_X86_SMAP                              |      y      |defconfig |  self_protection   |   OK
1816 CONFIG_SYN_COOKIES                           |      y      |defconfig |  self_protection   |   OK
1817 CONFIG_X86_UMIP                              |      y      |defconfig |  self_protection   |   OK: CONFIG_X86_INTEL_UMIP "y"
1818 CONFIG_PAGE_TABLE_ISOLATION                  |      y      |defconfig |  self_protection   |   OK
1819 CONFIG_RANDOMIZE_MEMORY                      |      y      |defconfig |  self_protection   |   OK
1820 CONFIG_INTEL_IOMMU                           |      y      |defconfig |  self_protection   |   OK
1821 CONFIG_AMD_IOMMU                             |      y      |defconfig |  self_protection   |   OK
1822 CONFIG_VMAP_STACK                            |      y      |defconfig |  self_protection   |   OK
1823 CONFIG_RANDOMIZE_BASE                        |      y      |defconfig |  self_protection   |   OK
1824 CONFIG_THREAD_INFO_IN_TASK                   |      y      |defconfig |  self_protection   |   OK
1825 CONFIG_DEBUG_WX                              |      y      |   kspp   |  self_protection   |   OK
1826 CONFIG_SCHED_STACK_END_CHECK                 |      y      |   kspp   |  self_protection   |   OK
1827 CONFIG_SLAB_FREELIST_HARDENED                |      y      |   kspp   |  self_protection   |   OK
1828 CONFIG_SLAB_FREELIST_RANDOM                  |      y      |   kspp   |  self_protection   |   OK
1829 CONFIG_SHUFFLE_PAGE_ALLOCATOR                |      y      |   kspp   |  self_protection   |   OK
1830 CONFIG_FORTIFY_SOURCE                        |      y      |   kspp   |  self_protection   |   OK
1831 CONFIG_INIT_ON_ALLOC_DEFAULT_ON              |      y      |   kspp   |  self_protection   |   OK
1832 CONFIG_HARDENED_USERCOPY                     |      y      |   kspp   |  self_protection   |   OK
1833 CONFIG_MODULE_SIG                            |      y      |   kspp   |  self_protection   |   OK
1834 CONFIG_MODULE_SIG_ALL                        |      y      |   kspp   |  self_protection   |   OK
1835 CONFIG_MODULE_SIG_SHA512                     |      y      |   kspp   |  self_protection   |   OK
1836 CONFIG_INIT_ON_FREE_DEFAULT_ON               |      y      |   kspp   |  self_protection   |   OK: CONFIG_PAGE_POISONING "y"
1837 CONFIG_DEFAULT_MMAP_MIN_ADDR                 |    65536    |   kspp   |  self_protection   |   OK
1838 CONFIG_INTEL_IOMMU_SVM                       |      y      |  clipos  |  self_protection   |   OK
1839 CONFIG_RESET_ATTACK_MITIGATION               |      y      |    my    |  self_protection   |   OK
1840 CONFIG_SECURITY                              |      y      |defconfig |  security_policy   |   OK
1841 CONFIG_SECURITY_YAMA                         |      y      |   kspp   |  security_policy   |   OK
1842 CONFIG_SECURITY_WRITABLE_HOOKS               | is not set  |    my    |  security_policy   |   OK: not found
1843 CONFIG_SECURITY_LOCKDOWN_LSM                 |      y      |  clipos  |  security_policy   |   OK
1844 CONFIG_SECURITY_LOCKDOWN_LSM_EARLY           |      y      |  clipos  |  security_policy   |   OK
1845 CONFIG_SECURITY_SAFESETID                    |      y      |    my    |  security_policy   |   OK
1846 CONFIG_SECCOMP                               |      y      |defconfig | cut_attack_surface |   OK
1847 CONFIG_SECCOMP_FILTER                        |      y      |defconfig | cut_attack_surface |   OK
1848 CONFIG_STRICT_DEVMEM                         |      y      |defconfig | cut_attack_surface |   OK
1849 CONFIG_ACPI_CUSTOM_METHOD                    | is not set  |   kspp   | cut_attack_surface |   OK
1850 CONFIG_COMPAT_BRK                            | is not set  |   kspp   | cut_attack_surface |   OK
1851 CONFIG_DEVKMEM                               | is not set  |   kspp   | cut_attack_surface |   OK
1852 CONFIG_COMPAT_VDSO                           | is not set  |   kspp   | cut_attack_surface |   OK
1853 CONFIG_OABI_COMPAT                           | is not set  |   kspp   | cut_attack_surface |   OK: not found
1854 CONFIG_X86_PTDUMP                            | is not set  |grsecurity| cut_attack_surface |   OK
1855 CONFIG_ZSMALLOC_STAT                         | is not set  |grsecurity| cut_attack_surface |   OK
1856 CONFIG_PAGE_OWNER                            | is not set  |grsecurity| cut_attack_surface |   OK
1857 CONFIG_DEBUG_KMEMLEAK                        | is not set  |grsecurity| cut_attack_surface |   OK
1858 CONFIG_BINFMT_AOUT                           | is not set  |grsecurity| cut_attack_surface |   OK: not found
1859 CONFIG_DRM_LEGACY                            | is not set  |maintainer| cut_attack_surface |   OK
1860 CONFIG_X86_IOPL_IOPERM                       | is not set  | lockdown | cut_attack_surface |   OK: not found
1861 CONFIG_MMIOTRACE_TEST                        | is not set  | lockdown | cut_attack_surface |   OK
1862 CONFIG_X86_INTEL_TSX_MODE_OFF                |      y      |  clipos  | cut_attack_surface |   OK
1863 CONFIG_INTEGRITY                             |      y      |defconfig |userspace_hardening |   OK
1864
1865 [+] Config check is finished: 'OK' - 57 / 'FAIL' - 79 (suppressed in output)
1866 ```
1867
1868 #### <img src="https://avatars.githubusercontent.com/u/14027079?u=09634a743d6bc4698e252f4c692982df45481846&v=4" width="50">[fonic](https://github.com/fonic) commented at [2020-07-15 15:14](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/45#issuecomment-658827875):
1869
1870 Awesome, just tested it. That makes an already great tool even better. Many thanks!
1871
1872
1873 -------------------------------------------------------------------------------
1874
1875 # [\#44 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/44) `closed`: KSPP future in defconf linux distribution.
1876
1877 #### <img src="https://avatars.githubusercontent.com/u/3471772?v=4" width="50">[bryn1u](https://github.com/bryn1u) opened issue at [2020-05-10 18:01](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/44):
1878
1879 Hello,
1880
1881 Im just curious what is the status of implementing KSPP to default kernel of linux GNU distribution ? Why linux distributions dont impelment for example most of kspp solutions for example steackleak or gcc hardeneing ? I use most of kspp feature based on your script Alexander and kernel works like a charm. Someone can explain to me ?
1882
1883 #### <img src="https://avatars.githubusercontent.com/u/32568352?v=4" width="50">[Bernhard40](https://github.com/Bernhard40) commented at [2020-05-11 11:40](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/44#issuecomment-626650276):
1884
1885 Some settings may affect performance, debugability, support for older userspace software, etc.
1886
1887 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-05-18 09:58](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/44#issuecomment-630078520):
1888
1889 > Some settings may affect performance, debugability, support for older userspace software, etc.
1890
1891 I agree. 
1892 Moreover, kernel self-protection features often give different performance penalty for different kinds of workload. It's difficult to find one kernel configuration that makes everyone happy.
1893
1894 I think Linux distributions could provide several kernel flavours for different purposes (e.g. generic, hardened, low-latency), to improve the situation.
1895
1896 I'm sure @kees has more insights about this.
1897
1898 #### <img src="https://avatars.githubusercontent.com/u/1110841?u=e5e99e1ac8260e791433baa2423f7d173eea4c1c&v=4" width="50">[kees](https://github.com/kees) commented at [2020-05-18 15:16](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/44#issuecomment-630251690):
1899
1900 Yup! There is an open bug with KSPP to provide a defconfig fragment selection interface to the upstream kernel. You can see more details here:
1901 https://github.com/KSPP/linux/issues/14
1902
1903 #### <img src="https://avatars.githubusercontent.com/u/3471772?v=4" width="50">[bryn1u](https://github.com/bryn1u) commented at [2020-05-20 21:06](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/44#issuecomment-631726899):
1904
1905 Okey. Thanks guys for your work and explanation.
1906
1907
1908 -------------------------------------------------------------------------------
1909
1910 # [\#43 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/43) `merged`: Upgrading to Ubuntu 20.04 kernel config
1911
1912 #### <img src="https://avatars.githubusercontent.com/u/4661917?u=bb7aeb3c77839cea055b49b80168666b36315f3d&v=4" width="50">[theLOICofFRANCE](https://github.com/theLOICofFRANCE) opened issue at [2020-05-05 09:12](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/43):
1913
1914 Hi @a13xp0p0v, 
1915
1916 Here is the Ubuntu kernel configuration update.
1917
1918 Best regards.
1919
1920 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-05-06 21:41](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/43#issuecomment-624906056):
1921
1922 Thanks @HacKurx!
1923
1924
1925 -------------------------------------------------------------------------------
1926
1927 # [\#42 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/42) `closed`: add tests
1928
1929 #### <img src="https://avatars.githubusercontent.com/u/3125993?v=4" width="50">[shamilbi](https://github.com/shamilbi) opened issue at [2020-04-14 12:10](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/42):
1930
1931
1932
1933 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-04-24 23:29](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/42#issuecomment-619279461):
1934
1935 Hello @shamilbi !
1936 Could you please describe the purpose of this PR?
1937 By the way, tests for `kconfig-hardened-check` already exist as GitHub Actions (kind of continuous integration).
1938
1939 #### <img src="https://avatars.githubusercontent.com/u/3125993?v=4" width="50">[shamilbi](https://github.com/shamilbi) commented at [2020-04-25 07:33](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/42#issuecomment-619335943):
1940
1941 > Hello @shamilbi !
1942 > Could you please describe the purpose of this PR?
1943 > By the way, tests for `kconfig-hardened-check` already exist as GitHub Actions (kind of continuous integration).
1944
1945 If files `tests/results/**/*.check` are proper results of kconfig-hardened-check applied to `kconfig_hardened_check/config_files/**/*.config` then this PR just compares output of a current kconfig_hardened_check (a current commit) with those proper results.
1946 This gives you an exact diff in output from a last commit
1947
1948 #### <img src="https://avatars.githubusercontent.com/u/3125993?v=4" width="50">[shamilbi](https://github.com/shamilbi) commented at [2020-04-25 07:43](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/42#issuecomment-619337059):
1949
1950 [My workflows file](https://github.com/shamilbi/kconfig-hardened-check/blob/master/.github/workflows/test-master.yml)
1951
1952 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-05-06 21:19](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/42#issuecomment-624897025):
1953
1954 Yes, sometimes I use ouput diff during the `kconfig-hardened-check` development.
1955 However I don't think we need to commit the output results to the repository.
1956 Thank you anyway.
1957
1958
1959 -------------------------------------------------------------------------------
1960
1961 # [\#41 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/41) `merged`: Add CONFIG_INPUT_EVBUG
1962
1963 #### <img src="https://avatars.githubusercontent.com/u/4661917?u=bb7aeb3c77839cea055b49b80168666b36315f3d&v=4" width="50">[theLOICofFRANCE](https://github.com/theLOICofFRANCE) opened issue at [2020-04-09 11:38](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/41):
1964
1965 Hi @a13xp0p0v,
1966
1967 The "evbug" module records key events and mouse movements in the system log.
1968 Useful for debugging, this is a security threat, its use can be hijacked as a keylogger.
1969
1970 An attacker will be able to retrieve your passwords using this module.
1971
1972 Thank you.
1973
1974 Best regards,
1975
1976 #### <img src="https://avatars.githubusercontent.com/u/8655789?u=4694f03b321aa2287d9fe05155adcddb23272e81&v=4" width="50">[codecov-io](https://github.com/codecov-io) commented at [2020-04-09 11:39](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/41#issuecomment-611482374):
1977
1978 # [Codecov](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/41?src=pr&el=h1) Report
1979 > Merging [#41](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/41?src=pr&el=desc) into [master](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/commit/100a39e2b01dadd2d27ed805cbe2b4ead7fc8b05&el=desc) will **increase** coverage by `0.01%`.
1980 > The diff coverage is `100.00%`.
1981
1982 [![Impacted file tree graph](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/41/graphs/tree.svg?width=650&height=150&src=pr&token=GOOVXMV5Kb)](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/41?src=pr&el=tree)
1983
1984 ```diff
1985 @@            Coverage Diff             @@
1986 ##           master      #41      +/-   ##
1987 ==========================================
1988 + Coverage   93.19%   93.20%   +0.01%     
1989 ==========================================
1990   Files           3        3              
1991   Lines         470      471       +1     
1992   Branches      100      100              
1993 ==========================================
1994 + Hits          438      439       +1     
1995   Misses         17       17              
1996   Partials       15       15              
1997 ```
1998
1999 | Flag | Coverage Δ | |
2000 |---|---|---|
2001 | #functional_test | `93.20% <100.00%> (+0.01%)` | :arrow_up: |
2002
2003 | [Impacted Files](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/41?src=pr&el=tree) | Coverage Δ | |
2004 |---|---|---|
2005 | [kconfig\_hardened\_check/\_\_init\_\_.py](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/41/diff?src=pr&el=tree#diff-a2NvbmZpZ19oYXJkZW5lZF9jaGVjay9fX2luaXRfXy5weQ==) | `93.27% <100.00%> (+0.01%)` | :arrow_up: |
2006
2007 ------
2008
2009 [Continue to review full report at Codecov](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/41?src=pr&el=continue).
2010 > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
2011 > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
2012 > Powered by [Codecov](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/41?src=pr&el=footer). Last update [100a39e...a7e1677](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/41?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
2013
2014
2015 -------------------------------------------------------------------------------
2016
2017 # [\#40 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/40) `merged`: pylint some code
2018
2019 #### <img src="https://avatars.githubusercontent.com/u/3125993?v=4" width="50">[shamilbi](https://github.com/shamilbi) opened issue at [2020-04-08 07:01](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/40):
2020
2021
2022
2023 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-04-09 15:35](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/40#issuecomment-611595095):
2024
2025 Thanks @shamilbi.
2026 Merged.
2027
2028
2029 -------------------------------------------------------------------------------
2030
2031 # [\#39 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/39) `closed`: VerCheck: work with 3-digit kernel versions
2032
2033 #### <img src="https://avatars.githubusercontent.com/u/3125993?v=4" width="50">[shamilbi](https://github.com/shamilbi) opened issue at [2020-04-03 15:54](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/39):
2034
2035
2036
2037 #### <img src="https://avatars.githubusercontent.com/u/8655789?u=4694f03b321aa2287d9fe05155adcddb23272e81&v=4" width="50">[codecov-io](https://github.com/codecov-io) commented at [2020-04-03 16:25](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/39#issuecomment-608535796):
2038
2039 # [Codecov](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/39?src=pr&el=h1) Report
2040 > Merging [#39](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/39?src=pr&el=desc) into [master](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/commit/bdac2c22b96b3a682801674efed92fddc8a347b0&el=desc) will **increase** coverage by `0.60%`.
2041 > The diff coverage is `76.92%`.
2042
2043 [![Impacted file tree graph](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/39/graphs/tree.svg?width=650&height=150&src=pr&token=GOOVXMV5Kb)](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/39?src=pr&el=tree)
2044
2045 ```diff
2046 @@            Coverage Diff             @@
2047 ##           master      #39      +/-   ##
2048 ==========================================
2049 + Coverage   93.10%   93.70%   +0.60%     
2050 ==========================================
2051   Files           2        2              
2052   Lines         464      461       -3     
2053   Branches      100      101       +1     
2054 ==========================================
2055   Hits          432      432              
2056 + Misses         17       15       -2     
2057 + Partials       15       14       -1     
2058 ```
2059
2060 | Flag | Coverage Δ | |
2061 |---|---|---|
2062 | #functional_test | `93.70% <76.92%> (+0.60%)` | :arrow_up: |
2063
2064 | [Impacted Files](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/39?src=pr&el=tree) | Coverage Δ | |
2065 |---|---|---|
2066 | [kconfig\_hardened\_check/\_\_init\_\_.py](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/39/diff?src=pr&el=tree#diff-a2NvbmZpZ19oYXJkZW5lZF9jaGVjay9fX2luaXRfXy5weQ==) | `93.80% <76.92%> (+0.61%)` | :arrow_up: |
2067
2068 ------
2069
2070 [Continue to review full report at Codecov](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/39?src=pr&el=continue).
2071 > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
2072 > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
2073 > Powered by [Codecov](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/39?src=pr&el=footer). Last update [bdac2c2...97b9f90](https://codecov.io/gh/a13xp0p0v/kconfig-hardened-check/pull/39?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
2074
2075 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-04-06 13:32](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/39#issuecomment-609796546):
2076
2077 Hello @shamilbi,
2078 Thanks for your work!
2079
2080 Yes, the kernel version consists of 3 numbers (not digits). 
2081 Example from the main kernel Makefile:
2082 ```
2083 VERSION = 5
2084 PATCHLEVEL = 6
2085 SUBLEVEL = 0
2086 ```
2087
2088 New features come during the merge window of a new release of the mainline kernel.
2089 It is defined by 2 numbers - `version` and `patchlevel`.
2090 More info: https://www.kernel.org/doc/html/latest/process/2.Process.html
2091 That's why currently only two numbers are checked and IMO that's enough.
2092
2093 Thanks!
2094 Alexander
2095
2096 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-04-07 15:47](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/39#issuecomment-610465555):
2097
2098 @shamilbi, could you please move pylint fixes to a separate pull request?
2099 I would like to merge it. Thanks!
2100
2101 #### <img src="https://avatars.githubusercontent.com/u/3125993?v=4" width="50">[shamilbi](https://github.com/shamilbi) commented at [2020-04-08 08:35](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/39#issuecomment-610828778):
2102
2103 > @shamilbi, could you please move pylint fixes to a separate pull request?
2104 > I would like to merge it. Thanks!
2105 OK, done
2106
2107
2108 -------------------------------------------------------------------------------
2109
2110 # [\#38 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/38) `closed`: graphics related options
2111 **Labels**: `kernel_maintainer_feedback`
2112
2113
2114 #### <img src="https://avatars.githubusercontent.com/u/5088003?v=4" width="50">[danvet](https://github.com/danvet) opened issue at [2020-04-03 08:52](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/38):
2115
2116 Discussion with dmitry yukov on twitter:
2117
2118 CONFIG_DRM_LEGACY: Really old drivers from the 90s, with unfixable by design security holes. Unfortunately userspace for one modern driver (drm/nouveau) has used until just a few years ago by accident (we didn't delete all the old legacy driver setup code), so can't remove it all completely yet from kernel sources.
2119
2120 CONFIG_FB: Old display subsystem from the 90s, essentially unmaintained for over 10 years, would need serious effort to get up to speed with modern security best practices. This even includes the minimal fbdev emulation support built on top of drm gpu drivers, since the issues are in core fbdev code.
2121
2122 CONFIG_VT: Maybe the most disputed of all, but a lot of the console drivers this exposes to userspace are also from the 90s, and without CONFIG_FB this isn't really useful even for a desktop. A hardened distro definitely wants to make sure this is not set at all.
2123
2124
2125
2126 #### <img src="https://avatars.githubusercontent.com/u/32568352?v=4" width="50">[Bernhard40](https://github.com/Bernhard40) commented at [2020-04-03 12:03](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/38#issuecomment-608395946):
2127
2128 > You need at least one virtual terminal device in order to make use of your keyboard and monitor. Therefore, only people configuring an embedded system would want to say N here in order to save some memory; the only way to log into such a system is then via a serial or network connection.
2129
2130 Is this comment from [CONFIG_VT](https://cateee.net/lkddb/web-lkddb/VT.html) wrong then?
2131
2132 #### <img src="https://avatars.githubusercontent.com/u/5088003?v=4" width="50">[danvet](https://github.com/danvet) commented at [2020-04-03 12:32](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/38#issuecomment-608407778):
2133
2134 This comment hasn't been updated since decades (I checked historical trees ...). Nowadays Xorg and wayland compositors should be able to run without a VT. And kmscon (although abandoned due to lack of interest) can provide you a userspace implementation of VTs if you don't want to run X11 or wayland, using pseudo TTYs (like a terminal emulator).
2135
2136 A paranoid desktop distro imo should really not have VT enabled, and ofc whatever compositor they opt for (wayland, X11, or something like kmscon) needs to be walled in with a container.
2137
2138 But the comment is also correct in that without a userspace compositor you indeed will only be able to log in through the network or serial lines.
2139
2140 #### <img src="https://avatars.githubusercontent.com/u/5088003?v=4" width="50">[danvet](https://github.com/danvet) commented at [2020-04-03 12:42](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/38#issuecomment-608412082):
2141
2142 Maybe an addition: If you want multi-user switching without CONFIG_VT then you need something like systemd's logind, so that the (forced) handover of input and output devices works correctly. But the VT subsystem's only role there is as an rpc between compositors, it has 0 functionality to actually force compositors to hand over devices to the next compositor (which is what logind does, using some of the new ioctl calls added specifically for this for both input and drm subsystems).
2143
2144 So if you want actual secure multi-user switching then you should be running with all that new stuff already anyway (and then CONFIG_VT really shouldn't be enabled, to prevent creating a mess).
2145
2146 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-04-03 17:03](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/38#issuecomment-608553993):
2147
2148 Thanks @danvet !
2149 Done: https://github.com/a13xp0p0v/kconfig-hardened-check/commit/75bed5d6178375a64f93ced4795ee0cf47442df1
2150
2151 #### <img src="https://avatars.githubusercontent.com/u/5088003?v=4" width="50">[danvet](https://github.com/danvet) commented at [2020-04-03 17:24](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/38#issuecomment-608563651):
2152
2153 Thanks, looks neat. Hopefully this pushes a few more people to make this happen finally.
2154
2155 #### <img src="https://avatars.githubusercontent.com/u/1095328?u=91175c42d0de0ad8ba9f70cc6b9a41bbfbe70de8&v=4" width="50">[dvyukov](https://github.com/dvyukov) commented at [2020-04-03 17:28](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/38#issuecomment-608565745):
2156
2157 @a13xp0p0v Are these enabled in any distros for which you have canned configs?
2158
2159 @danvet I just noticed on the current upstream HEAD:
2160 ```
2161 $ rm .config
2162 $ make defconfig
2163 $ egrep "CONFIG_VT=|CONFIG_FB=" .config
2164 CONFIG_VT=y
2165 CONFIG_FB=y
2166 ```
2167 So that may be the first step :)
2168
2169 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-04-03 20:18](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/38#issuecomment-608639217):
2170
2171 @dvyukov, yes, these are enabled in many distributions:
2172 ```
2173 AOSP_Pixel3A:
2174   CONFIG_DRM_LEGACY    | is not set  |maintainer| cut_attack_surface |   OK
2175   CONFIG_FB            | is not set  |maintainer| cut_attack_surface |   FAIL: "y"
2176   CONFIG_VT            | is not set  |maintainer| cut_attack_surface |   OK
2177
2178 AmazonLinux2:
2179   CONFIG_DRM_LEGACY    | is not set  |maintainer| cut_attack_surface |   OK
2180   CONFIG_FB            | is not set  |maintainer| cut_attack_surface |   FAIL: "m"
2181   CONFIG_VT            | is not set  |maintainer| cut_attack_surface |   FAIL: "y"
2182
2183 ubuntu-bionic-generic:
2184   CONFIG_DRM_LEGACY    | is not set  |maintainer| cut_attack_surface |   OK
2185   CONFIG_FB            | is not set  |maintainer| cut_attack_surface |   FAIL: "y"
2186   CONFIG_VT            | is not set  |maintainer| cut_attack_surface |   FAIL: "y"
2187
2188 oracle-uek6:
2189   CONFIG_DRM_LEGACY    | is not set  |maintainer| cut_attack_surface |   FAIL: "y"
2190   CONFIG_FB            | is not set  |maintainer| cut_attack_surface |   FAIL: "y"
2191   CONFIG_VT            | is not set  |maintainer| cut_attack_surface |   FAIL: "y"
2192
2193 Archlinux-hardened:
2194   CONFIG_DRM_LEGACY    | is not set  |maintainer| cut_attack_surface |   OK
2195   CONFIG_FB            | is not set  |maintainer| cut_attack_surface |   FAIL: "y"
2196   CONFIG_VT            | is not set  |maintainer| cut_attack_surface |   FAIL: "y"
2197
2198 clearlinux-master:
2199   CONFIG_DRM_LEGACY    | is not set  |maintainer| cut_attack_surface |   FAIL: "y"
2200   CONFIG_FB            | is not set  |maintainer| cut_attack_surface |   FAIL: "y"
2201   CONFIG_VT            | is not set  |maintainer| cut_attack_surface |   FAIL: "y"
2202
2203 SLE15:
2204   CONFIG_DRM_LEGACY    | is not set  |maintainer| cut_attack_surface |   OK
2205   CONFIG_FB            | is not set  |maintainer| cut_attack_surface |   FAIL: "y"
2206   CONFIG_VT            | is not set  |maintainer| cut_attack_surface |   FAIL: "y"
2207
2208 openSUSE-15.1:
2209   CONFIG_DRM_LEGACY    | is not set  |maintainer| cut_attack_surface |   OK
2210   CONFIG_FB            | is not set  |maintainer| cut_attack_surface |   FAIL: "y"
2211   CONFIG_VT            | is not set  |maintainer| cut_attack_surface |   FAIL: "y"
2212
2213 pentoo-livecd:
2214   CONFIG_DRM_LEGACY    | is not set  |maintainer| cut_attack_surface |   OK
2215   CONFIG_FB            | is not set  |maintainer| cut_attack_surface |   FAIL: "y"
2216   CONFIG_VT            | is not set  |maintainer| cut_attack_surface |   FAIL: "y"
2217
2218 rhel-8.0:
2219   CONFIG_DRM_LEGACY    | is not set  |maintainer| cut_attack_surface |   OK
2220   CONFIG_FB            | is not set  |maintainer| cut_attack_surface |   FAIL: "y"
2221   CONFIG_VT            | is not set  |maintainer| cut_attack_surface |   FAIL: "y"
2222
2223 nixpkgs-linux_hardened:
2224   CONFIG_DRM_LEGACY    | is not set  |maintainer| cut_attack_surface |   FAIL: "y"
2225   CONFIG_FB            | is not set  |maintainer| cut_attack_surface |   FAIL: "y"
2226   CONFIG_VT            | is not set  |maintainer| cut_attack_surface |   FAIL: "y"
2227
2228 debian-buster:
2229   CONFIG_DRM_LEGACY    | is not set  |maintainer| cut_attack_surface |   FAIL: "y"
2230   CONFIG_FB            | is not set  |maintainer| cut_attack_surface |   FAIL: "y"
2231   CONFIG_VT            | is not set  |maintainer| cut_attack_surface |   FAIL: "y"
2232
2233 Alpinelinux-edge:
2234   CONFIG_DRM_LEGACY    | is not set  |maintainer| cut_attack_surface |   FAIL: "y"
2235   CONFIG_FB            | is not set  |maintainer| cut_attack_surface |   FAIL: "y"
2236   CONFIG_VT            | is not set  |maintainer| cut_attack_surface |   FAIL: "y"
2237 ```
2238
2239 #### <img src="https://avatars.githubusercontent.com/u/1080275?v=4" width="50">[arndb](https://github.com/arndb) commented at [2020-04-04 09:48](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/38#issuecomment-609004574):
2240
2241 The hyperv framebuffer driver came up on the mailing list recently when I noticed a patch to add support for arm64 and suggested having it converted to DRM. Other hardware-independent drivers that don't seem to have a DRM counterpart at the moment are the UEFI framebuffer that is often used in the absence of a hardware specific driver and the goldfish driver for Android device emulation.
2242
2243 It might help to also look at each distro to see which device drivers are enabled for DRM_LEGACY and FBDEV, as there may be others that are important and need to be converted.
2244
2245 #### <img src="https://avatars.githubusercontent.com/u/5088003?v=4" width="50">[danvet](https://github.com/danvet) commented at [2020-04-04 11:12](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/38#issuecomment-609012871):
2246
2247 @dvyukov the trouble is you'll break pretty much any general purpose distro with this stuff disabled. Iirc most compositors keel over if they can't open a vt (but they should all have options to survive without one). Plus since neither kmscon nor system-consoled ever happened for real no kernel console without these, so all the whitebeards will be screaming with their pitchforks. Really not something you can do in a defconfig unfortunately.
2248
2249 @arndb yeah there was simpledrm also back around kmscon to make this happen, but it didn't. For everything else we seem to have a small community of people now pushing out drm drivers for all these things, but more is always welcome. A drm driver in less that 1kloc is fairly standard nowadays, trouble only happens if you have a strange new constraint.
2250
2251 Wrt DRM_LEGACY and FBDEV drivers in general, I get the impression that distros which enable them just enable everything, because. E.g. debian still enables DRM_LEGACY, but they long ago stopped shipping the corresponding userspace drivers. So just plain nonsense in their defconfig (and a CVE when you load drm/nouveau.ko because backwards compat)
2252
2253
2254 -------------------------------------------------------------------------------
2255
2256 # [\#37 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/37) `closed`: conflict with the latest grsecurity
2257
2258 #### <img src="https://avatars.githubusercontent.com/u/50359848?v=4" width="50">[pythonmandev](https://github.com/pythonmandev) opened issue at [2020-03-30 14:20](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/37):
2259
2260 CONFIG_REFCOUNT_FULL conflict with PAX_REFCOUNT
2261 PAGE_TABLE_ISOLATION conflict with PAX_MEMORY_UDEREF
2262 VMAP_STACK conflict with GRKERNSEC_KSTACKOVERFLOW
2263 SECURITY_YAMA conflict with GRKERNSEC
2264 RANDOMIZE_BASE also can not enable.
2265
2266 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-03-31 11:29](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/37#issuecomment-606569944):
2267
2268 Hello @pythonmandev!
2269 What do you mean saying "latest grsecurity"?
2270
2271 #### <img src="https://avatars.githubusercontent.com/u/203012?u=939d6d3b5ff0b9e46e911d8792a40c20408574e2&v=4" width="50">[anthraxx](https://github.com/anthraxx) commented at [2020-03-31 11:38](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/37#issuecomment-606574067):
2272
2273 its not an openly available patchset anymore hence i suggest to not take it into account. I would think differently if it would be open source, but sadly its not.
2274
2275
2276 -------------------------------------------------------------------------------
2277
2278 # [\#36 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/36) `closed`: null
2279
2280 #### <img src="(unknown)" width="50">[(unknown)]((unknown)) opened issue at [2020-03-30 14:13](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/36):
2281
2282 null
2283
2284
2285
2286
2287 -------------------------------------------------------------------------------
2288
2289 # [\#35 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/35) `closed`: can't add version check for constraints in a logical product
2290
2291 #### <img src="https://avatars.githubusercontent.com/u/785111?u=8feaa758657096dbcadcd190fbea88e371aab7be&v=4" width="50">[tych0](https://github.com/tych0) opened issue at [2020-03-26 17:44](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/35):
2292
2293 If I try to do:
2294
2295 ```
2296 diff --git a/kconfig_hardened_check/__init__.py b/kconfig_hardened_check/__init__.py
2297 index 3fcb5e0..1c31c40 100755
2298 --- a/kconfig_hardened_check/__init__.py
2299 +++ b/kconfig_hardened_check/__init__.py
2300 @@ -251,8 +251,8 @@ def construct_checklist(checklist, arch):
2301          checklist.append(OptCheck('MICROCODE',                   'y', 'defconfig', 'self_protection')) # is needed for mitigating CPU bugs
2302          checklist.append(OptCheck('RETPOLINE',                   'y', 'defconfig', 'self_protection'))
2303          checklist.append(OptCheck('X86_SMAP',                    'y', 'defconfig', 'self_protection'))
2304 -        checklist.append(OR(OptCheck('X86_UMIP',                 'y', 'defconfig', 'self_protection'), \
2305 -                            OptCheck('X86_INTEL_UMIP',           'y', 'defconfig', 'self_protection')))
2306 +        checklist.append(OR(AND(OptCheck('X86_UMIP',                 'y', 'defconfig', 'self_protection'), VerCheck((5, 5))), \
2307 +                            AND(OptCheck('X86_INTEL_UMIP',           'y', 'defconfig', 'self_protection'), VerCheck((4, 14)))))
2308          checklist.append(OptCheck('SYN_COOKIES',                 'y', 'defconfig', 'self_protection')) # another reason?
2309      if arch == 'X86_64':
2310          checklist.append(OptCheck('PAGE_TABLE_ISOLATION',        'y', 'defconfig', 'self_protection'))
2311 ```
2312
2313 I get:
2314
2315 ```
2316 Traceback (most recent call last):
2317   File "/home/tycho/.local/bin/kconfig-hardened-check", line 10, in <module>
2318     sys.exit(main())
2319   File "/home/tycho/.local/lib/python3.7/site-packages/kconfig_hardened_check/__init__.py", line 611, in main
2320     check_config_file(config_checklist, args.config, arch)
2321   File "/home/tycho/.local/lib/python3.7/site-packages/kconfig_hardened_check/__init__.py", line 554, in check_config_file
2322     perform_checks(checklist, parsed_options)
2323   File "/home/tycho/.local/lib/python3.7/site-packages/kconfig_hardened_check/__init__.py", line 519, in perform_checks
2324     o.state = parsed_options.get(o.name, None)
2325 AttributeError: can't set attribute
2326 ```
2327
2328 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-03-28 20:54](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/35#issuecomment-605518372):
2329
2330 Hello @tych0!
2331 I'm glad that you had a look at this project!
2332 How are you doing? :)
2333
2334 Yes, currently the combination of `ComplexOptCheck` objects is not supported (there have been no cases that needed it).
2335
2336 The original logic behind `X86_UMIP` check:
2337  - if `X86_UMIP` or `X86_INTEL_UMIP` is set to `y`, then `OK`;
2338  - otherwise `FAIL`.
2339
2340 What is the purpose of combining `UMIP` check with version check?
2341
2342 I designed `VerCheck` for cases like that:
2343  - if `REFCOUNT_FULL` is set to `y`, then `OK`;
2344  - if kernel version >= `5.5`, then `OK` (since `REFCOUNT_FULL` is enabled by default and dropped since v5.5);
2345  - otherwise `FAIL`.
2346
2347 N.B. There is an implicit drawback with checking kernel versions.
2348 Some kernel features are backported to previous stable kernels.
2349 That's why checking the version can give false positive or false negative result.
2350 Detailed example: https://github.com/a13xp0p0v/kconfig-hardened-check/pull/32
2351
2352 Thanks!
2353
2354 #### <img src="https://avatars.githubusercontent.com/u/785111?u=8feaa758657096dbcadcd190fbea88e371aab7be&v=4" width="50">[tych0](https://github.com/tych0) commented at [2020-03-29 14:51](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/35#issuecomment-605648635):
2355
2356 On Sat, Mar 28, 2020 at 01:55:08PM -0700, Alexander Popov wrote:
2357 > Hello @tych0!
2358 > I'm glad that you had a look at this project!
2359 > How are you doing? :)
2360
2361 Good, just hacking away :)
2362
2363 > Yes, currently the combination of `ComplexOptCheck` objects is not supported (there have been no cases that needed it).
2364
2365 > The original logic behind `X86_UMIP` check:
2366 >  - if `X86_UMIP` or `X86_INTEL_UMIP` is set to `y`, then `OK`;
2367 >  - otherwise `FAIL`.
2368
2369 > What is the purpose of combining `UMIP` check with version check?
2370
2371 It's only present in 4.15 or greater; I'm running a 4.14 kernel and
2372 kconfig-hardened-check is complaining at me :)
2373
2374 > I designed `VerCheck` for cases like that:
2375 >  - if `REFCOUNT_FULL` is set to `y`, then `OK`;
2376 >  - if kernel version >= `5.5`, then `OK` (since `REFCOUNT_FULL` is enabled by default and dropped since v5.5);
2377 >  - otherwise `FAIL`.
2378
2379 > N.B. There is an implicit drawback with checking kernel versions.
2380 > Some kernel features are backported to previous stable kernels.
2381 > That's why checking the version can give false positive or false negative result.
2382 > Detailed example: https://github.com/a13xp0p0v/kconfig-hardened-check/pull/32
2383
2384 "Not present" is also risky though, if people don't have some of the
2385 dependencies of a feature enabled. A version whitelist seems the best.
2386
2387 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-03-30 21:12](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/35#issuecomment-606252748):
2388
2389 >> What is the purpose of combining `UMIP` check with version check?
2390
2391 > It's only present in 4.15 or greater; I'm running a 4.14 kernel and kconfig-hardened-check is complaining at me :)
2392
2393 Yes, that's good. The tool inspires you to switch onto a newer kernel :)
2394
2395 > "Not present" is also risky though, if people don't have some of the
2396 dependencies of a feature enabled. 
2397
2398 You know, I haven't seen any example of such unmet dependencies. I suppose that kernel feature dependencies are resolved by Kconfig.
2399
2400 > A version whitelist seems the best.
2401
2402 I would like to avoid version checking as much as possible.
2403 Relying on kernel version brings so many troubles!
2404 For example:
2405  - sometimes new features are backported to previous stable kernels,
2406  - sometimes Linux distributions cherry-pick features into their kernels,
2407  - some Linux distributions have custom kernel versioning scheme -- look at Ubuntu or Red Hat.
2408
2409 Finally, the most important aspect.
2410 I like that kernels of different versions are checked against the same list of recommendations.
2411 Hence they can be compared using `OK/FAIL` numbers that are printed by the tool in the end:
2412 ```
2413 [+] config check is finished: 'OK' - 55 / 'FAIL' - 77
2414 ```
2415
2416 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-04-10 16:49](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/35#issuecomment-612117051):
2417
2418 @tych0 your issue reminded me the idea to create some formatted annotations, that can be used for muting checks for a particular kernel. That was discussed in #9.
2419 Thank you.
2420
2421 #### <img src="https://avatars.githubusercontent.com/u/785111?u=8feaa758657096dbcadcd190fbea88e371aab7be&v=4" width="50">[tych0](https://github.com/tych0) commented at [2020-04-10 16:55](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/35#issuecomment-612119721):
2422
2423 Sorry, I read this and forgot to respond :)
2424
2425 > Yes, that's good. The tool inspires you to switch onto a newer kernel :)
2426
2427 Yes, but switching is not so easy sometimes, because of institutional challenges. If we want to add this to our CI to check our kernel configs or something, it would be nice to exclude stuff that doesn't exist in our kernel. I can do this manually, but it would be nicer to have this knowledge baked into the script.
2428
2429 > You know, I haven't seen any example of such unmet dependencies. I suppose that kernel feature dependencies are resolved by Kconfig.
2430
2431 Consider GCC_PLUGIN_STACKLEAK; we'll report "Not present" if the user hasn't set CONFIG_GCC_PLUGINS=n, but it really should be an error.
2432
2433 #### <img src="https://avatars.githubusercontent.com/u/785111?u=8feaa758657096dbcadcd190fbea88e371aab7be&v=4" width="50">[tych0](https://github.com/tych0) commented at [2020-04-10 16:56](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/35#issuecomment-612119803):
2434
2435 Anwyay, I'll check out the updates, thanks :)
2436
2437
2438 -------------------------------------------------------------------------------
2439
2440 # [\#34 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/34) `merged`: GrapheneOS is the continuation of CopperheadOS
2441
2442 #### <img src="https://avatars.githubusercontent.com/u/50278627?v=4" width="50">[madaidan](https://github.com/madaidan) opened issue at [2020-03-22 19:44](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/34):
2443
2444 "CopperheadOS" is the project's legacy name which is now being used for a scam focused on attacking GrapheneOS, the true continuation.
2445
2446 https://twitter.com/DanielMicay/status/1171170734380654597
2447
2448 https://twitter.com/DanielMicay/status/1160831422908829696
2449
2450 https://old.reddit.com/r/CopperheadOS/comments/8qdnn3/goodbye/
2451
2452 https://github.com/yegortimoshenko/copperhead-takeover
2453
2454
2455
2456
2457 -------------------------------------------------------------------------------
2458
2459 # [\#33 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/33) `closed`: CONFIG_STATIC_USERMODEHELPER
2460
2461 #### <img src="https://avatars.githubusercontent.com/u/543852?v=4" width="50">[anthonyryan1](https://github.com/anthonyryan1) opened issue at [2020-03-20 22:25](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/33):
2462
2463 I read over the CLIP OS notes regarding this option, and they also mention that they are not currently using it in the second paragraph.
2464
2465 It seems to be that this option isn't actually helpful unless you've already got a usermode helper program?
2466
2467 Just questioning the wisdom of this option as I imagine some people will just enable everything they see here, and may wind up with this pointing at a non-existent binary.
2468
2469 #### <img src="https://avatars.githubusercontent.com/u/32568352?v=4" width="50">[Bernhard40](https://github.com/Bernhard40) commented at [2020-03-21 10:52](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/33#issuecomment-602026415):
2470
2471 Yes, this option needs userspace support and yes, blindly enabling everything may cause harm.
2472
2473 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-03-23 15:22](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/33#issuecomment-602670488):
2474
2475 @Bernhard40, absolutely agree.
2476 N.B. There is a comment about `STATIC_USERMODEHELPER` in the source code:
2477 ```
2478 checklist.append(OptCheck('STATIC_USERMODEHELPER', 'y', 'clipos', 'self_protection')) # needs userspace support (systemd)
2479 ```
2480
2481
2482 -------------------------------------------------------------------------------
2483
2484 # [\#32 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/32) `closed`: Fix LDISC_AUTOLOAD check
2485
2486 #### <img src="https://avatars.githubusercontent.com/u/50278627?v=4" width="50">[madaidan](https://github.com/madaidan) opened issue at [2020-03-09 18:01](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/32):
2487
2488 CONFIG_LDISC_AUTOLOAD has existed since v4.14, not v5.1: https://lkml.org/lkml/2019/4/15/890
2489
2490 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-03-14 09:52](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/32#issuecomment-599034709):
2491
2492 Hello @madaidan,
2493
2494 Thanks for noticing that!
2495
2496 CONFIG_LDISC_AUTOLOAD was introduced in 5.1:
2497 changelog https://kernelnewbies.org/Linux_5.1
2498 upstream commit https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7c0cca7c847e6e019d67b7d793efbbe3b947d004
2499
2500 I checked, it was later backported to stable kernels 4.14, 4.9 and 4.4.
2501 So we can't have a correct check based on a kernel version.
2502 For example this option exists in kernel 4.4.216, but doesn't exist in 4.5.
2503
2504 I think the correct approach here is to add another type of check that can distinguish "is not set" and "not found".
2505
2506 What do you think?
2507
2508 #### <img src="https://avatars.githubusercontent.com/u/50278627?v=4" width="50">[madaidan](https://github.com/madaidan) commented at [2020-03-14 20:29](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/32#issuecomment-599131303):
2509
2510 How about a whitelist of allowed versions? So it checks for 4.4, 4.9, 4.14 or ≥5.1 but not 4.5.
2511
2512 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-03-31 11:46](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/32#issuecomment-606577240):
2513
2514 Hm, I got an idea.
2515 I'll try to create a new check that the option __exists__ in the config.
2516 So for `LDISC_AUTOLOAD` we can create a rule `(exists) AND (is not set)`.
2517
2518 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-03-31 14:13](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/32#issuecomment-606654029):
2519
2520 Done!
2521 Thanks!
2522
2523
2524 -------------------------------------------------------------------------------
2525
2526 # [\#31 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/31) `merged`: Update config files
2527
2528 #### <img src="https://avatars.githubusercontent.com/u/4661917?u=bb7aeb3c77839cea055b49b80168666b36315f3d&v=4" width="50">[theLOICofFRANCE](https://github.com/theLOICofFRANCE) opened issue at [2020-02-24 20:27](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/31):
2529
2530 Hi @a13xp0p0v, 
2531
2532 Here are the updates of the distributions configuration files. I also had to update some links.
2533 Please note that we now have the majority of configurations with versions >= to linux 5.3 🧙‍♂️
2534
2535 See you soon.
2536
2537 Best regards,
2538
2539 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-02-27 17:36](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/31#issuecomment-592084682):
2540
2541 Thanks, @HacKurx!
2542
2543 N.B. I'm going to work on support of new kernel releases in the near future.
2544
2545 #### <img src="https://avatars.githubusercontent.com/u/4661917?u=bb7aeb3c77839cea055b49b80168666b36315f3d&v=4" width="50">[theLOICofFRANCE](https://github.com/theLOICofFRANCE) commented at [2020-03-04 19:09](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/31#issuecomment-594761475):
2546
2547 @a13xp0p0v, 
2548 > N.B. I'm going to work on support of new kernel releases in the near future.
2549
2550 https://kernsec.org/wiki/index.php?title=Kernel_Self_Protection_Project/Recommended_Settings&diff=4001&oldid=prev
2551
2552 :wink:
2553
2554 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-03-04 19:55](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/31#issuecomment-594797254):
2555
2556 Yes, thanks, I'm already working on that!
2557
2558
2559 -------------------------------------------------------------------------------
2560
2561 # [\#30 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/30) `closed`: Has CONFIG_REFCOUNT_FULL and VMAP_STACK been removed from Kernel-5.5 ?
2562
2563 #### <img src="https://avatars.githubusercontent.com/u/3471772?v=4" width="50">[bryn1u](https://github.com/bryn1u) opened issue at [2020-02-01 12:24](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/30):
2564
2565 Hey everyone,
2566
2567 Im trying to configure Kernel-5.5 config and i don't see CONFIG_REFCOUNT_FULL option and the same with VMAP_STACK.
2568 I use Kernel-5.3 for now and there is an option available. Soo should i think that this option is no longer available ?
2569
2570 Thanks !
2571
2572 #### <img src="https://avatars.githubusercontent.com/u/32568352?v=4" width="50">[Bernhard40](https://github.com/Bernhard40) commented at [2020-02-02 13:05](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/30#issuecomment-581133592):
2573
2574 `CONFIG_REFCOUNT_FULL` was removed but `CONFIG_VMAP_STACK` is still available.
2575
2576 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-02-05 16:54](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/30#issuecomment-582504214):
2577
2578 Yes, `REFCOUNT_FULL` was removed...
2579 Have to find a way how to check it without false positive.
2580
2581 #### <img src="https://avatars.githubusercontent.com/u/32568352?v=4" width="50">[Bernhard40](https://github.com/Bernhard40) commented at [2020-02-06 12:30](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/30#issuecomment-582884278):
2582
2583 @a13xp0p0v there is kernel version printed in config header, like:
2584
2585 ```
2586 #
2587 # Automatically generated file; DO NOT EDIT.
2588 # Linux/x86 5.5.2 Kernel Configuration
2589 #
2590 ```
2591
2592 maybe you can parse those?
2593
2594 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-02-06 15:25](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/30#issuecomment-582957059):
2595
2596 Yes, it looks like we have to add some limited kernel version checking...
2597
2598 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-02-06 15:29](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/30#issuecomment-582959470):
2599
2600 I may have time to work on that only after OffensiveCon.
2601 Does anybody want to prepare a pull request?
2602
2603 #### <img src="https://avatars.githubusercontent.com/u/3471772?v=4" width="50">[bryn1u](https://github.com/bryn1u) commented at [2020-02-09 13:03](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/30#issuecomment-583842999):
2604
2605 Hey,
2606
2607 Is a CONFIG_HAVE_ARCH_VMAP_STACK in Kernel-5.5.2 equivalent to
2608 CONFIG_VMAPSTACK ?
2609
2610 Thanks !
2611
2612 czw., 6 lut 2020 o 16:29 Alexander Popov <notifications@github.com>
2613 napisał(a):
2614
2615 > I may have time to work on that only after OffensiveCon.
2616 > Does anybody want to prepare a pull request?
2617 >
2618 > —
2619 > You are receiving this because you authored the thread.
2620 > Reply to this email directly, view it on GitHub
2621 > <https://github.com/a13xp0p0v/kconfig-hardened-check/issues/30?email_source=notifications&email_token=AA2PTHCFMA26NITNFRMNTU3RBQUHBA5CNFSM4KOS3L22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEK7UC3Q#issuecomment-582959470>,
2622 > or unsubscribe
2623 > <https://github.com/notifications/unsubscribe-auth/AA2PTHBA772R35Y6MYOQS6DRBQUHBANCNFSM4KOS3L2Q>
2624 > .
2625 >
2626
2627 #### <img src="https://avatars.githubusercontent.com/u/32568352?v=4" width="50">[Bernhard40](https://github.com/Bernhard40) commented at [2020-02-10 14:32](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/30#issuecomment-584150411):
2628
2629 > Is a CONFIG_HAVE_ARCH_VMAP_STACK in Kernel-5.5.2 equivalent to
2630 > CONFIG_VMAPSTACK ?
2631
2632 No `CONFIG_HAVE_ARCH_VMAP_STACK` tells only if `VMAP_STACK` is available for specific cpu architecture. `CONFIG_VMAP_STACK` tells if `VMAP_STACK` is enabled.
2633
2634 You can check that [VMAP_STACK definitely still exist up to 5.6-rc](https://cateee.net/lkddb/web-lkddb/VMAP_STACK.html).
2635
2636 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-03-05 11:03](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/30#issuecomment-595170199):
2637
2638 Hello!
2639
2640 Worked with that issue in 0ace19012b626203d14332090cdcd40ed2237100, 918b12cf6f652ad148c885d1a802459e73d20c48 and 17c22224ac5b20c3d0ed49e7859642756e178bd9.
2641
2642 Also have a look at 61b5ca3c8f95212141284be8eb4036c8c1bda9e7: that fixes the false positive report about LDISC_AUTOLOAD for old kernels.
2643
2644
2645 -------------------------------------------------------------------------------
2646
2647 # [\#29 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/29) `closed`: Recommend PANIC_ON_OOPS
2648
2649 #### <img src="https://avatars.githubusercontent.com/u/50278627?v=4" width="50">[madaidan](https://github.com/madaidan) opened issue at [2020-01-13 21:28](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/29):
2650
2651 This causes the kernel to panic on an oops.
2652
2653 Recommended by the KSPP and CLIP OS.
2654
2655 https://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project/Recommended_Settings
2656
2657 > \# Reboot devices immediately if kernel experiences an Oops.
2658 > CONFIG_PANIC_ON_OOPS=y
2659 > CONFIG_PANIC_TIMEOUT=-1
2660
2661 https://docs.clip-os.org/clipos/kernel.html
2662
2663 > CONFIG_PANIC_ON_OOPS=y
2664 > CONFIG_PANIC_TIMEOUT=-1
2665 >
2666 >    Prevent potential further exploitation of a bug by immediately panicking the kernel.
2667
2668 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-01-14 09:23](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/29#issuecomment-574081092):
2669
2670 Hello @madaidan,
2671
2672 Yes, I saw this KSPP recommendation.
2673 I personally don't support it because it provides easy denial-of-service attack for the whole system (there are a lot of BUG()'s in the kernel).
2674
2675 In my opinion having CONFIG_BUG is enough. If we have kernel oops in the process context, the offending/attacking process is killed.
2676
2677 #### <img src="https://avatars.githubusercontent.com/u/50278627?v=4" width="50">[madaidan](https://github.com/madaidan) commented at [2020-01-14 16:52](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/29#issuecomment-574269683):
2678
2679 I think the kernel exploits this can prevent are more important than DoS.
2680
2681 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-01-16 10:06](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/29#issuecomment-575078024):
2682
2683 > I think the kernel exploits this can prevent are more important than DoS.
2684
2685 Could you please give a real example of the exploit that:
2686   1. is NOT blocked by having `CONFIG_BUG=y`,
2687 and
2688   2. is blocked by having `CONFIG_PANIC_ON_OOPS=y`.
2689
2690 Thanks!
2691
2692 #### <img src="https://avatars.githubusercontent.com/u/50278627?v=4" width="50">[madaidan](https://github.com/madaidan) commented at [2020-01-16 17:30](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/29#issuecomment-575259978):
2693
2694 This is a good example since it explicitly mentions panic_on_oops: https://googleprojectzero.blogspot.com/2018/09/a-cache-invalidation-bug-in-linux.html
2695
2696 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-01-17 15:10](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/29#issuecomment-575664888):
2697
2698 > This is a good example since it explicitly mentions panic_on_oops: https://googleprojectzero.blogspot.com/2018/09/a-cache-invalidation-bug-in-linux.html
2699
2700 No, sorry, that's a wrong example.
2701
2702 In that exploit Jann Horn used the output of `WARN_ON_ONCE()`.
2703 Having `CONFIG_PANIC_ON_OOPS=y` doesn't prevent his method, since kernel continues to run after `WARN_ON_ONCE()` anyway.
2704
2705 Moreover, let me quote Jann about CONFIG_PANIC_ON_OOPS:
2706 ```
2707 It is off by default in the upstream kernel - and enabling it by default in distributions
2708 would probably be a bad idea -, but it is e.g. enabled by Android.
2709 ```
2710
2711 If some users want to enable it anyway, they can always use `kernel.panic_on_oops` sysctl or the corresponding kernel command line parameter.
2712
2713 #### <img src="https://avatars.githubusercontent.com/u/50278627?v=4" width="50">[madaidan](https://github.com/madaidan) commented at [2020-01-20 17:34](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/29#issuecomment-576372137):
2714
2715 Alright. Fair enough.
2716
2717
2718 -------------------------------------------------------------------------------
2719
2720 # [\#28 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/28) `closed`: Don't give errors about CONFIG_PAGE_POISONING when using an alternative
2721
2722 #### <img src="https://avatars.githubusercontent.com/u/50278627?v=4" width="50">[madaidan](https://github.com/madaidan) opened issue at [2020-01-09 19:36](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/28):
2723
2724 Some people use `CONFIG_INIT_ON_ALLOC_DEFAULT_ON`/`CONFIG_INIT_ON_FREE_DEFAULT_ON` or linux-hardened's `CONFIG_PAGE_SANITIZE` (for LTS kernels) instead of `CONFIG_PAGE_POISONING`. People using these alternatives will get pointless errors that may confuse them.
2725
2726 It would be better if the errors were only shown when not using these.
2727
2728 #### <img src="https://avatars.githubusercontent.com/u/203012?u=939d6d3b5ff0b9e46e911d8792a40c20408574e2&v=4" width="50">[anthraxx](https://github.com/anthraxx) commented at [2020-01-09 19:38](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/28#issuecomment-572720806):
2729
2730 I would love this :P
2731
2732 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-01-10 15:26](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/28#issuecomment-573079631):
2733
2734 As I remember, all these features are different in some sense.
2735 Are you sure that they are alternative to each other?
2736
2737 #### <img src="https://avatars.githubusercontent.com/u/50278627?v=4" width="50">[madaidan](https://github.com/madaidan) commented at [2020-01-10 16:40](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/28#issuecomment-573110783):
2738
2739 As far as I know, they all have the same goal which is to overwrite memory to prevent use-after-free but they have some slight differences as `PAGE_POISONING` forces debugging bloat (as it is actually a debugging feature) which makes `init_on_{,free,alloc}` or `PAGE_SANITIZE` (which was dropped in newer linux-hardened versions for `init_on_{,free,alloc}`) better.
2740
2741 `init_on_{,free,alloc}` actually disables itself when `PAGE_POISONING` is being used to prevent conflict.
2742
2743 https://github.com/torvalds/linux/commit/6471384af2a6530696fc0203bafe4de41a23c9ef
2744
2745 > If either SLUB poisoning or page poisoning is enabled, those options take
2746 precedence over init_on_alloc and init_on_free: initialization is only
2747 applied to unpoisoned allocations.
2748
2749 Also notice that linux-hardened and ClipOS do not enable `PAGE_POISONING` but use the others instead.
2750
2751 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-01-14 10:28](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/28#issuecomment-574108331):
2752
2753 @madaidan, thanks for the details.
2754 So yes, `PAGE_POISONING` is a debugging feature.
2755 It provides less erasing than `INIT_ON_FREE_DEFAULT_ON`.
2756
2757 I joined these checks with OR giving preference to `INIT_ON_FREE_DEFAULT_ON`.
2758 Please see the linked commit.
2759
2760 #### <img src="https://avatars.githubusercontent.com/u/50278627?v=4" width="50">[madaidan](https://github.com/madaidan) commented at [2020-01-14 16:55](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/28#issuecomment-574271418):
2761
2762 Great, thanks.
2763
2764
2765 -------------------------------------------------------------------------------
2766
2767 # [\#27 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/27) `closed`: add nix build files
2768
2769 #### <img src="https://avatars.githubusercontent.com/u/96200?u=9ed15c85825694d00e996d605d728179b830c4fa&v=4" width="50">[Mic92](https://github.com/Mic92) opened issue at [2020-01-02 09:02](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/27):
2770
2771
2772
2773 #### <img src="https://avatars.githubusercontent.com/u/96200?u=9ed15c85825694d00e996d605d728179b830c4fa&v=4" width="50">[Mic92](https://github.com/Mic92) commented at [2020-01-02 10:44](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/27#issuecomment-570172617):
2774
2775 These are all possible kernel configurations:
2776 There might be duplicate since linux-latest is basically linux-5.4.
2777 I am not sure which configuration you want to include in this repository.
2778 Maybe _hardened, _latest and the default kernel.
2779
2780 [nixpkgs-linux_latest-libre-config.txt](https://github.com/a13xp0p0v/kconfig-hardened-check/files/4015570/nixpkgs-linux_latest-libre-config.txt)
2781 [nixpkgs-linux_latest_hardened-config.txt](https://github.com/a13xp0p0v/kconfig-hardened-check/files/4015571/nixpkgs-linux_latest_hardened-config.txt)
2782 [nixpkgs-linux_testing_hardened-config.txt](https://github.com/a13xp0p0v/kconfig-hardened-check/files/4015572/nixpkgs-linux_testing_hardened-config.txt)
2783 [nixpkgs-linux_hardened-config.txt](https://github.com/a13xp0p0v/kconfig-hardened-check/files/4015573/nixpkgs-linux_hardened-config.txt)
2784 [nixpkgs-linux_latest-config.txt](https://github.com/a13xp0p0v/kconfig-hardened-check/files/4015574/nixpkgs-linux_latest-config.txt)
2785 [nixpkgs-linux_testing_bcachefs-config.txt](https://github.com/a13xp0p0v/kconfig-hardened-check/files/4015575/nixpkgs-linux_testing_bcachefs-config.txt)
2786 [nixpkgs-linux_testing-config.txt](https://github.com/a13xp0p0v/kconfig-hardened-check/files/4015576/nixpkgs-linux_testing-config.txt)
2787 [nixpkgs-linux_5_4-config.txt](https://github.com/a13xp0p0v/kconfig-hardened-check/files/4015577/nixpkgs-linux_5_4-config.txt)
2788 [nixpkgs-linux_5_3-config.txt](https://github.com/a13xp0p0v/kconfig-hardened-check/files/4015578/nixpkgs-linux_5_3-config.txt)
2789 [nixpkgs-linux_4_9-config.txt](https://github.com/a13xp0p0v/kconfig-hardened-check/files/4015579/nixpkgs-linux_4_9-config.txt)
2790 [nixpkgs-linux_4_14-config.txt](https://github.com/a13xp0p0v/kconfig-hardened-check/files/4015580/nixpkgs-linux_4_14-config.txt)
2791 [nixpkgs-linux_4_4-config.txt](https://github.com/a13xp0p0v/kconfig-hardened-check/files/4015581/nixpkgs-linux_4_4-config.txt)
2792 [nixpkgs-linux_4_19-config.txt](https://github.com/a13xp0p0v/kconfig-hardened-check/files/4015582/nixpkgs-linux_4_19-config.txt)
2793 [nixpkgs-linux_mptcp_94-config.txt](https://github.com/a13xp0p0v/kconfig-hardened-check/files/4015583/nixpkgs-linux_mptcp_94-config.txt)
2794 [nixpkgs-linux_mptcp_95-config.txt](https://github.com/a13xp0p0v/kconfig-hardened-check/files/4015584/nixpkgs-linux_mptcp_95-config.txt)
2795 [nixpkgs-linux_mptcp-config.txt](https://github.com/a13xp0p0v/kconfig-hardened-check/files/4015585/nixpkgs-linux_mptcp-config.txt)
2796
2797 #### <img src="https://avatars.githubusercontent.com/u/96200?u=9ed15c85825694d00e996d605d728179b830c4fa&v=4" width="50">[Mic92](https://github.com/Mic92) commented at [2020-01-02 10:47](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/27#issuecomment-570173237):
2798
2799 This is the output for our hardened kernel:
2800 cc @joachifm (hardened maintainer)
2801
2802 ```
2803 [+] Trying to detect architecture in "kconfig/nixpkgs-linux_hardened-config.txt"...
2804 [+] Detected architecture: X86_64
2805 [+] Checking "kconfig/nixpkgs-linux_hardened-config.txt" against hardening preferences...
2806                  option name                 | desired val | decision |       reason       |   check result
2807 =========================================================================================================================
2808 CONFIG_BUG                                   |      y      |defconfig |  self_protection   |   OK
2809 CONFIG_STRICT_KERNEL_RWX                     |      y      |defconfig |  self_protection   |   OK
2810 CONFIG_STACKPROTECTOR_STRONG                 |      y      |defconfig |  self_protection   |   OK
2811 CONFIG_SLUB_DEBUG                            |      y      |defconfig |  self_protection   |   OK
2812 CONFIG_STRICT_MODULE_RWX                     |      y      |defconfig |  self_protection   |   OK
2813 CONFIG_MICROCODE                             |      y      |defconfig |  self_protection   |   OK
2814 CONFIG_RETPOLINE                             |      y      |defconfig |  self_protection   |   OK
2815 CONFIG_X86_SMAP                              |      y      |defconfig |  self_protection   |   OK
2816 CONFIG_X86_UMIP                              |      y      |defconfig |  self_protection   |   OK: CONFIG_X86_INTEL_UMIP "y"
2817 CONFIG_IOMMU_SUPPORT                         |      y      |defconfig |  self_protection   |   OK
2818 CONFIG_SYN_COOKIES                           |      y      |defconfig |  self_protection   |   OK
2819 CONFIG_PAGE_TABLE_ISOLATION                  |      y      |defconfig |  self_protection   |   OK
2820 CONFIG_RANDOMIZE_MEMORY                      |      y      |defconfig |  self_protection   |   OK
2821 CONFIG_INTEL_IOMMU                           |      y      |defconfig |  self_protection   |   OK
2822 CONFIG_AMD_IOMMU                             |      y      |defconfig |  self_protection   |   OK
2823 CONFIG_VMAP_STACK                            |      y      |defconfig |  self_protection   |   OK
2824 CONFIG_RANDOMIZE_BASE                        |      y      |defconfig |  self_protection   |   OK
2825 CONFIG_THREAD_INFO_IN_TASK                   |      y      |defconfig |  self_protection   |   OK
2826 CONFIG_BUG_ON_DATA_CORRUPTION                |      y      |   kspp   |  self_protection   |   OK
2827 CONFIG_DEBUG_WX                              |      y      |   kspp   |  self_protection   |   OK
2828 CONFIG_SCHED_STACK_END_CHECK                 |      y      |   kspp   |  self_protection   |   OK
2829 CONFIG_SLAB_FREELIST_HARDENED                |      y      |   kspp   |  self_protection   |   OK
2830 CONFIG_SLAB_FREELIST_RANDOM                  |      y      |   kspp   |  self_protection   |   OK
2831 CONFIG_SHUFFLE_PAGE_ALLOCATOR                |      y      |   kspp   |  self_protection   |   FAIL: not found
2832 CONFIG_FORTIFY_SOURCE                        |      y      |   kspp   |  self_protection   |   OK
2833 CONFIG_GCC_PLUGINS                           |      y      |   kspp   |  self_protection   |   OK
2834 CONFIG_GCC_PLUGIN_RANDSTRUCT                 |      y      |   kspp   |  self_protection   |   OK
2835 CONFIG_GCC_PLUGIN_LATENT_ENTROPY             |      y      |   kspp   |  self_protection   |   OK
2836 CONFIG_DEBUG_LIST                            |      y      |   kspp   |  self_protection   |   OK
2837 CONFIG_DEBUG_SG                              |      y      |   kspp   |  self_protection   |   OK
2838 CONFIG_DEBUG_CREDENTIALS                     |      y      |   kspp   |  self_protection   |   OK
2839 CONFIG_DEBUG_NOTIFIERS                       |      y      |   kspp   |  self_protection   |   OK
2840 CONFIG_PAGE_POISONING                        |      y      |   kspp   |  self_protection   |   OK
2841 CONFIG_HARDENED_USERCOPY                     |      y      |   kspp   |  self_protection   |   OK
2842 CONFIG_HARDENED_USERCOPY_FALLBACK            | is not set  |   kspp   |  self_protection   |   OK
2843 CONFIG_MODULE_SIG                            |      y      |   kspp   |  self_protection   |   FAIL: "is not set"
2844 CONFIG_MODULE_SIG_ALL                        |      y      |   kspp   |  self_protection   |   FAIL: not found
2845 CONFIG_MODULE_SIG_SHA512                     |      y      |   kspp   |  self_protection   |   FAIL: not found
2846 CONFIG_MODULE_SIG_FORCE                      |      y      |   kspp   |  self_protection   |   FAIL: not found
2847 CONFIG_DEFAULT_MMAP_MIN_ADDR                 |    65536    |   kspp   |  self_protection   |   OK
2848 CONFIG_REFCOUNT_FULL                         |      y      |   kspp   |  self_protection   |   OK
2849 CONFIG_INIT_STACK_ALL                        |      y      |  clipos  |  self_protection   |   OK: CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL "y"
2850 CONFIG_INIT_ON_ALLOC_DEFAULT_ON              |      y      |  clipos  |  self_protection   |   FAIL: not found
2851 CONFIG_INIT_ON_FREE_DEFAULT_ON               |      y      |  clipos  |  self_protection   |   FAIL: not found
2852 CONFIG_SECURITY_DMESG_RESTRICT               |      y      |  clipos  |  self_protection   |   FAIL: "is not set"
2853 CONFIG_DEBUG_VIRTUAL                         |      y      |  clipos  |  self_protection   |   FAIL: "is not set"
2854 CONFIG_STATIC_USERMODEHELPER                 |      y      |  clipos  |  self_protection   |   FAIL: "is not set"
2855 CONFIG_SLAB_MERGE_DEFAULT                    | is not set  |  clipos  |  self_protection   |   FAIL: "y"
2856 CONFIG_GCC_PLUGIN_RANDSTRUCT_PERFORMANCE     | is not set  |  clipos  |  self_protection   |   FAIL: "y"
2857 CONFIG_GCC_PLUGIN_STACKLEAK                  |      y      |  clipos  |  self_protection   |   FAIL: not found
2858 CONFIG_STACKLEAK_METRICS                     | is not set  |  clipos  |  self_protection   |   FAIL: CONFIG_GCC_PLUGIN_STACKLEAK is needed
2859 CONFIG_STACKLEAK_RUNTIME_DISABLE             | is not set  |  clipos  |  self_protection   |   FAIL: CONFIG_GCC_PLUGIN_STACKLEAK is needed
2860 CONFIG_RANDOM_TRUST_CPU                      | is not set  |  clipos  |  self_protection   |   OK
2861 CONFIG_INTEL_IOMMU_SVM                       |      y      |  clipos  |  self_protection   |   FAIL: "is not set"
2862 CONFIG_INTEL_IOMMU_DEFAULT_ON                |      y      |  clipos  |  self_protection   |   FAIL: "is not set"
2863 CONFIG_SLUB_DEBUG_ON                         |      y      |    my    |  self_protection   |   FAIL: "is not set"
2864 CONFIG_RESET_ATTACK_MITIGATION               |      y      |    my    |  self_protection   |   FAIL: "is not set"
2865 CONFIG_PAGE_POISONING_NO_SANITY              | is not set  |    my    |  self_protection   |   FAIL: "y"
2866 CONFIG_PAGE_POISONING_ZERO                   | is not set  |    my    |  self_protection   |   FAIL: "y"
2867 CONFIG_AMD_IOMMU_V2                          |      y      |    my    |  self_protection   |   FAIL: "m"
2868 CONFIG_SECURITY                              |      y      |defconfig |  security_policy   |   OK
2869 CONFIG_SECURITY_YAMA                         |      y      |   kspp   |  security_policy   |   OK
2870 CONFIG_SECURITY_LOADPIN                      |      y      |    my    |  security_policy   |   FAIL: "is not set"
2871 CONFIG_SECURITY_LOCKDOWN_LSM                 |      y      |    my    |  security_policy   |   FAIL: not found
2872 CONFIG_SECURITY_LOCKDOWN_LSM_EARLY           |      y      |    my    |  security_policy   |   FAIL: not found
2873 CONFIG_LOCK_DOWN_KERNEL_FORCE_CONFIDENTIALITY|      y      |    my    |  security_policy   |   FAIL: not found
2874 CONFIG_SECCOMP                               |      y      |defconfig | cut_attack_surface |   OK
2875 CONFIG_SECCOMP_FILTER                        |      y      |defconfig | cut_attack_surface |   OK
2876 CONFIG_STRICT_DEVMEM                         |      y      |defconfig | cut_attack_surface |   OK
2877 CONFIG_MODULES                               | is not set  |   kspp   | cut_attack_surface |   FAIL: "y"
2878 CONFIG_DEVMEM                                | is not set  |   kspp   | cut_attack_surface |   FAIL: "y"
2879 CONFIG_IO_STRICT_DEVMEM                      |      y      |   kspp   | cut_attack_surface |   OK
2880 CONFIG_ACPI_CUSTOM_METHOD                    | is not set  |   kspp   | cut_attack_surface |   OK
2881 CONFIG_COMPAT_BRK                            | is not set  |   kspp   | cut_attack_surface |   OK
2882 CONFIG_DEVKMEM                               | is not set  |   kspp   | cut_attack_surface |   OK
2883 CONFIG_COMPAT_VDSO                           | is not set  |   kspp   | cut_attack_surface |   OK: not found
2884 CONFIG_BINFMT_MISC                           | is not set  |   kspp   | cut_attack_surface |   FAIL: "y"
2885 CONFIG_INET_DIAG                             | is not set  |   kspp   | cut_attack_surface |   FAIL: "y"
2886 CONFIG_KEXEC                                 | is not set  |   kspp   | cut_attack_surface |   FAIL: "y"
2887 CONFIG_PROC_KCORE                            | is not set  |   kspp   | cut_attack_surface |   OK
2888 CONFIG_LEGACY_PTYS                           | is not set  |   kspp   | cut_attack_surface |   OK
2889 CONFIG_HIBERNATION                           | is not set  |   kspp   | cut_attack_surface |   FAIL: "y"
2890 CONFIG_LEGACY_VSYSCALL_NONE                  |      y      |   kspp   | cut_attack_surface |   OK
2891 CONFIG_IA32_EMULATION                        | is not set  |   kspp   | cut_attack_surface |   OK
2892 CONFIG_X86_X32                               | is not set  |   kspp   | cut_attack_surface |   OK
2893 CONFIG_MODIFY_LDT_SYSCALL                    | is not set  |   kspp   | cut_attack_surface |   FAIL: "y"
2894 CONFIG_X86_PTDUMP                            | is not set  |grsecurity| cut_attack_surface |   FAIL: "m"
2895 CONFIG_ZSMALLOC_STAT                         | is not set  |grsecurity| cut_attack_surface |   OK
2896 CONFIG_PAGE_OWNER                            | is not set  |grsecurity| cut_attack_surface |   OK
2897 CONFIG_DEBUG_KMEMLEAK                        | is not set  |grsecurity| cut_attack_surface |   OK
2898 CONFIG_BINFMT_AOUT                           | is not set  |grsecurity| cut_attack_surface |   OK: not found
2899 CONFIG_KPROBES                               | is not set  |grsecurity| cut_attack_surface |   FAIL: "y"
2900 CONFIG_UPROBES                               | is not set  |grsecurity| cut_attack_surface |   FAIL: "y"
2901 CONFIG_GENERIC_TRACER                        | is not set  |grsecurity| cut_attack_surface |   FAIL: "y"
2902 CONFIG_PROC_VMCORE                           | is not set  |grsecurity| cut_attack_surface |   OK: not found
2903 CONFIG_PROC_PAGE_MONITOR                     | is not set  |grsecurity| cut_attack_surface |   FAIL: "y"
2904 CONFIG_USELIB                                | is not set  |grsecurity| cut_attack_surface |   FAIL: "y"
2905 CONFIG_CHECKPOINT_RESTORE                    | is not set  |grsecurity| cut_attack_surface |   OK
2906 CONFIG_USERFAULTFD                           | is not set  |grsecurity| cut_attack_surface |   FAIL: "y"
2907 CONFIG_HWPOISON_INJECT                       | is not set  |grsecurity| cut_attack_surface |   OK: not found
2908 CONFIG_MEM_SOFT_DIRTY                        | is not set  |grsecurity| cut_attack_surface |   OK: not found
2909 CONFIG_DEVPORT                               | is not set  |grsecurity| cut_attack_surface |   FAIL: "y"
2910 CONFIG_DEBUG_FS                              | is not set  |grsecurity| cut_attack_surface |   FAIL: "y"
2911 CONFIG_NOTIFIER_ERROR_INJECTION              | is not set  |grsecurity| cut_attack_surface |   OK
2912 CONFIG_ACPI_TABLE_UPGRADE                    | is not set  | lockdown | cut_attack_surface |   FAIL: "y"
2913 CONFIG_ACPI_APEI_EINJ                        | is not set  | lockdown | cut_attack_surface |   OK: not found
2914 CONFIG_PROFILING                             | is not set  | lockdown | cut_attack_surface |   FAIL: "y"
2915 CONFIG_BPF_SYSCALL                           | is not set  | lockdown | cut_attack_surface |   FAIL: "y"
2916 CONFIG_MMIOTRACE_TEST                        | is not set  | lockdown | cut_attack_surface |   OK: not found
2917 CONFIG_KSM                                   | is not set  |  clipos  | cut_attack_surface |   FAIL: "y"
2918 CONFIG_KALLSYMS                              | is not set  |  clipos  | cut_attack_surface |   FAIL: "y"
2919 CONFIG_X86_VSYSCALL_EMULATION                | is not set  |  clipos  | cut_attack_surface |   FAIL: "y"
2920 CONFIG_MAGIC_SYSRQ                           | is not set  |  clipos  | cut_attack_surface |   FAIL: "y"
2921 CONFIG_KEXEC_FILE                            | is not set  |  clipos  | cut_attack_surface |   FAIL: "y"
2922 CONFIG_USER_NS                               | is not set  |  clipos  | cut_attack_surface |   FAIL: "y"
2923 CONFIG_LDISC_AUTOLOAD                        | is not set  |  clipos  | cut_attack_surface |   FAIL: "y"
2924 CONFIG_MMIOTRACE                             | is not set  |    my    | cut_attack_surface |   OK
2925 CONFIG_LIVEPATCH                             | is not set  |    my    | cut_attack_surface |   OK: not found
2926 CONFIG_IP_DCCP                               | is not set  |    my    | cut_attack_surface |   FAIL: "m"
2927 CONFIG_IP_SCTP                               | is not set  |    my    | cut_attack_surface |   FAIL: "m"
2928 CONFIG_FTRACE                                | is not set  |    my    | cut_attack_surface |   FAIL: "y"
2929 CONFIG_BPF_JIT                               | is not set  |    my    | cut_attack_surface |   FAIL: "y"
2930 CONFIG_ARCH_MMAP_RND_BITS                    |     32      |  clipos  |userspace_hardening |   FAIL: "28"
2931
2932 [+] config check is finished: 'OK' - 66 / 'FAIL' - 57
2933 ```
2934
2935 #### <img src="https://avatars.githubusercontent.com/u/96200?u=9ed15c85825694d00e996d605d728179b830c4fa&v=4" width="50">[Mic92](https://github.com/Mic92) commented at [2020-01-02 10:51](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/27#issuecomment-570174082):
2936
2937 cc @fpletz @andir @flokli @nequissimus regarding security/kernel maintenance.
2938
2939 #### <img src="https://avatars.githubusercontent.com/u/628342?u=948c2401c073b8097e8ec160019140fb6043f266&v=4" width="50">[NeQuissimus](https://github.com/NeQuissimus) commented at [2020-01-02 16:07](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/27#issuecomment-570253840):
2940
2941 There is no (official) open source grsecurity for recent kernels. But for the other options, I'd be interested in a discussion in the nixpkgs repo.
2942
2943 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-01-02 23:11](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/27#issuecomment-570392431):
2944
2945 Hello @Mic92,
2946
2947 > I am not sure which configuration you want to include in this repository.
2948 > Maybe _hardened, _latest and the default kernel.
2949
2950 I would like to have only the default and hardened config for NixOS.
2951 That's useful for a brief comparison of kernel hardening adoption by various Linux distributions.
2952 By the way, we don't have a goal to collect all the latest configs from all the distributions.
2953 @HacKurx updates them from time to time.
2954
2955 Hello @NeQuissimus,
2956
2957 > There is no (official) open source grsecurity for recent kernels. 
2958
2959 Yes.
2960 And do you mean that there is an unofficial grsecurity patch for recent kernels available in public?
2961
2962 > But for the other options, I'd be interested in a discussion in the nixpkgs repo.
2963
2964 I would be glad to join that discussion.
2965 I've accumulated some knowledge about the vanilla kernel hardening.
2966 Please see my Linux Kernel Defence Map https://github.com/a13xp0p0v/linux-kernel-defence-map.
2967 It shows the the relationships between:
2968  - Vulnerability classes,
2969  - Exploitation techniques,
2970  - Bug detection mechanisms,
2971  - Defense technologies.
2972
2973 It could be useful for making a decision about enabling kernel hardening config options.
2974
2975 @Mic92 @fpletz @andir @flokli @NeQuissimus,
2976 Does NixOS have a documentation describing the difference between its hardened and default kernels?
2977
2978 Thanks!
2979
2980 #### <img src="https://avatars.githubusercontent.com/u/628342?u=948c2401c073b8097e8ec160019140fb6043f266&v=4" width="50">[NeQuissimus](https://github.com/NeQuissimus) commented at [2020-01-03 00:29](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/27#issuecomment-570414239):
2981
2982 I was thinking of minipli but I guess those are only for 4.9.
2983
2984 I opened NixOS/nixpkgs#76850, which links to the kernel flags we set for the standard kernel builds and for the hardened one.
2985 Unfortunately I do not think there is good documentation.
2986
2987 #### <img src="https://avatars.githubusercontent.com/u/96200?u=9ed15c85825694d00e996d605d728179b830c4fa&v=4" width="50">[Mic92](https://github.com/Mic92) commented at [2020-01-03 08:37](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/27#issuecomment-570503332):
2988
2989 > Hello @Mic92,
2990
2991 > > I am not sure which configuration you want to include in this repository.
2992 > > Maybe _hardened, _latest and the default kernel.
2993
2994 > I would like to have only the default and hardened config for NixOS.
2995 > That's useful for a brief comparison of kernel hardening adoption by various Linux distributions.
2996 > By the way, we don't have a goal to collect all the latest configs from all the distributions.
2997 > @HacKurx updates them from time to time.
2998
2999 Fair enough I think the other changes that are actually part of this pull request should be still useful though.
3000
3001 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-01-10 14:12](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/27#issuecomment-573050822):
3002
3003 > Fair enough I think the other changes that are actually part of this pull request should be still useful though.
3004
3005 Hi @Mic92,
3006 Could you have a look at my comments for your PR https://github.com/a13xp0p0v/kconfig-hardened-check/pull/26 ?
3007 I need some clarifications to be able to integrate your work.
3008 Thanks!
3009
3010 #### <img src="https://avatars.githubusercontent.com/u/4661917?u=bb7aeb3c77839cea055b49b80168666b36315f3d&v=4" width="50">[theLOICofFRANCE](https://github.com/theLOICofFRANCE) commented at [2020-02-24 20:57](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/27#issuecomment-590544879):
3011
3012 Hi,
3013
3014 I haven't tested NixOS yet, is there a quick and easy way to retrieve the kernel configuration or it's only dynamically generated?
3015 I only find this but without config files:
3016 https://hydra.nixos.org/job/nixos/release-19.09/nixpkgs.linuxPackages_latest_hardened.kernel.x86_64-linux
3017
3018 Beside the point, I'm not a fan of that :
3019 https://github.com/NixOS/nixpkgs/commit/1b9bf8fa7559d1bbf030f3fe3513d25eada65a41
3020
3021 #### <img src="https://avatars.githubusercontent.com/u/96200?u=9ed15c85825694d00e996d605d728179b830c4fa&v=4" width="50">[Mic92](https://github.com/Mic92) commented at [2020-02-25 09:26](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/27#issuecomment-590768293):
3022
3023 @HacKurx It's generated by nix code. Can you explain why a RANDSTRUCT read from /dev/random is better than a checksum over the linux kernel tarball? From my understanding, once that a package is build, one could extract the seed from the build. In that way reproducible builds would give us other properties i.e. verifying a correct build.
3024
3025 #### <img src="https://avatars.githubusercontent.com/u/41977?u=ba54c9de3752a1aa05a462e38bd6e84bdc26a2bb&v=4" width="50">[joachifm](https://github.com/joachifm) commented at [2020-02-25 17:26](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/27#issuecomment-590976475):
3026
3027 @Mic92 I agree with you. I think it's fair to say that any compile-time randomization is rendered (nearly) pointless by publishing the image.  In our case, the value is likely to change whenever source/config changes, so might be considered "better" than a static seed value (whether it makes any real difference is another matter).  I think users who really care about this type of mitigation should build their own kernel with a custom seed (support for this was added in a later patch, iirc).
3028
3029 #### <img src="https://avatars.githubusercontent.com/u/4661917?u=bb7aeb3c77839cea055b49b80168666b36315f3d&v=4" width="50">[theLOICofFRANCE](https://github.com/theLOICofFRANCE) commented at [2020-02-25 21:10](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/27#issuecomment-591070826):
3030
3031 @Mic92, @joachifm,
3032 The person who recompile a kernel from your source should have another seed (not your) for more security.
3033 It seems preferable to me of change the SEED variable every time you update the nix kernel. Use a compilation based of a date or the kernel number for example.
3034
3035 #### <img src="https://avatars.githubusercontent.com/u/41977?u=ba54c9de3752a1aa05a462e38bd6e84bdc26a2bb&v=4" width="50">[joachifm](https://github.com/joachifm) commented at [2020-02-25 22:20](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/27#issuecomment-591100811):
3036
3037 @HacKurx note that `${src}` in the snippet you linked above expands to a string that contains both the checksum of the linux source tarball and the version number: it is certain to change in case of version bumps.  
3038
3039 I wouldn't mind including more information in the seed construction to further increase the likelihood that it will differ between builds, but whatever is added needs to preserve determinism (in the sense that same inputs give same output).  
3040
3041 Reproducibility is a key goal for Nix/NixPkgs and usually overrides other concerns.  In this case, I think giving users of the prebuilt image a weak(ened) variant of the mitigation while making it easy to supply a custom seed is a more than fair tradeoff, especially given that the full benefit of this type of mitigation can only be realized with a self-built package anyway.
3042
3043 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-03-27 19:45](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/27#issuecomment-605284899):
3044
3045 Hello @Mic92!
3046 I installed Nix on a Debian machine to test your scripts.
3047 Unfortunately I have to revert the commit that adds `contrib/get-nix-kconfig.py`.
3048 This script is corrupted (has unexpected symbols).
3049 It also has numerous troubles with Python 3.5.3.
3050
3051 #### <img src="https://avatars.githubusercontent.com/u/96200?u=9ed15c85825694d00e996d605d728179b830c4fa&v=4" width="50">[Mic92](https://github.com/Mic92) commented at [2020-03-27 19:52](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/27#issuecomment-605287211):
3052
3053 @a13xp0p0v just add:
3054
3055 ```
3056 #! /usr/bin/env nix-shell
3057 #! nix-shell -i python3
3058 ```
3059
3060 as a shebang. Nixpkgs has python3.6 and the script depends nix anyway.
3061 It is not corrupted but depends on python3.6 or newer.
3062
3063 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-03-27 20:27](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/27#issuecomment-605300321):
3064
3065 Thanks for prompt reply!
3066 1. I perform:
3067 ```
3068 $ nix-shell
3069 ```
3070 2. Then I change the shebang as you described and run the script:
3071 ```
3072 [nix-shell:~/kconfig-hardened-check/contrib]$ ./get-nix-kconfig.py 
3073 error: getting status of '/home/x/kconfig-hardened-check/contrib/default.nix': No such file or directory
3074 ```
3075 3. Finally this makes it work:
3076 ```
3077 [nix-shell:~/kconfig-hardened-check/contrib]$ python3 get-nix-kconfig.py 
3078 ```
3079 I got kernel configs and added hardened one to the collection: 4768e21b33fa9663114eb30c2b2c2cf9e6cf4721
3080
3081 Thanks!
3082
3083 #### <img src="https://avatars.githubusercontent.com/u/96200?u=9ed15c85825694d00e996d605d728179b830c4fa&v=4" width="50">[Mic92](https://github.com/Mic92) commented at [2020-03-28 03:18](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/27#issuecomment-605387095):
3084
3085 My mistake it should have been:
3086
3087 ```
3088 #! /usr/bin/env nix-shell
3089 #! nix-shell -i python3 -p python3
3090 ```
3091
3092
3093 -------------------------------------------------------------------------------
3094
3095 # [\#26 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/26) `closed`: enable distribution via pip/setuptools
3096
3097 #### <img src="https://avatars.githubusercontent.com/u/96200?u=9ed15c85825694d00e996d605d728179b830c4fa&v=4" width="50">[Mic92](https://github.com/Mic92) opened issue at [2020-01-02 09:01](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/26):
3098
3099
3100
3101 #### <img src="https://avatars.githubusercontent.com/u/96200?u=9ed15c85825694d00e996d605d728179b830c4fa&v=4" width="50">[Mic92](https://github.com/Mic92) commented at [2020-02-25 09:34](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/26#issuecomment-590771724):
3102
3103 > Hi Jörg,
3104 > Thanks a lot for your work.
3105 > I'm not familiar with setuptools, but it looks to me that integrating that is a good idea.
3106 > There are a few aspects that I would like to fix before merging.
3107
3108 >     1. Can we avoid creating the `kconfig_hardened_check` directory? I would rather have `bin` and `config_files`.
3109
3110
3111 No one needs a distinct module to put the python code in to avoid conflicts with other installed python packages.
3112
3113 >     2. What is the purpose of splitting the code onto `bin/kconfig_hardened_check` and `kconfig_hardened_check/__init__.py`? Is it some special python feng-shui? (I'm asking because I'm just a kernel developer)
3114
3115
3116 `bin/kconfig_hardened_check` is for people just checking out the repository and running the script without installing it. If you install it with `setuptools`,
3117 it will generate its own wrapper that will eventually load `kconfig_hardened_check/__init__.py`.
3118
3119 >     3. I would like to split setuptools integration and the code refactoring onto separate commits. Moreover, I don't understand the `List[Any]` changes.
3120
3121 `List[Any]` is a type annotation. When you use a typechecker like mypy you can typecheck your code that way.
3122
3123
3124 >     4. Are you sure that the classifiers in `setup.cfg` are correct? It looks like some of them don't fit this project.
3125
3126
3127
3128 >     5. The `package_data` in `setup.cfg` misses some files in the repository. Is it ok?
3129
3130 It should only contain files that are supposed to be installed. I am not even sure having those config files provides any benefit for a user of the tool.
3131 Let me know and I would not include them at all.
3132
3133
3134
3135 > Thanks!
3136
3137 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-03-26 13:20](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/26#issuecomment-604427052):
3138
3139 Hello @Mic92,
3140 I carefully reimplemented your proof-of-concept in a set of separate commits.
3141 Fixed mistakes in setup.cfg, added MANIFEST.in, fixed issues with global variables.
3142 Thank you very much, I learned a lot!
3143
3144
3145 -------------------------------------------------------------------------------
3146
3147 # [\#25 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/25) `closed`: Hardened Kernel Config File for Virtual Machines (VMs) ("cloud kernel")
3148
3149 #### <img src="https://avatars.githubusercontent.com/u/1985040?u=b84e7065f9f8d62fbff9ac468a0cf0757718ed77&v=4" width="50">[adrelanos](https://github.com/adrelanos) opened issue at [2019-12-28 20:35](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/25):
3150
3151 A kernel config specialized for better security inside virtual machines is in development.
3152
3153 The development preview version can be found here:
3154 https://github.com/Whonix/hardened-kernel/blob/master/usr/share/hardened-kernel/hardened-vm-kernel
3155
3156 This work is being done by @madaidan who also contributed pull requests to [linux-hardened](https://github.com/anthraxx/linux-hardened).
3157
3158 https://github.com/anthraxx/linux-hardened/pulls?utf8=%E2%9C%93&q=author%3Amadaidan
3159
3160 Discussions about the kernel config happen mostly in Whonix forums.
3161
3162 https://forums.whonix.org/t/kernel-recompilation-for-better-hardening/7598/214
3163
3164 The hardened kernel config was contributed by @madaidan to the @Whonix project but as the maintainer of Whonix I think that it is not the most suitable project to maintain a kernel config. It would be more impactful and would get more eyes on it if it was hosted here.
3165
3166 Therefore I am wondering if there is any chance you would accept a pull request for a hardened (VM) config file? Which folder would be suitable for such a config file?
3167
3168 @madaidan is also working on a hardened bare metal (i.e. non-VM) kernel config:
3169 https://github.com/Whonix/hardened-kernel/blob/master/usr/share/hardened-kernel/hardened-host-kernel
3170
3171 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-01-02 23:27](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/25#issuecomment-570397241):
3172
3173 Hello @adrelanos,
3174 I guess Whonix has a default and hardened config, am I right?
3175 Is the difference between them documented anywhere?
3176 We can take Whonix official configs to the `config_files/distros/`.
3177 That's useful for a brief comparison of kernel hardening adoption by various Linux distributions.
3178 There is also the `config_files/links.txt` file that describes how to get official configs from various distros.
3179 Thanks!
3180
3181 #### <img src="https://avatars.githubusercontent.com/u/50278627?v=4" width="50">[madaidan](https://github.com/madaidan) commented at [2020-01-05 17:22](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/25#issuecomment-570930694):
3182
3183 The current Whonix default is the Debian default. It will be changed to the config mentioned in the post once it's finished.
3184
3185 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2020-01-10 15:20](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/25#issuecomment-573077384):
3186
3187 Ok.
3188 So when it is finished, you are welcome to send me the pull request that
3189  - adds the official Whonix hardened config to `config_files/distros/`;
3190  - adds the corresponding info to `config_files/links.txt`.
3191
3192 #### <img src="https://avatars.githubusercontent.com/u/42802201?v=4" width="50">[tsautereau-anssi](https://github.com/tsautereau-anssi) commented at [2020-01-13 15:59](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/25#issuecomment-573735007):
3193
3194 @madaidan After reading your [post](https://github.com/anthraxx/linux-hardened/issues/21) on the linux-hardened repository, it seems you might be interested in contributing some of your changes to the [CLIP OS kernel](https://github.com/clipos/src_external_linux/) (see our current configuration [here](https://github.com/clipos/src_platform_config-linux-hardware/tree/master/kernel_config)). If so, don't hesitate to [open an issue](https://github.com/clipos/bugs), it would be much appreciated!
3195
3196 Thanks @msalaun-anssi for the heads-up ;)
3197
3198 #### <img src="https://avatars.githubusercontent.com/u/1985040?u=b84e7065f9f8d62fbff9ac468a0cf0757718ed77&v=4" width="50">[adrelanos](https://github.com/adrelanos) commented at [2020-01-13 16:25](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/25#issuecomment-573747860):
3199
3200 Created https://github.com/clipos/bugs/issues/38 for it.
3201
3202 #### <img src="https://avatars.githubusercontent.com/u/50278627?v=4" width="50">[madaidan](https://github.com/madaidan) commented at [2020-01-13 18:15](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/25#issuecomment-573797636):
3203
3204 > @madaidan After reading your post on the linux-hardened repository, it seems you might be interested in contributing some of your changes to the CLIP OS kernel (see our current configuration here). If so, don't hesitate to open an issue, it would be much appreciated!
3205
3206 Sounds great. I'll see what I can do.
3207
3208
3209 -------------------------------------------------------------------------------
3210
3211 # [\#24 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/24) `closed`: Create debian-buster.config
3212
3213 #### <img src="https://avatars.githubusercontent.com/u/89727?v=4" width="50">[alexandernst](https://github.com/alexandernst) opened issue at [2019-08-27 23:19](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/24):
3214
3215 ```
3216 [+] Trying to detect architecture in "../linux-source-4.19/.config"...
3217 [+] Detected architecture: X86_64
3218 [+] Checking "../linux-source-4.19/.config" against hardening preferences...
3219               option name               | desired val | decision |       reason       ||        check result
3220 ====================================================================================================================
3221 CONFIG_BUG                              |      y      |defconfig |  self_protection   ||             OK
3222 CONFIG_STRICT_KERNEL_RWX                |      y      |defconfig |  self_protection   ||             OK
3223 CONFIG_STACKPROTECTOR_STRONG            |      y      |defconfig |  self_protection   ||             OK
3224 CONFIG_SLUB_DEBUG                       |      y      |defconfig |  self_protection   ||             OK
3225 CONFIG_STRICT_MODULE_RWX                |      y      |defconfig |  self_protection   ||             OK
3226 CONFIG_PAGE_TABLE_ISOLATION             |      y      |defconfig |  self_protection   ||             OK
3227 CONFIG_RANDOMIZE_MEMORY                 |      y      |defconfig |  self_protection   ||             OK
3228 CONFIG_RANDOMIZE_BASE                   |      y      |defconfig |  self_protection   ||             OK
3229 CONFIG_RETPOLINE                        |      y      |defconfig |  self_protection   ||             OK
3230 CONFIG_X86_SMAP                         |      y      |defconfig |  self_protection   ||             OK
3231 CONFIG_X86_INTEL_UMIP                   |      y      |defconfig |  self_protection   ||             OK
3232 CONFIG_SYN_COOKIES                      |      y      |defconfig |  self_protection   ||             OK
3233 CONFIG_VMAP_STACK                       |      y      |defconfig |  self_protection   ||             OK
3234 CONFIG_THREAD_INFO_IN_TASK              |      y      |defconfig |  self_protection   ||             OK
3235 CONFIG_BUG_ON_DATA_CORRUPTION           |      y      |   kspp   |  self_protection   ||             OK
3236 CONFIG_DEBUG_WX                         |      y      |   kspp   |  self_protection   ||             OK
3237 CONFIG_SCHED_STACK_END_CHECK            |      y      |   kspp   |  self_protection   ||             OK
3238 CONFIG_SLAB_FREELIST_HARDENED           |      y      |   kspp   |  self_protection   ||             OK
3239 CONFIG_SLAB_FREELIST_RANDOM             |      y      |   kspp   |  self_protection   ||             OK
3240 CONFIG_SHUFFLE_PAGE_ALLOCATOR           |      y      |   kspp   |  self_protection   ||      FAIL: not found
3241 CONFIG_FORTIFY_SOURCE                   |      y      |   kspp   |  self_protection   ||             OK
3242 CONFIG_GCC_PLUGINS                      |      y      |   kspp   |  self_protection   ||      FAIL: not found
3243 CONFIG_GCC_PLUGIN_RANDSTRUCT            |      y      |   kspp   |  self_protection   ||      FAIL: not found
3244 CONFIG_GCC_PLUGIN_LATENT_ENTROPY        |      y      |   kspp   |  self_protection   ||      FAIL: not found
3245 CONFIG_DEBUG_LIST                       |      y      |   kspp   |  self_protection   ||             OK
3246 CONFIG_DEBUG_SG                         |      y      |   kspp   |  self_protection   ||     FAIL: "is not set"
3247 CONFIG_DEBUG_CREDENTIALS                |      y      |   kspp   |  self_protection   ||     FAIL: "is not set"
3248 CONFIG_DEBUG_NOTIFIERS                  |      y      |   kspp   |  self_protection   ||     FAIL: "is not set"
3249 CONFIG_PAGE_POISONING                   |      y      |   kspp   |  self_protection   ||             OK
3250 CONFIG_HARDENED_USERCOPY                |      y      |   kspp   |  self_protection   ||             OK
3251 CONFIG_HARDENED_USERCOPY_FALLBACK       | is not set  |   kspp   |  self_protection   ||             OK
3252 CONFIG_MODULE_SIG                       |      y      |   kspp   |  self_protection   ||     FAIL: "is not set"
3253 CONFIG_MODULE_SIG_ALL                   |      y      |   kspp   |  self_protection   ||      FAIL: not found
3254 CONFIG_MODULE_SIG_SHA512                |      y      |   kspp   |  self_protection   ||      FAIL: not found
3255 CONFIG_MODULE_SIG_FORCE                 |      y      |   kspp   |  self_protection   ||      FAIL: not found
3256 CONFIG_DEFAULT_MMAP_MIN_ADDR            |    65536    |   kspp   |  self_protection   ||             OK
3257 CONFIG_REFCOUNT_FULL                    |      y      |   kspp   |  self_protection   ||             OK
3258 CONFIG_LOCK_DOWN_KERNEL                 |      y      |  clipos  |  self_protection   ||             OK
3259 CONFIG_SECURITY_DMESG_RESTRICT          |      y      |  clipos  |  self_protection   ||             OK
3260 CONFIG_DEBUG_VIRTUAL                    |      y      |  clipos  |  self_protection   ||     FAIL: "is not set"
3261 CONFIG_STATIC_USERMODEHELPER            |      y      |  clipos  |  self_protection   ||     FAIL: "is not set"
3262 CONFIG_SLAB_MERGE_DEFAULT               | is not set  |  clipos  |  self_protection   ||         FAIL: "y"
3263 CONFIG_GCC_PLUGIN_RANDSTRUCT_PERFORMANCE| is not set  |  clipos  |  self_protection   ||FAIL: CONFIG_GCC_PLUGIN_RANDSTRUCT is needed
3264 CONFIG_GCC_PLUGIN_STACKLEAK             |      y      |  clipos  |  self_protection   ||      FAIL: not found
3265 CONFIG_STACKLEAK_METRICS                | is not set  |  clipos  |  self_protection   ||FAIL: CONFIG_GCC_PLUGIN_STACKLEAK is needed
3266 CONFIG_STACKLEAK_RUNTIME_DISABLE        | is not set  |  clipos  |  self_protection   ||FAIL: CONFIG_GCC_PLUGIN_STACKLEAK is needed
3267 CONFIG_RANDOM_TRUST_CPU                 | is not set  |  clipos  |  self_protection   ||         FAIL: "y"
3268 CONFIG_MICROCODE                        |      y      |  clipos  |  self_protection   ||             OK
3269 CONFIG_IOMMU_SUPPORT                    |      y      |  clipos  |  self_protection   ||             OK
3270 CONFIG_INTEL_IOMMU                      |      y      |  clipos  |  self_protection   ||             OK
3271 CONFIG_INTEL_IOMMU_SVM                  |      y      |  clipos  |  self_protection   ||             OK
3272 CONFIG_INTEL_IOMMU_DEFAULT_ON           |      y      |  clipos  |  self_protection   ||     FAIL: "is not set"
3273 CONFIG_INIT_STACK_ALL                   |      y      |    my    |  self_protection   ||      FAIL: not found
3274 CONFIG_SLUB_DEBUG_ON                    |      y      |    my    |  self_protection   ||     FAIL: "is not set"
3275 CONFIG_SECURITY_LOADPIN                 |      y      |    my    |  self_protection   ||     FAIL: "is not set"
3276 CONFIG_RESET_ATTACK_MITIGATION          |      y      |    my    |  self_protection   ||     FAIL: "is not set"
3277 CONFIG_PAGE_POISONING_NO_SANITY         | is not set  |    my    |  self_protection   ||         FAIL: "y"
3278 CONFIG_PAGE_POISONING_ZERO              | is not set  |    my    |  self_protection   ||             OK
3279 CONFIG_AMD_IOMMU                        |      y      |    my    |  self_protection   ||             OK
3280 CONFIG_AMD_IOMMU_V2                     |      y      |    my    |  self_protection   ||             OK
3281 CONFIG_SECURITY                         |      y      |defconfig |  security_policy   ||             OK
3282 CONFIG_SECURITY_YAMA                    |      y      |   kspp   |  security_policy   ||             OK
3283 CONFIG_SECCOMP                          |      y      |defconfig | cut_attack_surface ||             OK
3284 CONFIG_SECCOMP_FILTER                   |      y      |defconfig | cut_attack_surface ||             OK
3285 CONFIG_STRICT_DEVMEM                    |      y      |defconfig | cut_attack_surface ||             OK
3286 CONFIG_MODULES                          | is not set  |   kspp   | cut_attack_surface ||         FAIL: "y"
3287 CONFIG_DEVMEM                           | is not set  |   kspp   | cut_attack_surface ||         FAIL: "y"
3288 CONFIG_IO_STRICT_DEVMEM                 |      y      |   kspp   | cut_attack_surface ||             OK
3289 CONFIG_ACPI_CUSTOM_METHOD               | is not set  |   kspp   | cut_attack_surface ||             OK
3290 CONFIG_COMPAT_BRK                       | is not set  |   kspp   | cut_attack_surface ||             OK
3291 CONFIG_DEVKMEM                          | is not set  |   kspp   | cut_attack_surface ||             OK
3292 CONFIG_COMPAT_VDSO                      | is not set  |   kspp   | cut_attack_surface ||             OK
3293 CONFIG_BINFMT_MISC                      | is not set  |   kspp   | cut_attack_surface ||             OK
3294 CONFIG_INET_DIAG                        | is not set  |   kspp   | cut_attack_surface ||             OK
3295 CONFIG_KEXEC                            | is not set  |   kspp   | cut_attack_surface ||         FAIL: "y"
3296 CONFIG_PROC_KCORE                       | is not set  |   kspp   | cut_attack_surface ||         FAIL: "y"
3297 CONFIG_LEGACY_PTYS                      | is not set  |   kspp   | cut_attack_surface ||             OK
3298 CONFIG_HIBERNATION                      | is not set  |   kspp   | cut_attack_surface ||         FAIL: "y"
3299 CONFIG_LEGACY_VSYSCALL_NONE             |      y      |   kspp   | cut_attack_surface ||             OK
3300 CONFIG_IA32_EMULATION                   | is not set  |   kspp   | cut_attack_surface ||         FAIL: "y"
3301 CONFIG_X86_X32                          | is not set  |   kspp   | cut_attack_surface ||         FAIL: "y"
3302 CONFIG_MODIFY_LDT_SYSCALL               | is not set  |   kspp   | cut_attack_surface ||         FAIL: "y"
3303 CONFIG_X86_PTDUMP                       | is not set  |grsecurity| cut_attack_surface ||             OK
3304 CONFIG_ZSMALLOC_STAT                    | is not set  |grsecurity| cut_attack_surface ||       OK: not found
3305 CONFIG_PAGE_OWNER                       | is not set  |grsecurity| cut_attack_surface ||             OK
3306 CONFIG_DEBUG_KMEMLEAK                   | is not set  |grsecurity| cut_attack_surface ||             OK
3307 CONFIG_BINFMT_AOUT                      | is not set  |grsecurity| cut_attack_surface ||       OK: not found
3308 CONFIG_KPROBES                          | is not set  |grsecurity| cut_attack_surface ||         FAIL: "y"
3309 CONFIG_UPROBES                          | is not set  |grsecurity| cut_attack_surface ||         FAIL: "y"
3310 CONFIG_GENERIC_TRACER                   | is not set  |grsecurity| cut_attack_surface ||         FAIL: "y"
3311 CONFIG_PROC_VMCORE                      | is not set  |grsecurity| cut_attack_surface ||         FAIL: "y"
3312 CONFIG_PROC_PAGE_MONITOR                | is not set  |grsecurity| cut_attack_surface ||         FAIL: "y"
3313 CONFIG_USELIB                           | is not set  |grsecurity| cut_attack_surface ||         FAIL: "y"
3314 CONFIG_CHECKPOINT_RESTORE               | is not set  |grsecurity| cut_attack_surface ||         FAIL: "y"
3315 CONFIG_USERFAULTFD                      | is not set  |grsecurity| cut_attack_surface ||         FAIL: "y"
3316 CONFIG_HWPOISON_INJECT                  | is not set  |grsecurity| cut_attack_surface ||             OK
3317 CONFIG_MEM_SOFT_DIRTY                   | is not set  |grsecurity| cut_attack_surface ||         FAIL: "y"
3318 CONFIG_DEVPORT                          | is not set  |grsecurity| cut_attack_surface ||         FAIL: "y"
3319 CONFIG_DEBUG_FS                         | is not set  |grsecurity| cut_attack_surface ||         FAIL: "y"
3320 CONFIG_NOTIFIER_ERROR_INJECTION         | is not set  |grsecurity| cut_attack_surface ||             OK
3321 CONFIG_ACPI_TABLE_UPGRADE               | is not set  | lockdown | cut_attack_surface ||         FAIL: "y"
3322 CONFIG_ACPI_APEI_EINJ                   | is not set  | lockdown | cut_attack_surface ||             OK
3323 CONFIG_PROFILING                        | is not set  | lockdown | cut_attack_surface ||         FAIL: "y"
3324 CONFIG_BPF_SYSCALL                      | is not set  | lockdown | cut_attack_surface ||         FAIL: "y"
3325 CONFIG_MMIOTRACE_TEST                   | is not set  | lockdown | cut_attack_surface ||             OK
3326 CONFIG_KSM                              | is not set  |  clipos  | cut_attack_surface ||         FAIL: "y"
3327 CONFIG_IKCONFIG                         | is not set  |  clipos  | cut_attack_surface ||         FAIL: "m"
3328 CONFIG_KALLSYMS                         | is not set  |  clipos  | cut_attack_surface ||         FAIL: "y"
3329 CONFIG_X86_VSYSCALL_EMULATION           | is not set  |  clipos  | cut_attack_surface ||         FAIL: "y"
3330 CONFIG_MAGIC_SYSRQ                      | is not set  |  clipos  | cut_attack_surface ||         FAIL: "y"
3331 CONFIG_KEXEC_FILE                       | is not set  |  clipos  | cut_attack_surface ||         FAIL: "y"
3332 CONFIG_USER_NS                          | is not set  |  clipos  | cut_attack_surface ||         FAIL: "y"
3333 CONFIG_LDISC_AUTOLOAD                   | is not set  |  clipos  | cut_attack_surface ||         FAIL: "y"
3334 CONFIG_MMIOTRACE                        | is not set  |    my    | cut_attack_surface ||         FAIL: "y"
3335 CONFIG_LIVEPATCH                        | is not set  |    my    | cut_attack_surface ||         FAIL: "y"
3336 CONFIG_IP_DCCP                          | is not set  |    my    | cut_attack_surface ||             OK
3337 CONFIG_IP_SCTP                          | is not set  |    my    | cut_attack_surface ||             OK
3338 CONFIG_FTRACE                           | is not set  |    my    | cut_attack_surface ||         FAIL: "y"
3339 CONFIG_BPF_JIT                          | is not set  |    my    | cut_attack_surface ||         FAIL: "y"
3340 CONFIG_ARCH_MMAP_RND_BITS               |     32      |  clipos  |userspace_protection||         FAIL: "28"
3341
3342 [+] config check is finished: 'OK' - 60 / 'FAIL' - 60
3343 ```
3344
3345 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-08-30 12:40](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/24#issuecomment-526586258):
3346
3347 Hello @alexandernst,
3348
3349 Thanks for your PR.
3350
3351 I decided to compare the your config with one available here:
3352 https://packages.debian.org/buster/linux-image-4.19.0-5-amd64
3353
3354 They differ a lot.
3355 Where did you get your config?
3356
3357 Best regards,
3358 Alexander
3359
3360 #### <img src="https://avatars.githubusercontent.com/u/89727?v=4" width="50">[alexandernst](https://github.com/alexandernst) commented at [2019-08-30 12:56](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/24#issuecomment-526591340):
3361
3362 The config file was generated using the instructions in https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.html#s-common-building
3363
3364 ```
3365 apt install -y linux-source fakeroot libelf-dev libssl-dev
3366 tar xaf /usr/src/linux-source-4.19.tar.xz
3367 cd linux-source-4.19/
3368 yes "" | make localmodconfig
3369 scripts/config --disable MODULE_SIG
3370 ```
3371
3372 #### <img src="https://avatars.githubusercontent.com/u/89727?v=4" width="50">[alexandernst](https://github.com/alexandernst) commented at [2019-08-30 12:58](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/24#issuecomment-526591989):
3373
3374 Oh, this was built using an AWS EC2 instance, so that might be causing the differences between a vainilla debian config and my config.
3375
3376 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-08-30 13:07](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/24#issuecomment-526595179):
3377
3378 Right, let me quote the kernel documentation:
3379 ```
3380 "make localmodconfig" Create a config based on current config and loaded modules (lsmod).
3381 ```
3382 https://www.kernel.org/doc/html/latest/admin-guide/README.html?highlight=localmodconfig
3383
3384 Would you like to fix your PR?
3385 If so I would also ask to add info to `config_files/links.txt`.
3386
3387 Thanks!
3388
3389 #### <img src="https://avatars.githubusercontent.com/u/89727?v=4" width="50">[alexandernst](https://github.com/alexandernst) commented at [2019-08-30 13:38](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/24#issuecomment-526605210):
3390
3391 I'm not really sure if by "fix" you mean rename the file to something like `debian-buster-aws.config` or by replace the config with the one from https://packages.debian.org/buster/linux-image-4.19.0-5-amd64 ?
3392
3393 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-08-30 13:44](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/24#issuecomment-526607017):
3394
3395 I think adding an original Debian config would be more useful for everyone.
3396 Also it would be nice if you find a direct link to this config and add it to `links.txt`.
3397
3398 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-11-28 07:36](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/24#issuecomment-559376496):
3399
3400 Closing the PR (I've finally did it myself: ad80700, 4f9c653).
3401 Thanks.
3402
3403
3404 -------------------------------------------------------------------------------
3405
3406 # [\#23 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/23) `closed`: LOCK_DOWN_KERNEL 
3407
3408 #### <img src="https://avatars.githubusercontent.com/u/11277437?v=4" width="50">[bokobok](https://github.com/bokobok) opened issue at [2019-07-22 12:05](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/23):
3409
3410 Hello,
3411
3412 Thank you for this awesome project!
3413
3414 It seems that "LOCK_DOWN_KERNEL" / "LOCK_DOWN MANDATORY" enable other flags.
3415
3416 - No unsigned modules and no modules for which can't validate the signature.
3417 - No use of ioperm(), iopl() and no writing to /dev/port.
3418 - No writing to /dev/mem or /dev/kmem.
3419 - No hibernation.
3420 - Restrict PCI BAR access.
3421 - Restrict MSR access.
3422 - No kexec_load().
3423 - Certain ACPI restrictions.
3424 - Restrict debugfs interface to ASUS WMI.
3425
3426 http://lkml.iu.edu/hypermail/linux/kernel/1704.0/02933.html 
3427
3428 Is it possible to reflect this in the script?
3429
3430 #### <img src="https://avatars.githubusercontent.com/u/67428?u=cc677701e49dca0be4cdc6ea10bc60b52a181e4e&v=4" width="50">[jelly](https://github.com/jelly) commented at [2019-07-22 12:18](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/23#issuecomment-513767366):
3431
3432 The kernel lockdown patch has not been merged yet and I'm not sure if it's possible to enable these hardening functionality without the patch.
3433
3434 Also the linked patch is out of a date, there is a newer revision implemented as LSM https://lore.kernel.org/linux-security-module/20190404003249.14356-1-matthewgarrett@google.com/T/#m50dd383459d65d52d80c90f36af860a7c10f364c
3435
3436 #### <img src="https://avatars.githubusercontent.com/u/11277437?v=4" width="50">[bokobok](https://github.com/bokobok) commented at [2019-07-22 12:27](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/23#issuecomment-513770393):
3437
3438 Ok, I'm new to this and didn't know that.
3439 Thanks
3440
3441 #### <img src="https://avatars.githubusercontent.com/u/32568352?v=4" width="50">[Bernhard40](https://github.com/Bernhard40) commented at [2019-07-23 12:15](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/23#issuecomment-514184160):
3442
3443 Some distros like Fedora or Ubuntu are using lockdown kernel patches for a long time.
3444
3445 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-08-12 08:27](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/23#issuecomment-520338183):
3446
3447 Hello everyone!
3448
3449 @bokobok, some time ago I looked through the lockdown patchset in Ubuntu kernel tree.
3450 I marked the kernel options enforced by lockdown with a special comment in the script:
3451 ```
3452 # refers to LOCK_DOWN_KERNEL
3453 ```
3454 For more details please see https://github.com/a13xp0p0v/kconfig-hardened-check/commit/796a22935ab5cd3ddcf19c4ea85411d9bf04fef6
3455
3456 When the lockdown patchset is finally merged, I will look through the commits once again and update the script.
3457
3458 @jelly @Bernhard40, thanks for your commentary.
3459
3460 #### <img src="https://avatars.githubusercontent.com/u/67428?u=cc677701e49dca0be4cdc6ea10bc60b52a181e4e&v=4" width="50">[jelly](https://github.com/jelly) commented at [2019-08-12 18:27](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/23#issuecomment-520540892):
3461
3462 It's getting close to mainline http://kernsec.org/pipermail/linux-security-module-archive/2019-August/015795.html
3463
3464
3465 -------------------------------------------------------------------------------
3466
3467 # [\#22 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/22) `merged`: #20 fix: use right quotes in json output
3468
3469 #### <img src="https://avatars.githubusercontent.com/u/4029800?u=86702d3f2d50ee01ef1c572ef26b1ea1318f28da&v=4" width="50">[adrianopol](https://github.com/adrianopol) opened issue at [2019-07-07 19:27](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/22):
3470
3471 #20: fix quotes for --json
3472
3473
3474
3475
3476 -------------------------------------------------------------------------------
3477
3478 # [\#21 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/21) `merged`: add --json option
3479
3480 #### <img src="https://avatars.githubusercontent.com/u/4029800?u=86702d3f2d50ee01ef1c572ef26b1ea1318f28da&v=4" width="50">[adrianopol](https://github.com/adrianopol) opened issue at [2019-06-21 19:57](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/21):
3481
3482 With `--json` output will be formatted as array of arrays:
3483
3484 `[['CONFIG_BUG', 'y', 'defconfig', 'self_protection', 'OK'], ['CONFIG_STRICT_KERNEL_RWX', 'y', 'defconfig', 'self_protection', 'OK'], ...`
3485
3486 #### <img src="https://avatars.githubusercontent.com/u/4029800?u=86702d3f2d50ee01ef1c572ef26b1ea1318f28da&v=4" width="50">[adrianopol](https://github.com/adrianopol) commented at [2019-06-24 09:24](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/21#issuecomment-504931635):
3487
3488 Fixed.
3489
3490 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-06-24 11:11](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/21#issuecomment-504965369):
3491
3492 Thank you!
3493 Merged.
3494
3495
3496 -------------------------------------------------------------------------------
3497
3498 # [\#20 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/20) `closed`: JSON output
3499
3500 #### <img src="https://avatars.githubusercontent.com/u/964610?u=f244bab6b14967638a88cef92752379e64b15996&v=4" width="50">[Wenzel](https://github.com/Wenzel) opened issue at [2019-06-10 14:11](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/20):
3501
3502 Hi,
3503
3504 I would like to integrate your project into a Python script which would check the security settings automatically and provide a report.
3505
3506 Would it be possible to have an easily parsable JSON output ?
3507 Otherwise processing with your data will be very difficult, if you are not human.
3508
3509 Thanks !
3510
3511 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-06-11 10:03](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/20#issuecomment-500775436):
3512
3513 Hello @Wenzel 
3514
3515 > I would like tot integrate your project into a Python script which would check the security settings automatically and provide a report.
3516
3517 Nice!
3518
3519 > Would it be possible to have an easily parsable JSON output ?
3520 Otherwise processing with your data will be very difficult, if you are not human.
3521
3522 It sounds reasonable. I'll have a look in my free time.
3523 If you already know how to implement it, the pull request is welcome!
3524
3525 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-06-24 11:12](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/20#issuecomment-504965591):
3526
3527 Hello @Wenzel and @nettrino,
3528
3529 @adrianopol has added the JSON output feature (#21), please check the `--json` argument.
3530
3531 #### <img src="https://avatars.githubusercontent.com/u/964610?u=f244bab6b14967638a88cef92752379e64b15996&v=4" width="50">[Wenzel](https://github.com/Wenzel) commented at [2019-07-07 12:51](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/20#issuecomment-508997348):
3532
3533 Hi @a13xp0p0v , @adrianopol ,
3534
3535 I would like to reopen this issue because I just tested the `--json` flag, and the output produced is not valid JSON.
3536
3537 `piping in jq`
3538 ![Screenshot_20190707_144843](https://user-images.githubusercontent.com/964610/60768633-84977d00-a0c6-11e9-978a-ebbb65e9ed11.png)
3539
3540
3541 Output example for `./kconfig-hardened-check.py -c /boot/config-5.1.12-300.fc30.x86_64 --json`
3542 ~~~
3543 [['CONFIG_BUG', 'y', 'defconfig', 'self_protection', 'OK'], ['CONFIG_STRICT_KERNEL_RWX', 'y', 'defconfig', 'self_protection', 'OK'], ['CONFIG_STACKPROTECTOR_STRONG', 'y', 'defconfig', 'self_protection', 'OK'], ['CONFIG_SLUB_DEBUG', 'y', 'defconfig', 'self_protection', 'OK'], ['CONFIG_STRICT_MODULE_RWX', 'y', 'defconfig', 'self_protection', 'OK'], ['CONFIG_PAGE_TABLE_ISOLATION', 'y', 'defconfig', 'self_protection', 'OK'], ['CONFIG_RANDOMIZE_MEMORY', 'y', 'defconfig', 'self_protection', 'OK'], ['CONFIG_RANDOMIZE_BASE', 'y', 'defconfig', 'self_protection', 'OK'], ['CONFIG_RETPOLINE', 'y', 'defconfig', 'self_protection', 'OK'], ['CONFIG_X86_SMAP', 'y', 'defconfig', 'self_protection', 'OK'], ['CONFIG_X86_INTEL_UMIP', 'y', 'defconfig', 'self_protection', 'OK'], ['CONFIG_SYN_COOKIES', 'y', 'defconfig', 'self_protection', 'OK'], ['CONFIG_VMAP_STACK', 'y', 'defconfig', 'self_protection', 'OK'], ['CONFIG_THREAD_INFO_IN_TASK', 'y', 'defconfig', 'self_protection', 'OK'], ['CONFIG_BUG_ON_DATA_CORRUPTION', 'y', 'kspp', 'self_protection', 'OK'], ['CONFIG_DEBUG_WX', 'y', 'kspp', 'self_protection', 'OK'], ['CONFIG_SCHED_STACK_END_CHECK', 'y', 'kspp', 'self_protection', 'FAIL: "is not set"'], ['CONFIG_SLAB_FREELIST_HARDENED', 'y', 'kspp', 'self_protection', 'OK'], ['CONFIG_SLAB_FREELIST_RANDOM', 'y', 'kspp', 'self_protection', 'OK'], ['CONFIG_FORTIFY_SOURCE', 'y', 'kspp', 'self_protection', 'OK'], ['CONFIG_GCC_PLUGINS', 'y', 'kspp', 'self_protection', 'FAIL: not found'], ['CONFIG_GCC_PLUGIN_RANDSTRUCT', 'y', 'kspp', 'self_protection', 'FAIL: not found'], ['CONFIG_GCC_PLUGIN_STRUCTLEAK', 'y', 'kspp', 'self_protection', 'FAIL: not found'], ['CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL', 'y', 'kspp', 'self_protection', 'FAIL: not found'], ['CONFIG_GCC_PLUGIN_LATENT_ENTROPY', 'y', 'kspp', 'self_protection', 'FAIL: not found'], ['CONFIG_DEBUG_LIST', 'y', 'kspp', 'self_protection', 'OK'], ['CONFIG_DEBUG_SG', 'y', 'kspp', 'self_protection', 'FAIL: "is not set"'], ['CONFIG_DEBUG_CREDENTIALS', 'y', 'kspp', 'self_protection', 'FAIL: "is not set"'], ['CONFIG_DEBUG_NOTIFIERS', 'y', 'kspp', 'self_protection', 'FAIL: "is not set"'], ['CONFIG_PAGE_POISONING', 'y', 'kspp', 'self_protection', 'FAIL: "is not set"'], ['CONFIG_HARDENED_USERCOPY', 'y', 'kspp', 'self_protection', 'OK'], ['CONFIG_HARDENED_USERCOPY_FALLBACK', 'is not set', 'kspp', 'self_protection', 'FAIL: "y"'], ['CONFIG_MODULE_SIG', 'y', 'kspp', 'self_protection', 'OK'], ['CONFIG_MODULE_SIG_ALL', 'y', 'kspp', 'self_protection', 'OK'], ['CONFIG_MODULE_SIG_SHA512', 'y', 'kspp', 'self_protection', 'FAIL: "is not set"'], ['CONFIG_MODULE_SIG_FORCE', 'y', 'kspp', 'self_protection', 'FAIL: "is not set"'], ['CONFIG_DEFAULT_MMAP_MIN_ADDR', '65536', 'kspp', 'self_protection', 'OK'], ['CONFIG_REFCOUNT_FULL', 'y', 'kspp', 'self_protection', 'FAIL: "is not set"'], ['CONFIG_LOCK_DOWN_KERNEL', 'y', 'clipos', 'self_protection', 'OK'], ['CONFIG_SECURITY_DMESG_RESTRICT', 'y', 'clipos', 'self_protection', 'FAIL: "is not set"'], ['CONFIG_DEBUG_VIRTUAL', 'y', 'clipos', 'self_protection', 'FAIL: "is not set"'], ['CONFIG_STATIC_USERMODEHELPER', 'y', 'clipos', 'self_protection', 'FAIL: "is not set"'], ['CONFIG_SLAB_MERGE_DEFAULT', 'is not set', 'clipos', 'self_protection', 'FAIL: "y"'], ['CONFIG_GCC_PLUGIN_RANDSTRUCT_PERFORMANCE', 'is not set', 'clipos', 'self_protection', 'FAIL: CONFIG_GCC_PLUGIN_RANDSTRUCT is needed'], ['CONFIG_GCC_PLUGIN_STACKLEAK', 'y', 'clipos', 'self_protection', 'FAIL: not found'], ['CONFIG_STACKLEAK_METRICS', 'is not set', 'clipos', 'self_protection', 'FAIL: CONFIG_GCC_PLUGIN_STACKLEAK is needed'], ['CONFIG_STACKLEAK_RUNTIME_DISABLE', 'is not set', 'clipos', 'self_protection', 'FAIL: CONFIG_GCC_PLUGIN_STACKLEAK is needed'], ['CONFIG_RANDOM_TRUST_CPU', 'is not set', 'clipos', 'self_protection', 'FAIL: "y"'], ['CONFIG_MICROCODE', 'y', 'clipos', 'self_protection', 'OK'], ['CONFIG_IOMMU_SUPPORT', 'y', 'clipos', 'self_protection', 'OK'], ['CONFIG_INTEL_IOMMU', 'y', 'clipos', 'self_protection', 'OK'], ['CONFIG_INTEL_IOMMU_SVM', 'y', 'clipos', 'self_protection', 'OK'], ['CONFIG_INTEL_IOMMU_DEFAULT_ON', '
3544 y', 'clipos', 'self_protection', 'FAIL: "is not set"'], ['CONFIG_AMD_IOMMU', 'y', 'my', 'self_protection', 'OK'], ['CONFIG_AMD_IOMMU_V2', 'y', 'my', 'self_protection', 'FAIL: "m"'], ['CONFIG_SLUB_DEBUG_ON', 'y', 'my', 'self_protection', 'FAIL: "is not set"'], ['CONFIG_SECURITY_LOADPIN', 'y', 'my', 'self_protection', 'FAIL: "is not set"'], ['CONFIG_RESET_ATTACK_MITIGATION', 'y', 'my', 'self_protection', 'FAIL: "is not set"'], ['CONFIG_PAGE_POISONING_NO_SANITY', 'is not set', 'my', 'self_protection', 'FAIL: CONFIG_PAGE_POISONING is needed'], ['CONFIG_PAGE_POISONING_ZERO', 'is not set', 'my', 'self_protection', 'FAIL: CONFIG_PAGE_POISONING is needed'], ['CONFIG_SECURITY', 'y', 'defconfig', 'security_policy', 'OK'], ['CONFIG_SECURITY_YAMA', 'y', 'kspp', 'security_policy', 'OK'], ['CONFIG_SECCOMP', 'y', 'defconfig', 'cut_attack_surface', 'OK'], ['CONFIG_SECCOMP_FILTER', 'y', 'defconfig', 'cut_attack_surface', 'OK'], ['CONFIG_STRICT_DEVMEM', 'y', 'defconfig', 'cut_attack_surface', 'OK'], ['CONFIG_MODULES', 'is not set', 'kspp', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_DEVMEM', 'is not set', 'kspp', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_IO_STRICT_DEVMEM', 'y', 'kspp', 'cut_attack_surface', 'OK'], ['CONFIG_ACPI_CUSTOM_METHOD', 'is not set', 'kspp', 'cut_attack_surface', 'FAIL: "m"'], ['CONFIG_COMPAT_BRK', 'is not set', 'kspp', 'cut_attack_surface', 'OK'], ['CONFIG_DEVKMEM', 'is not set', 'kspp', 'cut_attack_surface', 'OK'], ['CONFIG_COMPAT_VDSO', 'is not set', 'kspp', 'cut_attack_surface', 'OK'], ['CONFIG_BINFMT_MISC', 'is not set', 'kspp', 'cut_attack_surface', 'FAIL: "m"'], ['CONFIG_INET_DIAG', 'is not set', 'kspp', 'cut_attack_surface', 'FAIL: "m"'], ['CONFIG_KEXEC', 'is not set', 'kspp', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_PROC_KCORE', 'is not set', 'kspp', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_LEGACY_PTYS', 'is not set', 'kspp', 'cut_attack_surface', 'OK'], ['CONFIG_HIBERNATION', 'is not set', 'kspp', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_LEGACY_VSYSCALL_NONE', 'y', 'kspp', 'cut_attack_surface', 'FAIL: "is not set"'], ['CONFIG_IA32_EMULATION', 'is not set', 'kspp', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_X86_X32', 'is not set', 'kspp', 'cut_attack_surface', 'OK'], ['CONFIG_MODIFY_LDT_SYSCALL', 'is not set', 'kspp', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_X86_PTDUMP', 'is not set', 'grsecurity', 'cut_attack_surface', 'OK'], ['CONFIG_ZSMALLOC_STAT', 'is not set', 'grsecurity', 'cut_attack_surface', 'OK'], ['CONFIG_PAGE_OWNER', 'is not set', 'grsecurity', 'cut_attack_surface', 'OK'], ['CONFIG_DEBUG_KMEMLEAK', 'is not set', 'grsecurity', 'cut_attack_surface', 'OK'], ['CONFIG_BINFMT_AOUT', 'is not set', 'grsecurity', 'cut_attack_surface', 'OK: not found'], ['CONFIG_KPROBES', 'is not set', 'grsecurity', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_UPROBES', 'is not set', 'grsecurity', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_GENERIC_TRACER', 'is not set', 'grsecurity', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_PROC_VMCORE', 'is not set', 'grsecurity', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_PROC_PAGE_MONITOR', 'is not set', 'grsecurity', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_USELIB', 'is not set', 'grsecurity', 'cut_attack_surface', 'OK'], ['CONFIG_CHECKPOINT_RESTORE', 'is not set', 'grsecurity', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_USERFAULTFD', 'is not set', 'grsecurity', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_HWPOISON_INJECT', 'is not set', 'grsecurity', 'cut_attack_surface', 'FAIL: "m"'], ['CONFIG_MEM_SOFT_DIRTY', 'is not set', 'grsecurity', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_DEVPORT', 'is not set', 'grsecurity', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_DEBUG_FS', 'is not set', 'grsecurity', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_NOTIFIER_ERROR_INJECTION', 'is not set', 'grsecurity', 'cut_attack_surface', 'OK'], ['CONFIG_ACPI_TABLE_UPGRADE', 'is not set', 'lockdown', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_ACPI_APEI_EINJ', 'is not set', 'lockdown', 'cut_attack_surface', 'FAIL: "m"'], ['CONFIG_PROFILING', 'is not set', '
3545 lockdown', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_BPF_SYSCALL', 'is not set', 'lockdown', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_MMIOTRACE_TEST', 'is not set', 'lockdown', 'cut_attack_surface', 'OK'], ['CONFIG_KSM', 'is not set', 'clipos', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_IKCONFIG', 'is not set', 'clipos', 'cut_attack_surface', 'OK'], ['CONFIG_KALLSYMS', 'is not set', 'clipos', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_X86_VSYSCALL_EMULATION', 'is not set', 'clipos', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_MAGIC_SYSRQ', 'is not set', 'clipos', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_KEXEC_FILE', 'is not set', 'clipos', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_USER_NS', 'is not set', 'clipos', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_LDISC_AUTOLOAD', 'is not set', 'clipos', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_MMIOTRACE', 'is not set', 'my', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_LIVEPATCH', 'is not set', 'my', 'cut_attack_surface', 'OK'], ['CONFIG_IP_DCCP', 'is not set', 'my', 'cut_attack_surface', 'OK'], ['CONFIG_IP_SCTP', 'is not set', 'my', 'cut_attack_surface', 'FAIL: "m"'], ['CONFIG_FTRACE', 'is not set', 'my', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_BPF_JIT', 'is not set', 'my', 'cut_attack_surface', 'FAIL: "y"'], ['CONFIG_ARCH_MMAP_RND_BITS', '32', 'clipos', 'userspace_protection', 'FAIL: "28"']]
3546 ~~~
3547
3548 Could you rework the PR and check the JSON output ?
3549 I think it might be a trivial fix, like double quotes instead of simple quotes:
3550 ![Screenshot_20190707_145217](https://user-images.githubusercontent.com/964610/60768672-e0620600-a0c6-11e9-80f8-4454265c50fc.png)
3551
3552
3553 Thanks !
3554
3555 #### <img src="https://avatars.githubusercontent.com/u/964610?u=f244bab6b14967638a88cef92752379e64b15996&v=4" width="50">[Wenzel](https://github.com/Wenzel) commented at [2019-07-07 12:55](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/20#issuecomment-508997636):
3556
3557 It should be more robust to use `json.dump(obj)` or `json.dumps(string)` instead of printing your own JSON.
3558 https://github.com/a13xp0p0v/kconfig-hardened-check/blob/master/kconfig-hardened-check.py#L377
3559
3560 #### <img src="https://avatars.githubusercontent.com/u/4029800?u=86702d3f2d50ee01ef1c572ef26b1ea1318f28da&v=4" width="50">[adrianopol](https://github.com/adrianopol) commented at [2019-07-07 19:28](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/20#issuecomment-509024571):
3561
3562 Fixed. Thanks.
3563
3564 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-07-08 14:12](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/20#issuecomment-509241942):
3565
3566 @Wenzel, thanks for the report.
3567 @adrianopol, thanks for the fix, merged.
3568 Double-checked it in json validator, now it should be fine.
3569
3570
3571 -------------------------------------------------------------------------------
3572
3573 # [\#19 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/19) `closed`: Compare with clipos recommendations
3574
3575 #### <img src="https://avatars.githubusercontent.com/u/4661917?u=bb7aeb3c77839cea055b49b80168666b36315f3d&v=4" width="50">[theLOICofFRANCE](https://github.com/theLOICofFRANCE) opened issue at [2019-06-01 12:08](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/19):
3576
3577 Hi Alexander,
3578
3579 I monitoring an interesting project ([CLIP OS ](https://github.com/clipos)) in my country and some options should be compared with your project.
3580
3581 Here are some options that are missing or different from kconfig-hardened-check :
3582
3583 ```
3584 CONFIG_AUDIT=y
3585 CONFIG_IKCONFIG=n
3586 CONFIG_KALLSYMS=n
3587 CONFIG_SLAB_HARDENED=y
3588 CONFIG_SLAB_CANARY=y
3589 CONFIG_SLAB_SANITIZE=y
3590 CONFIG_SLAB_SANITIZE_VERIFY=y
3591 CONFIG_GCC_PLUGIN_RANDSTRUCT_PERFORMANCE=n
3592 CONFIG_LOCAL_INIT=n
3593 CONFIG_X86_VSYSCALL_EMULATION=n
3594 CONFIG_MICROCODE=y
3595 CONFIG_X86_MSR=y
3596 CONFIG_KSM=n
3597 CONFIG_MTRR=y
3598 CONFIG_X86_PAT=y
3599 CONFIG_ARCH_RANDOM=y
3600 CONFIG_X86_INTEL_MPX=n
3601 CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS=n
3602 CONFIG_CRASH_DUMP=n
3603 CONFIG_COREDUMP=n
3604 CONFIG_TCG_TPM=n
3605 CONFIG_RANDOM_TRUST_CPU=n
3606 CONFIG_IOMMU_SUPPORT=y
3607 CONFIG_INTEL_IOMMU=y
3608 CONFIG_INTEL_IOMMU_SVM=y
3609 CONFIG_INTEL_IOMMU_DEFAULT_ON=y
3610 CONFIG_MAGIC_SYSRQ=n
3611 CONFIG_DEBUG_KERNEL=y
3612 CONFIG_DEBUG_VIRTUAL=y
3613 CONFIG_SLUB_DEBUG_ON=n
3614 CONFIG_PANIC_ON_OOPS=y
3615 CONFIG_PANIC_TIMEOUT=-1
3616 CONFIG_INTEL_TXT=n
3617 CONFIG_FORTIFY_SOURCE_STRICT_STRING=n
3618 CONFIG_STATIC_USERMODEHELPER_PATH=""
3619 CONFIG_SECURITY_SELINUX_BOOTPARAM=n
3620 CONFIG_INTEGRITY=n
3621 CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y
3622 CONFIG_PAGE_SANITIZE_VERIFY=y
3623 CONFIG_SECURITY_TIOCSTI_RESTRICT=y
3624 CONFIG_LOCK_DOWN_MANDATORY=y
3625 CONFIG_STACKLEAK_TRACK_MIN_SIZE=100
3626 CONFIG_STACKLEAK_METRICS=n
3627 CONFIG_STACKLEAK_RUNTIME_DISABLE=n
3628 ```
3629
3630 Details of the options are available here:
3631 https://docs.clip-os.org/clipos/kernel.html#configuration
3632
3633 Best regards,
3634
3635 #### <img src="https://avatars.githubusercontent.com/u/4661917?u=bb7aeb3c77839cea055b49b80168666b36315f3d&v=4" width="50">[theLOICofFRANCE](https://github.com/theLOICofFRANCE) commented at [2019-06-01 12:12](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/19#issuecomment-497939852):
3636
3637 Even if I'm not a fan of black magic (see [this](https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/issues/3)), the CONFIG_MICROCODE=y option is now essential.
3638
3639 #### <img src="https://avatars.githubusercontent.com/u/32568352?v=4" width="50">[Bernhard40](https://github.com/Bernhard40) commented at [2019-06-02 11:33](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/19#issuecomment-498022889):
3640
3641 Some of those options are available only in linux-hardened patchset thus not applicable here. Others like CONFIG_INTEGRITY=n or CONFIG_INTEL_TXT=n are specific to clipos and general recommendations would be the opposite.
3642
3643 #### <img src="https://avatars.githubusercontent.com/u/4661917?u=bb7aeb3c77839cea055b49b80168666b36315f3d&v=4" width="50">[theLOICofFRANCE](https://github.com/theLOICofFRANCE) commented at [2019-06-02 15:13](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/19#issuecomment-498039692):
3644
3645 Yes, you're right, I did a quick extraction. 
3646 Are there any options you think are interesting?
3647
3648 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-06-03 10:23](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/19#issuecomment-498201117):
3649
3650 Cool! @HacKurx, learning the CLIP OS config is a nice idea.
3651
3652 Thanks for the link, I'll check the options from their documentation and choose relevant for the script.
3653
3654 Do you have their full kernel config for adding to `config_files`?
3655
3656 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-06-03 18:16](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/19#issuecomment-498368130):
3657
3658 Hi @HacKurx and @Bernhard40,
3659 I've added new checks based on the CLIP OS recommendations.
3660
3661 #### <img src="https://avatars.githubusercontent.com/u/4661917?u=bb7aeb3c77839cea055b49b80168666b36315f3d&v=4" width="50">[theLOICofFRANCE](https://github.com/theLOICofFRANCE) commented at [2019-06-03 19:02](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/19#issuecomment-498384402):
3662
3663 Hi @a13xp0p0v,
3664
3665 Thanks you :)
3666
3667 > Do you have their full kernel config for adding to config_files?
3668
3669 The configuration is automatically generated by a script in their own kernel source:
3670 https://github.com/clipos/src_platform_config-linux-hardware/tree/master/
3671 https://github.com/clipos/src_external_linux
3672
3673 I can ask @tsautereau-anssi for confirm it.
3674
3675 Best regards,
3676
3677 #### <img src="https://avatars.githubusercontent.com/u/32568352?v=4" width="50">[Bernhard40](https://github.com/Bernhard40) commented at [2019-06-04 10:20](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/19#issuecomment-498612884):
3678
3679 @a13xp0p0v `CONFIG_X86_MSR` could also be set to `m` which I think should be ok.
3680
3681 At least Ubuntu, Debian, Archlinux and opensSUSE have it set this way.
3682
3683 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-06-04 22:12](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/19#issuecomment-498862822):
3684
3685 >@a13xp0p0v CONFIG_X86_MSR could also be set to m which I think should be ok.
3686 At least Ubuntu, Debian, Archlinux and opensSUSE have it set this way.
3687
3688 @Bernhard40, thanks for pointing this out.
3689 I double-checked and dropped this recommendation - IMO it's wrong.
3690 CONFIG_X86_MSR provides access from the userspace to the x86 MSRs via char devices.
3691 Kernel doesn't need it for mitigating CPU bugs.
3692
3693 I've created an issue with a question for the CLIP OS project:
3694 https://github.com/clipos/src_platform_config-linux-hardware/issues/1
3695
3696
3697 -------------------------------------------------------------------------------
3698
3699 # [\#18 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/18) `merged`: Update pentoo config link
3700
3701 #### <img src="https://avatars.githubusercontent.com/u/4661917?u=bb7aeb3c77839cea055b49b80168666b36315f3d&v=4" width="50">[theLOICofFRANCE](https://github.com/theLOICofFRANCE) opened issue at [2019-06-01 12:02](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/18):
3702
3703
3704
3705
3706
3707
3708 -------------------------------------------------------------------------------
3709
3710 # [\#17 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/17) `merged`: Update and add config
3711
3712 #### <img src="https://avatars.githubusercontent.com/u/4661917?u=bb7aeb3c77839cea055b49b80168666b36315f3d&v=4" width="50">[theLOICofFRANCE](https://github.com/theLOICofFRANCE) opened issue at [2019-05-12 15:09](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/17):
3713
3714 Hi Alexander,
3715
3716 Here are some updates and the addition of two distributions.
3717
3718 I let you choose ;)
3719
3720 Best regards,
3721
3722 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-05-17 15:13](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/17#issuecomment-493490338):
3723
3724 Hello @HacKurx,
3725 Thanks for the update!
3726 I'm merging it.
3727
3728 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-05-17 15:20](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/17#issuecomment-493492947):
3729
3730 @HacKurx, may I ask you to add/update information in the `links.txt` as well?
3731 Thanks!
3732
3733 #### <img src="https://avatars.githubusercontent.com/u/4661917?u=bb7aeb3c77839cea055b49b80168666b36315f3d&v=4" width="50">[theLOICofFRANCE](https://github.com/theLOICofFRANCE) commented at [2019-05-25 16:59](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/17#issuecomment-495933123):
3734
3735 Hello @a13xp0p0v,
3736
3737 Thank's for the merge. Some configuration files do not have a url (debian, ubuntu, rhel), I had to extract the configuration from the kernel package.
3738 I am willing to maintain all config occasionally.
3739
3740 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-05-27 14:39](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/17#issuecomment-496234113):
3741
3742 Nice, thanks!
3743
3744 I mean some of your new configs now have out-of-date links in `links.txt`.
3745 For example, Alpine, Arch and Pentoo. Could you please update the links?
3746
3747
3748 -------------------------------------------------------------------------------
3749
3750 # [\#16 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/16) `closed`: After kspp settings server if freezed
3751
3752 #### <img src="https://avatars.githubusercontent.com/u/3471772?v=4" width="50">[bryn1u](https://github.com/bryn1u) opened issue at [2019-04-11 12:37](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/16):
3753
3754 Hey guys,
3755
3756 When i setup server Centos 7 with kspp settings (config below) and i install www hosting panels like Cpanel, CWP panel or ISPmanager and then reboot server, many services are freezed. My network is disabled i cant run with command systemct start network, i cant  reboot server and etc... when i push these commend nothing happen, just waiting and waiting.
3757
3758 My KSPP config:
3759
3760 [+] config check is finished: 'OK' - 62 / 'FAIL' - 41
3761 [root@proton kconfig-hardened-check]# ls
3762 config_files  kconfig-hardened-check.py  LICENSE  README.md
3763 [root@proton kconfig-hardened-check]# ./kconfig-hardened-check.py -c /boot/config-5.0.4 > kspp_setting
3764 [root@proton kconfig-hardened-check]# cat kspp_setting 
3765 [+] Trying to detect architecture in "/boot/config-5.0.4"...
3766 [+] Detected architecture: X86_64
3767 [+] Checking "/boot/config-5.0.4" against hardening preferences...
3768   option name                            | desired val | decision |       reason       ||        check result        
3769   ===================================================================================================================
3770   CONFIG_BUG                             |      y      |defconfig |  self_protection   ||             OK             
3771   CONFIG_STRICT_KERNEL_RWX               |      y      |defconfig |  self_protection   ||             OK             
3772   CONFIG_STACKPROTECTOR_STRONG           |      y      |defconfig |  self_protection   ||             OK             
3773   CONFIG_SLUB_DEBUG                      |      y      |defconfig |  self_protection   ||             OK             
3774   CONFIG_STRICT_MODULE_RWX               |      y      |defconfig |  self_protection   ||             OK             
3775   CONFIG_PAGE_TABLE_ISOLATION            |      y      |defconfig |  self_protection   ||             OK             
3776   CONFIG_RANDOMIZE_MEMORY                |      y      |defconfig |  self_protection   ||             OK             
3777   CONFIG_RANDOMIZE_BASE                  |      y      |defconfig |  self_protection   ||             OK             
3778   CONFIG_RETPOLINE                       |      y      |defconfig |  self_protection   ||             OK             
3779   CONFIG_X86_SMAP                        |      y      |defconfig |  self_protection   ||             OK             
3780   CONFIG_X86_INTEL_UMIP                  |      y      |defconfig |  self_protection   ||             OK             
3781   CONFIG_SYN_COOKIES                     |      y      |defconfig |  self_protection   ||             OK             
3782   CONFIG_VMAP_STACK                      |      y      |defconfig |  self_protection   ||             OK             
3783   CONFIG_THREAD_INFO_IN_TASK             |      y      |defconfig |  self_protection   ||             OK             
3784   CONFIG_BUG_ON_DATA_CORRUPTION          |      y      |   kspp   |  self_protection   ||             OK             
3785   CONFIG_DEBUG_WX                        |      y      |   kspp   |  self_protection   ||             OK             
3786   CONFIG_SCHED_STACK_END_CHECK           |      y      |   kspp   |  self_protection   ||             OK             
3787   CONFIG_SLAB_FREELIST_HARDENED          |      y      |   kspp   |  self_protection   ||             OK             
3788   CONFIG_SLAB_FREELIST_RANDOM            |      y      |   kspp   |  self_protection   ||             OK             
3789   CONFIG_FORTIFY_SOURCE                  |      y      |   kspp   |  self_protection   ||             OK             
3790   CONFIG_GCC_PLUGINS                     |      y      |   kspp   |  self_protection   ||             OK             
3791   CONFIG_GCC_PLUGIN_RANDSTRUCT           |      y      |   kspp   |  self_protection   ||             OK             
3792   CONFIG_GCC_PLUGIN_STRUCTLEAK           |      y      |   kspp   |  self_protection   ||             OK             
3793   CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL |      y      |   kspp   |  self_protection   ||             OK             
3794   CONFIG_GCC_PLUGIN_LATENT_ENTROPY       |      y      |   kspp   |  self_protection   ||             OK             
3795   CONFIG_DEBUG_LIST                      |      y      |   kspp   |  self_protection   ||             OK             
3796   CONFIG_DEBUG_SG                        |      y      |   kspp   |  self_protection   ||             OK             
3797   CONFIG_DEBUG_CREDENTIALS               |      y      |   kspp   |  self_protection   ||             OK             
3798   CONFIG_DEBUG_NOTIFIERS                 |      y      |   kspp   |  self_protection   ||             OK             
3799   CONFIG_PAGE_POISONING                  |      y      |   kspp   |  self_protection   ||             OK             
3800   CONFIG_HARDENED_USERCOPY               |      y      |   kspp   |  self_protection   ||             OK             
3801   CONFIG_HARDENED_USERCOPY_FALLBACK      | is not set  |   kspp   |  self_protection   ||             OK             
3802   CONFIG_MODULE_SIG                      |      y      |   kspp   |  self_protection   ||             OK             
3803   CONFIG_MODULE_SIG_ALL                  |      y      |   kspp   |  self_protection   ||             OK             
3804   CONFIG_MODULE_SIG_SHA512               |      y      |   kspp   |  self_protection   ||     FAIL: "is not set"     
3805   CONFIG_MODULE_SIG_FORCE                |      y      |   kspp   |  self_protection   ||     FAIL: "is not set"     
3806   CONFIG_DEFAULT_MMAP_MIN_ADDR           |    65536    |   kspp   |  self_protection   ||             OK             
3807   CONFIG_REFCOUNT_FULL                   |      y      |   kspp   |  self_protection   ||             OK             
3808   CONFIG_GCC_PLUGIN_STACKLEAK            |      y      |    my    |  self_protection   ||             OK             
3809   CONFIG_LOCK_DOWN_KERNEL                |      y      |    my    |  self_protection   ||      FAIL: not found       
3810   CONFIG_SLUB_DEBUG_ON                   |      y      |    my    |  self_protection   ||             OK             
3811   CONFIG_SECURITY_DMESG_RESTRICT         |      y      |    my    |  self_protection   ||             OK             
3812   CONFIG_STATIC_USERMODEHELPER           |      y      |    my    |  self_protection   ||     FAIL: "is not set"     
3813   CONFIG_SECURITY_LOADPIN                |      y      |    my    |  self_protection   ||     FAIL: "is not set"     
3814   CONFIG_RESET_ATTACK_MITIGATION         |      y      |    my    |  self_protection   ||             OK             
3815   CONFIG_SLAB_MERGE_DEFAULT              | is not set  |    my    |  self_protection   ||         FAIL: "y"          
3816   CONFIG_PAGE_POISONING_NO_SANITY        | is not set  |    my    |  self_protection   ||             OK             
3817   CONFIG_PAGE_POISONING_ZERO             | is not set  |    my    |  self_protection   ||             OK             
3818   CONFIG_SECURITY                        |      y      |defconfig |  security_policy   ||             OK             
3819   CONFIG_SECURITY_YAMA                   |      y      |   kspp   |  security_policy   ||             OK             
3820   CONFIG_SECURITY_SELINUX_DISABLE        | is not set  |   kspp   |  security_policy   ||             OK             
3821   CONFIG_SECCOMP                         |      y      |defconfig | cut_attack_surface ||             OK             
3822   CONFIG_SECCOMP_FILTER                  |      y      |defconfig | cut_attack_surface ||             OK             
3823   CONFIG_STRICT_DEVMEM                   |      y      |defconfig | cut_attack_surface ||             OK             
3824   CONFIG_MODULES                         | is not set  |   kspp   | cut_attack_surface ||         FAIL: "y"          
3825   CONFIG_DEVMEM                          | is not set  |   kspp   | cut_attack_surface ||         FAIL: "y"          
3826   CONFIG_IO_STRICT_DEVMEM                |      y      |   kspp   | cut_attack_surface ||     FAIL: "is not set"     
3827   CONFIG_ACPI_CUSTOM_METHOD              | is not set  |   kspp   | cut_attack_surface ||         FAIL: "m"          
3828   CONFIG_COMPAT_BRK                      | is not set  |   kspp   | cut_attack_surface ||             OK             
3829   CONFIG_DEVKMEM                         | is not set  |   kspp   | cut_attack_surface ||             OK             
3830   CONFIG_COMPAT_VDSO                     | is not set  |   kspp   | cut_attack_surface ||             OK             
3831   CONFIG_BINFMT_MISC                     | is not set  |   kspp   | cut_attack_surface ||         FAIL: "m"          
3832   CONFIG_INET_DIAG                       | is not set  |   kspp   | cut_attack_surface ||         FAIL: "m"          
3833   CONFIG_KEXEC                           | is not set  |   kspp   | cut_attack_surface ||         FAIL: "y"          
3834   CONFIG_PROC_KCORE                      | is not set  |   kspp   | cut_attack_surface ||         FAIL: "y"          
3835   CONFIG_LEGACY_PTYS                     | is not set  |   kspp   | cut_attack_surface ||             OK             
3836   CONFIG_HIBERNATION                     | is not set  |   kspp   | cut_attack_surface ||             OK             
3837   CONFIG_LEGACY_VSYSCALL_NONE            |      y      |   kspp   | cut_attack_surface ||     FAIL: "is not set"     
3838   CONFIG_IA32_EMULATION                  | is not set  |   kspp   | cut_attack_surface ||         FAIL: "y"          
3839   CONFIG_X86_X32                         | is not set  |   kspp   | cut_attack_surface ||             OK             
3840   CONFIG_MODIFY_LDT_SYSCALL              | is not set  |   kspp   | cut_attack_surface ||         FAIL: "y"          
3841   CONFIG_X86_PTDUMP                      | is not set  |grsecurity| cut_attack_surface ||             OK             
3842   CONFIG_ZSMALLOC_STAT                   | is not set  |grsecurity| cut_attack_surface ||             OK             
3843   CONFIG_PAGE_OWNER                      | is not set  |grsecurity| cut_attack_surface ||             OK             
3844   CONFIG_DEBUG_KMEMLEAK                  | is not set  |grsecurity| cut_attack_surface ||             OK             
3845   CONFIG_BINFMT_AOUT                     | is not set  |grsecurity| cut_attack_surface ||       OK: not found        
3846   CONFIG_KPROBES                         | is not set  |grsecurity| cut_attack_surface ||         FAIL: "y"          
3847   CONFIG_UPROBES                         | is not set  |grsecurity| cut_attack_surface ||         FAIL: "y"          
3848   CONFIG_GENERIC_TRACER                  | is not set  |grsecurity| cut_attack_surface ||         FAIL: "y"          
3849   CONFIG_PROC_VMCORE                     | is not set  |grsecurity| cut_attack_surface ||         FAIL: "y"          
3850   CONFIG_PROC_PAGE_MONITOR               | is not set  |grsecurity| cut_attack_surface ||         FAIL: "y"          
3851   CONFIG_USELIB                          | is not set  |grsecurity| cut_attack_surface ||         FAIL: "y"          
3852   CONFIG_CHECKPOINT_RESTORE              | is not set  |grsecurity| cut_attack_surface ||         FAIL: "y"          
3853   CONFIG_USERFAULTFD                     | is not set  |grsecurity| cut_attack_surface ||         FAIL: "y"          
3854   CONFIG_HWPOISON_INJECT                 | is not set  |grsecurity| cut_attack_surface ||         FAIL: "m"          
3855   CONFIG_MEM_SOFT_DIRTY                  | is not set  |grsecurity| cut_attack_surface ||         FAIL: "y"          
3856   CONFIG_DEVPORT                         | is not set  |grsecurity| cut_attack_surface ||         FAIL: "y"          
3857   CONFIG_DEBUG_FS                        | is not set  |grsecurity| cut_attack_surface ||         FAIL: "y"          
3858   CONFIG_NOTIFIER_ERROR_INJECTION        | is not set  |grsecurity| cut_attack_surface ||             OK             
3859   CONFIG_ACPI_TABLE_UPGRADE              | is not set  | lockdown | cut_attack_surface ||         FAIL: "y"          
3860   CONFIG_ACPI_APEI_EINJ                  | is not set  | lockdown | cut_attack_surface ||         FAIL: "m"          
3861   CONFIG_PROFILING                       | is not set  | lockdown | cut_attack_surface ||         FAIL: "y"          
3862   CONFIG_BPF_SYSCALL                     | is not set  | lockdown | cut_attack_surface ||         FAIL: "y"          
3863   CONFIG_MMIOTRACE_TEST                  | is not set  | lockdown | cut_attack_surface ||       OK: not found        
3864   CONFIG_MMIOTRACE                       | is not set  |    my    | cut_attack_surface ||             OK             
3865   CONFIG_KEXEC_FILE                      | is not set  |    my    | cut_attack_surface ||         FAIL: "y"          
3866   CONFIG_LIVEPATCH                       | is not set  |    my    | cut_attack_surface ||         FAIL: "y"          
3867   CONFIG_USER_NS                         | is not set  |    my    | cut_attack_surface ||         FAIL: "y"          
3868   CONFIG_IP_DCCP                         | is not set  |    my    | cut_attack_surface ||         FAIL: "m"          
3869   CONFIG_IP_SCTP                         | is not set  |    my    | cut_attack_surface ||         FAIL: "m"          
3870   CONFIG_FTRACE                          | is not set  |    my    | cut_attack_surface ||         FAIL: "y"          
3871   CONFIG_BPF_JIT                         | is not set  |    my    | cut_attack_surface ||         FAIL: "y"          
3872   CONFIG_ARCH_MMAP_RND_BITS              |     32      |    my    |userspace_protection||         FAIL: "28"         
3873
3874 [+] config check is finished: 'OK' - 62 / 'FAIL' - 41
3875
3876
3877 Someone can help me with this, i would be graceful ?
3878 Could be impact because of this ?
3879 CONFIG_GCC_PLUGINS | y | kspp | self_protection || OK
3880 CONFIG_GCC_PLUGIN_RANDSTRUCT | y | kspp | self_protection || OK
3881 CONFIG_GCC_PLUGIN_STRUCTLEAK | y | kspp | self_protection || OK
3882 CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL | y | kspp | self_protection || OK
3883 CONFIG_GCC_PLUGIN_LATENT_ENTROPY | y | kspp | self_protection || OK
3884
3885 #### <img src="https://avatars.githubusercontent.com/u/32568352?v=4" width="50">[Bernhard40](https://github.com/Bernhard40) commented at [2019-04-11 19:26](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/16#issuecomment-482272466):
3886
3887 Could you post `dmesg` output?
3888
3889 #### <img src="https://avatars.githubusercontent.com/u/3471772?v=4" width="50">[bryn1u](https://github.com/bryn1u) commented at [2019-04-14 13:50](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/16#issuecomment-482980574):
3890
3891 Hey,
3892
3893 Sure.
3894 I put my KSPP config again but as a screen: https://ufile.io/epovx3h9
3895 Second part of KSPP config:  https://ufile.io/n4087vqn
3896
3897 Output from dmesg:
3898 dmesg 1 - https://ufile.io/2reh95ag
3899 dmesg 2 - https://ufile.io/mkt1sv73
3900
3901 Thanks,
3902
3903 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-04-14 20:45](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/16#issuecomment-483056865):
3904
3905 Hello @bryn1u,
3906
3907 As I can understand, you are trying to run Centos 7 with the mainline kernel (5.0.7).
3908 I would recommend you to move by smaller steps.
3909
3910 First -- update your kernel, but use `make oldconfig` with the original kernel config from Centos 7.
3911 Maybe something will break even after this step.
3912
3913 And then try to enable hardening options one by one performing your functional test after each change.
3914 You can speed up this procedure using bisection method (between the initial and final configs).
3915
3916 @Bernhard40, any other advices?
3917
3918
3919 -------------------------------------------------------------------------------
3920
3921 # [\#15 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/15) `closed`: After used KSPP settings, modules ext4, xfs, iptables are disabled.
3922
3923 #### <img src="https://avatars.githubusercontent.com/u/3471772?v=4" width="50">[bryn1u](https://github.com/bryn1u) opened issue at [2019-03-22 13:09](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/15):
3924
3925 Hello a13xp0p0v :))
3926
3927 Im using centos 7 and i have a weird problem after kernel compilation. Below is my config kernel with KSPP options enabled.
3928 ![kernel1](https://user-images.githubusercontent.com/3471772/54824577-a271db00-4cab-11e9-92fc-4974a17b41d1.png)
3929 ![kernel2](https://user-images.githubusercontent.com/3471772/54824582-a69df880-4cab-11e9-9c34-604be7280fd1.png)
3930 ![kernel3](https://user-images.githubusercontent.com/3471772/54824586-ab62ac80-4cab-11e9-98af-5b5c98baa232.png)
3931
3932 I have no idea why after kernel compiling, modules like for example ext4, xfs and iptables are disabled. I can't login to the system because ext4 module is disable. The only way is to compiling permanently not as a module. But iptables still dosen't work. Which options are responsible for these "issues" ?
3933 Thanks for help :)
3934
3935
3936 #### <img src="https://avatars.githubusercontent.com/u/32568352?v=4" width="50">[Bernhard40](https://github.com/Bernhard40) commented at [2019-03-23 17:18](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/15#issuecomment-475888038):
3937
3938 It could be caused by `CONFIG_STATIC_USERMODEHELPER`. This option needs userspace support which is pretty much non-existent in distros, don't use it.
3939
3940 #### <img src="https://avatars.githubusercontent.com/u/3471772?v=4" width="50">[bryn1u](https://github.com/bryn1u) commented at [2019-03-23 20:07](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/15#issuecomment-475900478):
3941
3942 Thanks Bernhard40. I disabled usermodhelper and it works.
3943
3944 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-03-24 11:35](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/15#issuecomment-475950377):
3945
3946 Hello!
3947
3948 @Bernhard40, thanks for your help!
3949
3950 @bryn1u, I remember we have discussed with you that STATIC_USERMODEHELPER and SECURITY_LOADPIN influence module loading -- in #8.
3951
3952 That's why the script has the following comments:
3953 ```
3954 checklist.append(OptCheck('STATIC_USERMODEHELPER', 'y', 'my', 'self_protection')) # needs userspace support (systemd)
3955 checklist.append(OptCheck('SECURITY_LOADPIN', 'y', 'my', 'self_protection')) # needs userspace support
3956 ```
3957
3958
3959 -------------------------------------------------------------------------------
3960
3961 # [\#14 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/14) `closed`: User namespace useful especially when running containers
3962
3963 #### <img src="https://avatars.githubusercontent.com/u/1397088?v=4" width="50">[jcberthon](https://github.com/jcberthon) opened issue at [2019-03-19 14:59](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/14):
3964
3965 Maybe I'm wrong, but at least with Kernel 5.0 USER_NS is activated by default, so "is not set" or "y" should be equivalent. At the moment, it fails because it is "y" on my configuration.
3966
3967 I know that activating USER_NS can cut the attack surface if it is not needed on a system. But on my system which are running containers, I want to have USER_NS activated. True this is not pure hardening of the Kernel, but if we take into account the whole kernel including the possibilities to use it to make containers, then USER_NS should be part of the whole hardening.
3968
3969 #### <img src="https://avatars.githubusercontent.com/u/32568352?v=4" width="50">[Bernhard40](https://github.com/Bernhard40) commented at [2019-03-19 18:02](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/14#issuecomment-474500985):
3970
3971 > Maybe I'm wrong, but at least with Kernel 5.0 USER_NS is activated by default, so "is not set" or "y" should be equivalent. At the moment, it fails because it is "y" on my configuration.
3972
3973 "is not set" (disabled) is the opposite of "y" (enabled). The fail for "y" is desired outcome.
3974
3975 > I know that activating USER_NS can cut the attack surface if it is not needed on a system. But on my system which are running containers, I want to have USER_NS activated. True this is not pure hardening of the Kernel, but if we take into account the whole kernel including the possibilities to use it to make containers, then USER_NS should be part of the whole hardening.
3976
3977 You have it backwards. **Disabling** USER_NS [cuts the attack surface](https://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project/Recommended_Settings#sysctls) and is part of kernel hardening. USER_NS (unprivileged) are considered inherently insecure and unfixable.
3978
3979 #### <img src="https://avatars.githubusercontent.com/u/1397088?v=4" width="50">[jcberthon](https://github.com/jcberthon) commented at [2019-03-19 21:20](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/14#issuecomment-474589104):
3980
3981 Thanks for clarifying the first point.
3982
3983 Concerning the second point, I know that username space could increase the attack surface (heck I recall there was like 1,5-2 years ago a privilege escalation flaw with user ns - albeit mitigated when using SELinux), that's especially true if the functionality is not used.
3984
3985 Anyway as the site you mention implicitly state, you can still compile it in and use the sysctl knob to disable it depending on your threat model and your usage of the kernel. So your application could test the sysctl knob rather than the kernel config. e.g. for people using Ubuntu but following the guideline (and because they do not need it), they can disable it in sysctl. When running your script, they should see that it is correctly disabled. What do you think?
3986
3987 _Note that when someone requires to run containers, user ns can be a good evil. It increases some risk but diminished others. It is a trade off which depends on one's threat model. I mean that I clearly prefer to run my containers as non-root user with as little capabilities as possible, so I would not need user namespaces. But I'm also maintaining a CI/CD environment based on Docker, and there it is pretty hard to deny users the use of root inside spawned containers. I can control capabilities, seccomp and SELinux, but not the root user. There I really need user namespace, I have no other choice._
3988
3989 Do you have a source for user ns being considered unfixable?
3990
3991 Anyway, I understand your reasoning for marking user ns as insecure, so I would not be offended if you would decide to close this issue. Of course I would appreciate you take my suggestion into account :-)
3992
3993 #### <img src="https://avatars.githubusercontent.com/u/203012?u=939d6d3b5ff0b9e46e911d8792a40c20408574e2&v=4" width="50">[anthraxx](https://github.com/anthraxx) commented at [2019-03-19 21:32](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/14#issuecomment-474592962):
3994
3995 its not just one like 2 years ago, userns is an endless stream of privilege escalation flaws exposed by root designed functionality accessible to any unprivileged user inside a user namespace over and over again.
3996
3997 In my personal opinion this should remain as is, being an error, and if your personal threat model doesn't care about user_ns you can just ignore the result of kconfig-hardened-check :cat:
3998
3999 #### <img src="https://avatars.githubusercontent.com/u/1397088?v=4" width="50">[jcberthon](https://github.com/jcberthon) commented at [2019-03-19 22:44](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/14#issuecomment-474613483):
4000
4001 Alright, and thanks for the feedback.
4002
4003 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-03-20 06:49](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/14#issuecomment-474708180):
4004
4005 Hello everyone,
4006
4007 I'm a bit late for the discussion.
4008
4009 @jcberthon, thanks for your message.
4010 Yes, the `CONFIG_USER_NS` option provides some isolation between the userspace programs, but the script recommends disabling it to cut the attack surface __of the kernel__.
4011 Let me give the links describing the rationale:
4012   
4013   1. A nice LWN article about the corresponding LKML discussion: https://lwn.net/Articles/673597/
4014   2. A twitter thread about USER_NS and security: https://twitter.com/robertswiecki/status/1095447678949953541
4015
4016 @jcberthon, you are right, USER_NS can be disabled using the sysctl - it is even mentioned in the script source code:
4017 ```
4018 checklist.append(OptCheck('USER_NS', 'is not set', 'my', 'cut_attack_surface')) # user.max_user_namespaces=0
4019 ```
4020
4021 (by the way, adding the ability to check kernel boot parameters and sysctl would be really nice)
4022
4023 Thanks for your discussion, I think I should add some clarification of `cut_attack_surface` to the README.
4024
4025 #### <img src="https://avatars.githubusercontent.com/u/32568352?v=4" width="50">[Bernhard40](https://github.com/Bernhard40) commented at [2019-03-20 12:25](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/14#issuecomment-474807051):
4026
4027 > (by the way, adding the ability to check kernel boot parameters and sysctl would be really nice)
4028
4029 I'm not sure if it's good idea for this project to start scanning the running system for security features. I would vote for keeping it simple and just check chosen config file.
4030
4031 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-03-20 13:23](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/14#issuecomment-474826371):
4032
4033 > > (by the way, adding the ability to check kernel boot parameters and sysctl would be really nice)
4034
4035 > I'm not sure if it's good idea for this project to start scanning the running system for security features. I would vote for keeping it simple and just check chosen config file.
4036
4037 I agree, I don't like the privileged scanning of a system from the script too.
4038 I mean the script could analyze additional files with the needed information together with the kernel config.
4039 For example, right now we can say nothing about side-channel attack mitigations.
4040
4041 #### <img src="https://avatars.githubusercontent.com/u/1397088?v=4" width="50">[jcberthon](https://github.com/jcberthon) commented at [2019-03-20 23:09](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/14#issuecomment-475063272):
4042
4043 Thank you for the interesting read and for the updated README.
4044
4045
4046 -------------------------------------------------------------------------------
4047
4048 # [\#13 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/13) `closed`: False positive and false negatives
4049
4050 #### <img src="https://avatars.githubusercontent.com/u/32568352?v=4" width="50">[Bernhard40](https://github.com/Bernhard40) opened issue at [2019-03-09 19:13](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/13):
4051
4052 `PAGE_POISONING_NO_SANITY` and `PAGE_POISONING_ZERO` depend on `PAGE_POISONING`. Checking distro config which doesn't enable `PAGE_POISONING` (like Fedora) will show `OK: not found` for the first two even as it's far from ok in this case.
4053
4054 Currently script checks only for `MODULE_SIG_SHA512`. Some distros (like Fedora) may use `SHA256` which I think should be fine as well even if KSPP chose different example.
4055
4056 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-03-11 16:27](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/13#issuecomment-471614645):
4057
4058 Hello @Bernhard40,
4059 Thanks for your report, let's discuss it.
4060
4061 > PAGE_POISONING_NO_SANITY and PAGE_POISONING_ZERO depend on PAGE_POISONING. Checking distro config which doesn't enable PAGE_POISONING (like Fedora) will show OK: not found for the first two even as it's far from ok in this case.
4062
4063 Yes, they are dependent on PAGE_POISONING.
4064 These options make this feature weaker, so the script is checking that they are __disabled__.
4065 When the PAGE_POISONING is disabled, the error count is incremented anyway.
4066 I don't think that checking PAGE_POISONING_NO_SANITY and PAGE_POISONING_ZERO should behave differently in that case.
4067
4068 > Currently script checks only for MODULE_SIG_SHA512. Some distros (like Fedora) may use SHA256 which I think should be fine as well even if KSPP chose different example.
4069
4070 The MODULE_SIG_SHA512 option is the KSPP recommendation, it is explicitly indicated by the script.
4071 Distros may have various reasons to do it differently.
4072 One day the script will support the error annotations (the idea is described here: https://github.com/a13xp0p0v/kconfig-hardened-check/pull/9#issuecomment-453810119)
4073
4074 #### <img src="https://avatars.githubusercontent.com/u/32568352?v=4" width="50">[Bernhard40](https://github.com/Bernhard40) commented at [2019-03-12 00:07](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/13#issuecomment-471790830):
4075
4076 > Yes, they are dependent on PAGE_POISONING.
4077 > These options make this feature weaker, so the script is checking that they are disabled.
4078 > When the PAGE_POISONING is disabled, the error count is incremented anyway.
4079 > I don't think that checking PAGE_POISONING_NO_SANITY and PAGE_POISONING_ZERO should behave differently in that case.
4080
4081 Consider distro which have PAGE_POISONING=n. In check it gets:
4082 ```
4083 CONFIG_PAGE_POISONING                  |      y      |   kspp   |  self_protection   ||     FAIL: "is not set" 
4084 CONFIG_PAGE_POISONING_NO_SANITY        | is not set  |    my    |  self_protection   ||       OK: not found
4085 CONFIG_PAGE_POISONING_ZERO             | is not set  |    my    |  self_protection   ||       OK: not found
4086 ```
4087 The sum is: 1xFAIL + 2xOK
4088
4089 Now, consider distro which has PAGE_POISONING=y, PAGE_POISONING_NO_SANITY=y, PAGE_POISONING_ZERO=y. In check it gets:
4090 ```
4091 CONFIG_PAGE_POISONING                  |      y      |   kspp   |  self_protection   ||             OK
4092 CONFIG_PAGE_POISONING_NO_SANITY        | is not set  |    my    |  self_protection   ||         FAIL: "y"
4093 CONFIG_PAGE_POISONING_ZERO             | is not set  |    my    |  self_protection   ||         FAIL: "y"
4094 ```
4095 The sum is: 2xFAIL + 1xOK
4096
4097 The check shows that distro which disables PAGE_POISONING completely is better than one which enables its weaker version! Specifically for fedora it's 52 errors with the former (actual config) vs 53 errors with the latter.
4098
4099 > The MODULE_SIG_SHA512 option is the KSPP recommendation, it is explicitly indicated by the script.
4100
4101 I read this recommendation as _sign your modules_ rather than _sign your modules using SHA512_. The KSPP page says [But if CONFIG_MODULE=y is needed, at least they must be signed with a per-build key](https://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project/Recommended_Settings#CONFIGs). Below they show an example with SHA512. I highly doubt they meant SHA512 explicitly and nothing else. IMO they just used one example because iterating it for SHA256/SHA384 would be rather redundant. You may ask Kees about what he had in mind when he wrote this.
4102
4103 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-03-12 15:31](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/13#issuecomment-472049899):
4104
4105 > The check shows that distro which disables PAGE_POISONING completely is better than one which enables its weaker version! Specifically for fedora it's 52 errors with the former (actual config) vs 53 errors with the latter.
4106
4107 Right. Please have a look how I've solved this issue.
4108  - I've implemented the AND check: 555b588e7b8a620ee57d53ef771e3b128590de45.
4109  - It's now used for PAGE_POISONING_NO_SANITY and PAGE_POISONING_ZERO - they are not checked if PAGE_POISONING is off: a314e4f1df3893864e398ea8565fefdfc036169b.
4110  - The same approach for HARDENED_USERCOPY_FALLBACK: c83dc6c7c804987999296afba385b2349bdda9ac.
4111  - And I improved the output of final results: 43920b20672cd603f7d5e02544a951eec914636b. Now OKs are counted too.
4112
4113 > You may ask Kees about what he had in mind when he wrote this.
4114
4115 Ok, I will remember that. There are several things which can be added to KSPP wiki. I'll work on that later.
4116
4117 #### <img src="https://avatars.githubusercontent.com/u/32568352?v=4" width="50">[Bernhard40](https://github.com/Bernhard40) commented at [2019-03-12 17:53](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/13#issuecomment-472112024):
4118
4119 > It's now used for PAGE_POISONING_NO_SANITY and PAGE_POISONING_ZERO - they are not checked if PAGE_POISONING is off:
4120
4121 You could also always mark them as failed in that case like `FAIL: "dependency missing"`. That would prevent FAIL count from increasing when enabling only PAGE_POISONING.
4122
4123 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-03-12 21:54](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/13#issuecomment-472196588):
4124
4125 > You could also always mark them as failed in that case like FAIL: "dependency missing"
4126
4127 @Bernhard40, nice idea, thank you.
4128 Implemented in d9aca2d28e9f95266bca2da09625d7d2c885a6b2.
4129
4130
4131 -------------------------------------------------------------------------------
4132
4133 # [\#12 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/12) `closed`: CONFIG_MODULE_SIG_FORCE shouldn't be checked if CONFIG_MODULES is not set
4134
4135 #### <img src="https://avatars.githubusercontent.com/u/990588?v=4" width="50">[hannob](https://github.com/hannob) opened issue at [2019-03-03 12:35](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/12):
4136
4137 I have a minimal kernel without modules for a server. I get a warning about CONFIG_MODULE_SIG_FORCE, which should not apply for a kernel without module support.
4138
4139 For several other module-related options the script behaves correctly (saying 'CONFIG_MODULES: OK ("is not set")' indicating this does not apply), but for CONFIG_MODULE_SIG_FORCE it does not do so.
4140
4141 Output is:
4142 ```
4143   CONFIG_MODULE_SIG_FORCE                |      y      |   kspp   |  self_protection   ||      FAIL: not found       
4144 ```
4145
4146 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-03-04 13:42](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/12#issuecomment-469256961):
4147
4148 Fixed.
4149 Thank you @hannob.
4150
4151
4152 -------------------------------------------------------------------------------
4153
4154 # [\#11 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/11) `closed`: Feature request: Check CONFIG_RESET_ATTACK_MITIGATION
4155
4156 #### <img src="https://avatars.githubusercontent.com/u/990588?v=4" width="50">[hannob](https://github.com/hannob) opened issue at [2019-03-02 08:17](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/11):
4157
4158 Thanks for this tool.
4159
4160 I'd propose to add a check for CONFIG_RESET_ATTACK_MITIGATION.
4161 This is a feature that on modern systems will set a flag on boot that signals the BIOS to wipe the memory if an unclean shutdown happened. This can protect against some forms of cold boot attacks where you reboot into another system and try to read out the memory from the previous run.
4162
4163 Here's the Kernel submission with some explanation:
4164 https://lwn.net/Articles/730006/
4165
4166 It's also explained in this talk:
4167 https://www.youtube.com/watch?v=RqvPZnLkP70 (around minute 35)
4168
4169 #### <img src="https://avatars.githubusercontent.com/u/32568352?v=4" width="50">[Bernhard40](https://github.com/Bernhard40) commented at [2019-03-02 12:47](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/11#issuecomment-468917523):
4170
4171 This option needs userspace support, otherwise it's not recommended for use:
4172 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a5c03c31af2291f13689d11760c0b59fb70c9a5a
4173
4174 https://bugzilla.redhat.com/show_bug.cgi?id=1532058
4175
4176 #### <img src="https://avatars.githubusercontent.com/u/990588?v=4" width="50">[hannob](https://github.com/hannob) commented at [2019-03-03 12:33](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/11#issuecomment-469018559):
4177
4178 Interesting, is there any userspace tool to do this? Or is this basically unsupported in current systems?
4179
4180 #### <img src="https://avatars.githubusercontent.com/u/203012?u=939d6d3b5ff0b9e46e911d8792a40c20408574e2&v=4" width="50">[anthraxx](https://github.com/anthraxx) commented at [2019-03-03 12:49](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/11#issuecomment-469019815):
4181
4182 @hannob I wanted to look into this for systemd, but forgot for quite a while. thanks for reminding me, back then there was no userspace support, theoretically you could add a systemd service but doing it _properly_ is bit more tricky. I'm putting this back onto my todo list and take a dive into how to properly implement this into systemd itself at a place that could guarantee that all other services etc. are already properly shut down.
4183
4184 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-03-04 14:52](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/11#issuecomment-469280355):
4185
4186 Hello @hannob @Bernhard40 @anthraxx,
4187
4188 `RESET_ATTACK_MITIGATION` is a nice option, I will add this check to the script with a comment about userspace support.
4189
4190 That case will be similar to the `STATIC_USERMODEHELPER` option, which needs the userspace support as well (but, as I know, enabling it currently breaks systemd workflow on Ubuntu).
4191
4192 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-03-04 18:29](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/11#issuecomment-469362767):
4193
4194 Hm... By the way Ubuntu 18 has `RESET_ATTACK_MITIGATION` enabled.
4195
4196
4197 -------------------------------------------------------------------------------
4198
4199 # [\#10 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/10) `closed`: Add support for x86_32, arm, and arm64 architectures
4200
4201 #### <img src="https://avatars.githubusercontent.com/u/1051156?u=82b8caad104296ef90ffe2f5807dc34d82c31c2b&v=4" width="50">[tyhicks](https://github.com/tyhicks) opened issue at [2019-01-14 19:37](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/10):
4202
4203 (This is a continuation of #9)
4204
4205 Some hardening recommendations are dependent on the processor architecture. For example, the KSPP recommendations differ between [x86_32](https://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project/Recommended_Settings#x86_32) and [x86_64](https://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project/Recommended_Settings#x86_64).
4206
4207 This pull request adds the ability to reason about the architecture when constructing the checklist. It also teaches the script about `x86_32`, `arm`, and `arm64` specific config recommendations.
4208
4209 I verified that all the example configs in `config_files/` show the same number of config check failures before and after these changes are applied. Of course, the ordering of the options are changed since the ordering used to construct the checklist has been changed.
4210
4211 Some changes since #9 include:
4212 - Drop kernel version detection from the pull request
4213 - Rename `detect_arch_and_version()` to `detect_arch_from_config()`
4214 - Look for `CONFIG_X86_32` and `CONFIG_X86_64` when detecting `x86` sub architecture
4215 - Restrict the accepted `-a <ARCHITECTURE>` values to those found in `SUPPORTED_ARCHS`
4216
4217 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-01-14 20:58](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/10#issuecomment-454158772):
4218
4219 Hello @tyhicks , thanks a lot for the follow-up! Let me propose some improvements.
4220
4221 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-01-14 21:45](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/10#issuecomment-454173475):
4222
4223 @tyhicks , thanks for your work again!
4224 Let me propose one more idea. What do you think about splitting [KSPP recommended settings](http://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project/Recommended_Settings) onto 4 arch-specific configs in `./config_files/`?
4225
4226 #### <img src="https://avatars.githubusercontent.com/u/1051156?u=82b8caad104296ef90ffe2f5807dc34d82c31c2b&v=4" width="50">[tyhicks](https://github.com/tyhicks) commented at [2019-01-17 18:04](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/10#issuecomment-455270114):
4227
4228 Yes, I can add 4 arch-specific configs in `./config_files/`.
4229
4230 #### <img src="https://avatars.githubusercontent.com/u/1051156?u=82b8caad104296ef90ffe2f5807dc34d82c31c2b&v=4" width="50">[tyhicks](https://github.com/tyhicks) commented at [2019-01-17 23:44](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/10#issuecomment-455373860):
4231
4232 I've rebased on top of your current tree, fixed up a few things, added what I think you were asking for in the arch-specific KSPP files, and force pushed to this branch.
4233
4234 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-01-18 12:12](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/10#issuecomment-455526516):
4235
4236 Ouch. 
4237 @tyhicks , excuse me please!
4238 I've made a code review 3 days ago, but didn't hit "submit" button, so it is "pending" :(
4239 I've just realized that you haven't seen my review when I looked at your rebased branch.
4240 My fault.
4241
4242 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-01-18 13:01](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/10#issuecomment-455538355):
4243
4244 If you don't have time/desire, I can pick up your branch and polish it myself.
4245 Thank you again!
4246
4247 #### <img src="https://avatars.githubusercontent.com/u/1051156?u=82b8caad104296ef90ffe2f5807dc34d82c31c2b&v=4" width="50">[tyhicks](https://github.com/tyhicks) commented at [2019-01-18 23:16](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/10#issuecomment-455718260):
4248
4249 > If you don't have time/desire, I can pick up your branch and polish it myself.
4250
4251 I won't mind if you do the polishing yourself.
4252
4253 > Thank you again!
4254
4255 No problem. Thanks for all the review comments.
4256
4257 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-01-24 08:02](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/10#issuecomment-457102717):
4258
4259 Hello @tyhicks ,
4260
4261 I've finished with arch support based on your work.
4262 Do you like it?
4263 Do you have any comments or requests?
4264 Thanks!
4265
4266 #### <img src="https://avatars.githubusercontent.com/u/1051156?u=82b8caad104296ef90ffe2f5807dc34d82c31c2b&v=4" width="50">[tyhicks](https://github.com/tyhicks) commented at [2019-01-24 15:34](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/10#issuecomment-457240527):
4267
4268 Thanks for finishing out the work. It looks very good to me. I'll make use of the changes over the next week or so and submit new pull requests if I spot anything wrong/missing. Thanks again!
4269
4270
4271 -------------------------------------------------------------------------------
4272
4273 # [\#9 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/9) `closed`: Teach the script about target architecture and kernel version
4274
4275 #### <img src="https://avatars.githubusercontent.com/u/1051156?u=82b8caad104296ef90ffe2f5807dc34d82c31c2b&v=4" width="50">[tyhicks](https://github.com/tyhicks) opened issue at [2019-01-12 00:16](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/9):
4276
4277 Some recommendations are dependent on the processor architecture and/or the kernel version. For example, the KSPP recommendations differ between [x86_32](https://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project/Recommended_Settings#x86_32) and [x86_64](https://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project/Recommended_Settings#x86_64). Additionally, option names change over time such as when `CONFIG_CC_STACKPROTECTOR_STRONG` was [renamed](https://kernsec.org/wiki/index.php?title=Kernel_Self_Protection_Project%2FRecommended_Settings&diff=3983&oldid=3976).
4278
4279 This pull request adds the ability to reason about the architecture and version when constructing the checklist. It also teaches the script about `x86_32`, `arm`, and `arm64` specific config recommendations.
4280
4281 #### <img src="https://avatars.githubusercontent.com/u/1051156?u=82b8caad104296ef90ffe2f5807dc34d82c31c2b&v=4" width="50">[tyhicks](https://github.com/tyhicks) commented at [2019-01-12 00:18](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/9#issuecomment-453698919):
4282
4283 I verified that all the example configs in `config_files/` show the same number of config check failures before and after these changes are applied. Of course, the ordering of the options are changed since the ordering used to construct the checklist has been changed.
4284
4285 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-01-12 17:49](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/9#issuecomment-453767322):
4286
4287 Hello @tyhicks ,
4288
4289 Thank you very much for this pull request! Great!
4290
4291 I briefly looked through the patches and I would like to discuss the approach with you before we proceed.
4292
4293 1. Generally I like the way you introduce SUPPORTED_ARCHS. I also like that the script will have this '-a' argument, it's a good idea. I will look closer to this code.
4294
4295 2. It looks to me that introducing kernel versions will bring more troubles than profit.
4296 In fact all these options have a special version when they appeared in the mainline. Some of them were renamed as well. So if we make the script aware of kernel versions, we will have to add full knowledge about them, but I don't think that it's useful.
4297 IMO it's better to check the config against the recent mainline options and support renamed ones using the OR operator. If the user checks some old config with the script, we will print the errors for hardening options which appeared later, and it is nice. Maybe that will even encourage the user to update the kernel for getting these new hardening features.
4298 What do you think?
4299
4300 May I ask you to extract arch support into a separate pull request? We will work further to merge it.
4301
4302 Thanks again for your time!
4303
4304 #### <img src="https://avatars.githubusercontent.com/u/1051156?u=82b8caad104296ef90ffe2f5807dc34d82c31c2b&v=4" width="50">[tyhicks](https://github.com/tyhicks) commented at [2019-01-12 19:48](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/9#issuecomment-453775979):
4305
4306 > Thank you very much for this pull request! Great!
4307
4308 Glad that you find it useful. I plan to use the script and these changes to audit all of the Ubuntu kernel configs and enable reasonable hardening options that aren't yet enabled.
4309
4310 > It looks to me that introducing kernel versions will bring more troubles than profit.
4311 In fact all these options have a special version when they appeared in the mainline. Some of them were renamed as well. So if we make the script aware of kernel versions, we will have to add full knowledge about them, but I don't think that it's useful.
4312 IMO it's better to check the config against the recent mainline options and support renamed ones using the OR operator. If the user checks some old config with the script, we will print the errors for hardening options which appeared later, and it is nice. Maybe that will even encourage the user to update the kernel for getting these new hardening features.
4313 What do you think?
4314
4315 To be honest, I expected that you'd dislike the kernel version checking. I am on the fence about its usefulness, as well. It currently doesn't add much functionality on top of what `OR()` already provides. My long term thought was to extend minimum version checks to all the options (it really isn't too difficult to do that) so that I could then run the script on old Ubuntu kernel configs, such as the `3.13` kernel in Ubuntu 14.04 LTS, and get clean output that doesn't have a bunch of false negatives for that old kernel.
4316
4317 Maybe I'll just drop the version checking now and, in the future, propose some type of external overrides file that lets me ignore the false negatives when running against a given version of an old kernel. Additionally, this would let me specify overrides for certain options that we simply can't enable in a general purpose distro kernel.
4318
4319 > May I ask you to extract arch support into a separate pull request? We will work further to merge it.
4320
4321 Certainly. It might not happen today but I'll get a new PR up very soon.
4322
4323 #### <img src="https://avatars.githubusercontent.com/u/1051156?u=82b8caad104296ef90ffe2f5807dc34d82c31c2b&v=4" width="50">[tyhicks](https://github.com/tyhicks) commented at [2019-01-12 19:51](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/9#issuecomment-453776169):
4324
4325 @a13xp0p0v I have a slightly unrelated question about the script that I'll ask here since I mentioned using this script with our Ubuntu kernel configs. What does `ubuntu18` mean in the `decision` column of the script output? I assume that you're talking about Ubuntu 18.04 LTS but it feels like `kspp` should be used for nearly all of those rows instead of `ubuntu18` as I consider the KSPP project as the "upstream" that makes these recommendations.
4326
4327 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-01-13 08:03](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/9#issuecomment-453810119):
4328
4329 > Glad that you find it useful. I plan to use the script and these changes to audit all of the Ubuntu kernel configs and enable reasonable hardening options that aren't yet enabled.
4330
4331 Nice. I want this script to serve all your needs out of the box.
4332
4333 > To be honest, I expected that you'd dislike the kernel version checking. I am on the fence about its usefulness, as well. It currently doesn't add much functionality on top of what `OR()` already provides. My long term thought was to extend minimum version checks to all the options (it really isn't too difficult to do that) so that I could then run the script on old Ubuntu kernel configs, such as the `3.13` kernel in Ubuntu 14.04 LTS, and get clean output that doesn't have a bunch of false negatives for that old kernel.
4334
4335 Ok, I see. In other words we need some functionality for categorizing and muting script errors, right?
4336
4337 I face a similar task as well and currently I solve it manually:
4338 1. check some kernel config using the script;
4339 2. copy errors from the report to a separate file and annotate each error. Examples:
4340     - this option doesn't exist in that old kernel version,
4341     - enabling/disabling this option breaks the user requirement (e.g. some users need HIBERNATION),
4342     - enabling/disabling this option breaks some code (e.g. enabling STATIC_USERMODEHELPER breaks systemd workflow on Ubuntu 18),
4343     - this option is not enabled since the feature is controlled via kernel command line param (e.g. CONFIG_LEGACY_VSYSCALL_NONE is not set, but the kernel command line has vsyscall=none),
4344     - and finally some errors are marked with TODO.
4345
4346 > Maybe I'll just drop the version checking now and, in the future, propose some type of external overrides file that lets me ignore the false negatives when running against a given version of an old kernel. Additionally, this would let me specify overrides for certain options that we simply can't enable in a general purpose distro kernel.
4347
4348 Yes, let's create that!
4349
4350 I see two approaches:
4351   - Support the formatted comments in the kernel config. The script will parse them and mute/annotate the errors in its report.
4352   - Support formatted annotations in a separate file. We will run `./kconfig-hardened-check.py -c config -a annotations` and have a pretty report.
4353
4354 What do you think?
4355
4356 > > May I ask you to extract arch support into a separate pull request? We will work further to merge it.
4357
4358 > Certainly. It might not happen today but I'll get a new PR up very soon.
4359
4360 Thank you! Take your time, we are not in a hurry.
4361
4362 > I have a slightly unrelated question about the script that I'll ask here since I mentioned using this script with our Ubuntu kernel configs. What does ubuntu18 mean in the decision column of the script output? I assume that you're talking about Ubuntu 18.04 LTS but it feels like kspp should be used for nearly all of those rows instead of ubuntu18 as I consider the KSPP project as the "upstream" that makes these recommendations.
4363
4364 The `decision` column helps me to maintain the list of recommendations.
4365
4366 The values in `decision` column have this "rank" for me:
4367   1. ubuntu18
4368   2. kspp
4369   3. grsecurity and lockdown
4370   4. my
4371
4372 So I use:
4373   - `ubuntu18` for hardening recommendations already adopted by Ubuntu 18.04 LTS,
4374   - `kspp` for hardening recommendations that are listed in KSPP recommended settings but __not__ adopted by Ubuntu 18.04 LTS,
4375   - `grsecurity` for `cut_attack_surface` recommendations from their patch which are __not__ in KSPP recommended settings list,
4376   - `lockdown` for `cut_attack_surface` functionality from the lockdown patch series which is __not__ mentioned in KSPP recommended settings list,
4377   - `my` for hardening recommendations which I consider reasonable, but others don't mention.
4378
4379 Thanks for your question, I think I should document that in the README.
4380
4381 #### <img src="https://avatars.githubusercontent.com/u/32568352?v=4" width="50">[Bernhard40](https://github.com/Bernhard40) commented at [2019-01-13 12:31](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/9#issuecomment-453825869):
4382
4383 @a13xp0p0v isn't better to make `kspp` as base for recommendations instead of `ubuntu18`? As @tyhicks mentioned the current order takes it backwards . The alternative would be to use `defconfig` here. I understand that `ubuntu18` is your personal choice but it's highly opinioniated.
4384
4385 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2019-01-14 13:35](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/9#issuecomment-454006535):
4386
4387 @Bernhard40 , thanks for a reasonable comment. I will use `defconfig` as the basis.
4388
4389 #### <img src="https://avatars.githubusercontent.com/u/1051156?u=82b8caad104296ef90ffe2f5807dc34d82c31c2b&v=4" width="50">[tyhicks](https://github.com/tyhicks) commented at [2019-01-14 19:38](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/9#issuecomment-454133942):
4390
4391 Closing this pull request in favor of #10
4392
4393
4394 -------------------------------------------------------------------------------
4395
4396 # [\#8 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/8) `closed`: couldn't mount to /sysroot after compile kernel with KSPP options.
4397
4398 #### <img src="https://avatars.githubusercontent.com/u/3471772?v=4" width="50">[bryn1u](https://github.com/bryn1u) opened issue at [2018-12-17 15:33](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/8):
4399
4400 Hello Alexander,
4401
4402 After kernel compilation im getting issue "unknow filesystem type ext4", "Failed to mount /sysroot"
4403 I was wondering which KSSP feature could be responsible for it ? I was trying many times and always getting the same issue as i mentioned. Sceenshot 
4404 https://www.centos.org/forums/download/file.php?id=2571
4405 It looks like my initramfs doesn't have the kernel module for ext4 but why.
4406
4407 Im using Centos 7 with gcc 7.2
4408
4409 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2018-12-18 11:55](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/8#issuecomment-448195919):
4410
4411 Hello @bryn1u ,
4412
4413 I don't know the reason of such behavior on Centos.
4414 Distros can have various issues because of the kernel hardening options, for example systemd on Ubuntu-18 has troubles with kernel modules unloading because of CONFIG_STATIC_USERMODEHELPER.
4415
4416 It would be great if you find the reason and share the result.
4417 I would recommend you to use binary search to do it faster.
4418
4419 #### <img src="https://avatars.githubusercontent.com/u/3471772?v=4" width="50">[bryn1u](https://github.com/bryn1u) commented at [2018-12-18 22:12](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/8#issuecomment-448390343):
4420
4421 Hey,
4422
4423 I checked many options and recompiled kernel many times to find some answers, but it looks like everything works like a charm. I was doing everything based on Centos 7 with devtoolset-7 enabled to get never version of gcc like 7.2.  With CONFIG_SECURITY_LOADPIN  enabled im not able to load any module and getting "operation not permitted". Im guessing it's supposed to be like that. 
4424 @a13xp0p0v 
4425 Don't you know if ubuntu developers will enable KSPP options to the ubuntu kernel ? Or only manual compilation is available to get more security features ?
4426 Thanks !
4427
4428 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2018-12-19 11:57](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/8#issuecomment-448569306):
4429
4430 > With CONFIG_SECURITY_LOADPIN enabled im not able to load any module and getting "operation not permitted". Im guessing it's supposed to be like that.
4431
4432 Thanks for information!
4433
4434 That's the description of CONFIG_SECURITY_LOADPIN:
4435 `Any files read through the kernel file reading interface (kernel modules, firmware, kexec images, security policy) can be pinned to the first filesystem used for loading. When enabled, any files that come from other filesystems will be rejected.`
4436
4437 I guess in your case the first modules are loaded from the ramdisk, and later loading from root filesystem fails.
4438
4439 >Don't you know if ubuntu developers will enable KSPP options to the ubuntu kernel ? Or only manual compilation is available to get more security features ?
4440
4441 It's slow but steady process. More and more kernel hardening options are enabled by distros.
4442
4443 #### <img src="https://avatars.githubusercontent.com/u/3471772?v=4" width="50">[bryn1u](https://github.com/bryn1u) commented at [2018-12-22 12:38](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/8#issuecomment-449567219):
4444
4445 Hello
4446 I have a weir problem. After successfully compiled kernel i can't use iptables:
4447
4448
4449 > [root@localhost ~]# iptables -L
4450 > iptables v1.4.21: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
4451 > Perhaps iptables or your kernel needs to be upgraded.
4452
4453 What am i doing wrong ?
4454
4455 Kernel KSSP options:
4456
4457 ```
4458 option name                            | desired val | decision |       reason       ||        check result        
4459   ===================================================================================================================
4460   CONFIG_BUG                             |      y      | ubuntu18 |  self_protection   ||             OK             
4461   CONFIG_PAGE_TABLE_ISOLATION            |      y      | ubuntu18 |  self_protection   ||             OK             
4462   CONFIG_RETPOLINE                       |      y      | ubuntu18 |  self_protection   ||             OK             
4463   CONFIG_X86_64                          |      y      | ubuntu18 |  self_protection   ||             OK             
4464   CONFIG_X86_SMAP                        |      y      | ubuntu18 |  self_protection   ||             OK             
4465   CONFIG_X86_INTEL_UMIP                  |      y      | ubuntu18 |  self_protection   ||             OK             
4466   CONFIG_STRICT_KERNEL_RWX               |      y      | ubuntu18 |  self_protection   ||             OK             
4467   CONFIG_DEBUG_WX                        |      y      | ubuntu18 |  self_protection   ||             OK             
4468   CONFIG_RANDOMIZE_BASE                  |      y      | ubuntu18 |  self_protection   ||             OK             
4469   CONFIG_RANDOMIZE_MEMORY                |      y      | ubuntu18 |  self_protection   ||             OK             
4470   CONFIG_STACKPROTECTOR_STRONG           |      y      | ubuntu18 |  self_protection   ||             OK             
4471   CONFIG_VMAP_STACK                      |      y      | ubuntu18 |  self_protection   ||             OK             
4472   CONFIG_THREAD_INFO_IN_TASK             |      y      | ubuntu18 |  self_protection   ||             OK             
4473   CONFIG_SCHED_STACK_END_CHECK           |      y      | ubuntu18 |  self_protection   ||             OK             
4474   CONFIG_SLUB_DEBUG                      |      y      | ubuntu18 |  self_protection   ||             OK             
4475   CONFIG_SLAB_FREELIST_HARDENED          |      y      | ubuntu18 |  self_protection   ||             OK             
4476   CONFIG_SLAB_FREELIST_RANDOM            |      y      | ubuntu18 |  self_protection   ||             OK             
4477   CONFIG_HARDENED_USERCOPY               |      y      | ubuntu18 |  self_protection   ||             OK             
4478   CONFIG_FORTIFY_SOURCE                  |      y      | ubuntu18 |  self_protection   ||             OK             
4479   CONFIG_LOCK_DOWN_KERNEL                |      y      | ubuntu18 |  self_protection   ||      FAIL: not found       
4480   CONFIG_STRICT_MODULE_RWX               |      y      | ubuntu18 |  self_protection   ||             OK             
4481   CONFIG_MODULE_SIG                      |      y      | ubuntu18 |  self_protection   ||             OK             
4482   CONFIG_MODULE_SIG_ALL                  |      y      | ubuntu18 |  self_protection   ||             OK             
4483   CONFIG_MODULE_SIG_SHA512               |      y      | ubuntu18 |  self_protection   ||     FAIL: "is not set"     
4484   CONFIG_SYN_COOKIES                     |      y      | ubuntu18 |  self_protection   ||             OK             
4485   CONFIG_DEFAULT_MMAP_MIN_ADDR           |    65536    | ubuntu18 |  self_protection   ||             OK             
4486   CONFIG_BUG_ON_DATA_CORRUPTION          |      y      |   kspp   |  self_protection   ||             OK             
4487   CONFIG_PAGE_POISONING                  |      y      |   kspp   |  self_protection   ||             OK             
4488   CONFIG_GCC_PLUGINS                     |      y      |   kspp   |  self_protection   ||             OK             
4489   CONFIG_GCC_PLUGIN_RANDSTRUCT           |      y      |   kspp   |  self_protection   ||             OK             
4490   CONFIG_GCC_PLUGIN_STRUCTLEAK           |      y      |   kspp   |  self_protection   ||             OK             
4491   CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL |      y      |   kspp   |  self_protection   ||             OK             
4492   CONFIG_GCC_PLUGIN_LATENT_ENTROPY       |      y      |   kspp   |  self_protection   ||             OK             
4493   CONFIG_REFCOUNT_FULL                   |      y      |   kspp   |  self_protection   ||             OK             
4494   CONFIG_DEBUG_LIST                      |      y      |   kspp   |  self_protection   ||             OK             
4495   CONFIG_DEBUG_SG                        |      y      |   kspp   |  self_protection   ||             OK             
4496   CONFIG_DEBUG_CREDENTIALS               |      y      |   kspp   |  self_protection   ||             OK             
4497   CONFIG_DEBUG_NOTIFIERS                 |      y      |   kspp   |  self_protection   ||             OK             
4498   CONFIG_MODULE_SIG_FORCE                |      y      |   kspp   |  self_protection   ||     FAIL: "is not set"     
4499   CONFIG_HARDENED_USERCOPY_FALLBACK      | is not set  |   kspp   |  self_protection   ||         FAIL: "y"          
4500   CONFIG_GCC_PLUGIN_STACKLEAK            |      y      |    my    |  self_protection   ||      FAIL: not found       
4501   CONFIG_SLUB_DEBUG_ON                   |      y      |    my    |  self_protection   ||             OK             
4502   CONFIG_SECURITY_DMESG_RESTRICT         |      y      |    my    |  self_protection   ||             OK             
4503   CONFIG_STATIC_USERMODEHELPER           |      y      |    my    |  self_protection   ||             OK             
4504   CONFIG_SECURITY_LOADPIN                |      y      |    my    |  self_protection   ||     FAIL: "is not set"     
4505   CONFIG_PAGE_POISONING_NO_SANITY        | is not set  |    my    |  self_protection   ||             OK             
4506   CONFIG_PAGE_POISONING_ZERO             | is not set  |    my    |  self_protection   ||             OK             
4507   CONFIG_SLAB_MERGE_DEFAULT              | is not set  |    my    |  self_protection   ||             OK             
4508   CONFIG_SECURITY                        |      y      | ubuntu18 |  security_policy   ||             OK             
4509   CONFIG_SECURITY_YAMA                   |      y      | ubuntu18 |  security_policy   ||             OK             
4510   CONFIG_SECURITY_SELINUX_DISABLE        | is not set  | ubuntu18 |  security_policy   ||             OK             
4511   CONFIG_SECCOMP                         |      y      | ubuntu18 | cut_attack_surface ||             OK             
4512   CONFIG_SECCOMP_FILTER                  |      y      | ubuntu18 | cut_attack_surface ||             OK             
4513   CONFIG_STRICT_DEVMEM                   |      y      | ubuntu18 | cut_attack_surface ||             OK             
4514   CONFIG_ACPI_CUSTOM_METHOD              | is not set  | ubuntu18 | cut_attack_surface ||         FAIL: "m"          
4515   CONFIG_COMPAT_BRK                      | is not set  | ubuntu18 | cut_attack_surface ||             OK             
4516   CONFIG_DEVKMEM                         | is not set  | ubuntu18 | cut_attack_surface ||             OK             
4517   CONFIG_COMPAT_VDSO                     | is not set  | ubuntu18 | cut_attack_surface ||       OK: not found        
4518   CONFIG_X86_PTDUMP                      | is not set  | ubuntu18 | cut_attack_surface ||             OK             
4519   CONFIG_ZSMALLOC_STAT                   | is not set  | ubuntu18 | cut_attack_surface ||             OK             
4520   CONFIG_PAGE_OWNER                      | is not set  | ubuntu18 | cut_attack_surface ||             OK             
4521   CONFIG_DEBUG_KMEMLEAK                  | is not set  | ubuntu18 | cut_attack_surface ||             OK             
4522   CONFIG_BINFMT_AOUT                     | is not set  | ubuntu18 | cut_attack_surface ||       OK: not found        
4523   CONFIG_MMIOTRACE_TEST                  | is not set  | ubuntu18 | cut_attack_surface ||       OK: not found        
4524   CONFIG_IO_STRICT_DEVMEM                |      y      |   kspp   | cut_attack_surface ||             OK             
4525   CONFIG_LEGACY_VSYSCALL_NONE            |      y      |   kspp   | cut_attack_surface ||             OK             
4526   CONFIG_BINFMT_MISC                     | is not set  |   kspp   | cut_attack_surface ||         FAIL: "m"          
4527   CONFIG_INET_DIAG                       | is not set  |   kspp   | cut_attack_surface ||         FAIL: "m"          
4528   CONFIG_KEXEC                           | is not set  |   kspp   | cut_attack_surface ||             OK             
4529   CONFIG_PROC_KCORE                      | is not set  |   kspp   | cut_attack_surface ||             OK             
4530   CONFIG_LEGACY_PTYS                     | is not set  |   kspp   | cut_attack_surface ||             OK             
4531   CONFIG_IA32_EMULATION                  | is not set  |   kspp   | cut_attack_surface ||             OK             
4532   CONFIG_X86_X32                         | is not set  |   kspp   | cut_attack_surface ||             OK             
4533   CONFIG_MODIFY_LDT_SYSCALL              | is not set  |   kspp   | cut_attack_surface ||         FAIL: "y"          
4534   CONFIG_HIBERNATION                     | is not set  |   kspp   | cut_attack_surface ||             OK             
4535   CONFIG_KPROBES                         | is not set  |grsecurity| cut_attack_surface ||         FAIL: "y"          
4536   CONFIG_UPROBES                         | is not set  |grsecurity| cut_attack_surface ||         FAIL: "y"          
4537   CONFIG_GENERIC_TRACER                  | is not set  |grsecurity| cut_attack_surface ||         FAIL: "y"          
4538   CONFIG_PROC_VMCORE                     | is not set  |grsecurity| cut_attack_surface ||         FAIL: "y"          
4539   CONFIG_PROC_PAGE_MONITOR               | is not set  |grsecurity| cut_attack_surface ||         FAIL: "y"          
4540   CONFIG_USELIB                          | is not set  |grsecurity| cut_attack_surface ||             OK             
4541   CONFIG_CHECKPOINT_RESTORE              | is not set  |grsecurity| cut_attack_surface ||             OK             
4542   CONFIG_USERFAULTFD                     | is not set  |grsecurity| cut_attack_surface ||             OK             
4543   CONFIG_HWPOISON_INJECT                 | is not set  |grsecurity| cut_attack_surface ||             OK             
4544   CONFIG_MEM_SOFT_DIRTY                  | is not set  |grsecurity| cut_attack_surface ||       OK: not found        
4545   CONFIG_DEVPORT                         | is not set  |grsecurity| cut_attack_surface ||         FAIL: "y"          
4546   CONFIG_DEBUG_FS                        | is not set  |grsecurity| cut_attack_surface ||         FAIL: "y"          
4547   CONFIG_NOTIFIER_ERROR_INJECTION        | is not set  |grsecurity| cut_attack_surface ||             OK             
4548   CONFIG_ACPI_TABLE_UPGRADE              | is not set  | lockdown | cut_attack_surface ||         FAIL: "y"          
4549   CONFIG_ACPI_APEI_EINJ                  | is not set  | lockdown | cut_attack_surface ||         FAIL: "m"          
4550   CONFIG_PROFILING                       | is not set  | lockdown | cut_attack_surface ||         FAIL: "y"          
4551   CONFIG_BPF_SYSCALL                     | is not set  | lockdown | cut_attack_surface ||         FAIL: "y"          
4552   CONFIG_MMIOTRACE                       | is not set  |    my    | cut_attack_surface ||             OK             
4553   CONFIG_KEXEC_FILE                      | is not set  |    my    | cut_attack_surface ||         FAIL: "y"          
4554   CONFIG_LIVEPATCH                       | is not set  |    my    | cut_attack_surface ||         FAIL: "y"          
4555   CONFIG_USER_NS                         | is not set  |    my    | cut_attack_surface ||         FAIL: "y"          
4556   CONFIG_IP_DCCP                         | is not set  |    my    | cut_attack_surface ||         FAIL: "m"          
4557   CONFIG_IP_SCTP                         | is not set  |    my    | cut_attack_surface ||         FAIL: "m"          
4558   CONFIG_FTRACE                          | is not set  |    my    | cut_attack_surface ||         FAIL: "y"          
4559   CONFIG_BPF_JIT                         | is not set  |    my    | cut_attack_surface ||         FAIL: "y"          
4560   CONFIG_ARCH_MMAP_RND_BITS              |     32      |    my    |userspace_protection||         FAIL: "28"         
4561
4562 [-] config check is NOT PASSED: 29 errors
4563
4564 ```
4565
4566 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2018-12-25 12:27](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/8#issuecomment-449846419):
4567
4568 Hello @bryn1u ,
4569 The error message which you posted makes me think that your issue is about kernel modules loading.
4570 I would recommend you to look at the kernel log for more information and bisect again to find the reason.
4571
4572
4573 -------------------------------------------------------------------------------
4574
4575 # [\#7 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/7) `closed`: Removing security features during kernel compilation.
4576
4577 #### <img src="https://avatars.githubusercontent.com/u/3471772?v=4" width="50">[bryn1u](https://github.com/bryn1u) opened issue at [2018-12-05 13:21](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/7):
4578
4579 Hey,
4580
4581 Im trying do my best with security options based on your script. I have a litte problems with few options. 
4582
4583 When im adding these options:
4584 ```
4585 # Enable GCC Plugins
4586 CONFIG_GCC_PLUGINS=y
4587
4588 # Gather additional entropy at boot time for systems that may not have appropriate entropy sources.
4589 CONFIG_GCC_PLUGIN_LATENT_ENTROPY=y
4590
4591 # Force all structures to be initialized before they are passed to other functions.
4592 CONFIG_GCC_PLUGIN_STRUCTLEAK=y
4593 CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL=y
4594
4595 # Randomize the layout of system structures. This may have dramatic performance impact, so
4596 # use with caution or also use CONFIG_GCC_PLUGIN_RANDSTRUCT_PERFORMANCE=y
4597 CONFIG_GCC_PLUGIN_RANDSTRUCT=y
4598 ```
4599 And make a "make -j 8 deb-pkg" on ubuntu or "make -j8 bzImage ...." on centos, these options are removing immediately from ".config" in kernel-4.19.6 . I have no idea what's going on. Could you tell me what am i doing wrong ?
4600
4601 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2018-12-05 21:08](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/7#issuecomment-444648549):
4602
4603 Hello @bryn1u ,
4604
4605 Kconfig disables these options automatically because your gcc doesn't support plugins.
4606 If you have gcc-7 on Ubuntu, try to install gcc-7-plugin-dev package. It should help.
4607
4608 And thanks for your question. I'll add this information to README.
4609
4610 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2018-12-05 21:31](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/7#issuecomment-444656696):
4611
4612 Added 478e5f266df05b5f75badef59914c8b0e71e3e0e
4613
4614 #### <img src="https://avatars.githubusercontent.com/u/3471772?v=4" width="50">[bryn1u](https://github.com/bryn1u) commented at [2018-12-06 21:08](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/7#issuecomment-445030219):
4615
4616 Hello,
4617
4618 Now it works :) thanks ! I have one question about CONFIG_GCC_PLUGIN_STACKLEAK . This is the one option which is removing during compilation. Is it any way to enable it or isn't it available in kernel-4.19.7 yet ?
4619 Thanks again :)
4620
4621 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2018-12-07 06:59](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/7#issuecomment-445141837):
4622
4623 Yes, CONFIG_GCC_PLUGIN_STACKLEAK will be available in Linux 4.20.
4624
4625
4626 -------------------------------------------------------------------------------
4627
4628 # [\#6 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/6) `closed`: Removed long lines on output + minor fix
4629
4630 #### <img src="https://avatars.githubusercontent.com/u/7037785?u=6ac77234884c153e7fd38e3732be16d9760509ea&v=4" width="50">[c0rv4x](https://github.com/c0rv4x) opened issue at [2018-07-30 14:38](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/6):
4631
4632 I removed long lines from `print` and `format` functions.
4633 Also i edited function `get_option_state` now uses `dict.get` method to extract a key from dict with default value 
4634
4635 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2018-07-30 20:09](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/6#issuecomment-408993713):
4636
4637 Applied!
4638 Thank you @iad42 !
4639
4640
4641 -------------------------------------------------------------------------------
4642
4643 # [\#5 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/5) `closed`: Oop refactoring
4644
4645 #### <img src="https://avatars.githubusercontent.com/u/7037785?u=6ac77234884c153e7fd38e3732be16d9760509ea&v=4" width="50">[c0rv4x](https://github.com/c0rv4x) opened issue at [2018-07-28 21:49](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/5):
4646
4647 Made the program a liitle bit more OOP.
4648
4649 I created a UserConfig class to store the state of the user's config.
4650 Outputter class is responsible for outputting major results (however, not all the prints are there)
4651 OR and OptConifg were moved to a separate file
4652 Checklist got its own class with a method `check(config)` that performs all the checks from the checklist against user's config
4653
4654 #### <img src="https://avatars.githubusercontent.com/u/203012?u=939d6d3b5ff0b9e46e911d8792a40c20408574e2&v=4" width="50">[anthraxx](https://github.com/anthraxx) commented at [2018-07-30 09:43](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/5#issuecomment-408807705):
4655
4656 The last commit adds a ```__pycache__``` directory with bython bytecode cache files, that commit should be amended
4657
4658 #### <img src="https://avatars.githubusercontent.com/u/203012?u=939d6d3b5ff0b9e46e911d8792a40c20408574e2&v=4" width="50">[anthraxx](https://github.com/anthraxx) commented at [2018-07-30 09:50](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/5#issuecomment-408809392):
4659
4660 Cool that you invest time with this, but personally speaking I'm bit mixed here what the justification/gain is to introduce the complexity and split other then "but oop and modules". Right now it's quite handy to just have the whole thing in a single file that could be copied to /usr/bin dir f.e. and I don't think its expected that lots lots lots of additional modules and python functions are needed beyond this.
4661
4662 Otherwise, if the project goes the path to make it more modular, then it should at least also have setup.py dist file (you may want to add one) so it can actually be distributed and used properly as a module and by distros for packaging python.
4663
4664 My 2 cents is that a single file isn't too bad after considering the current scope and content
4665
4666 #### <img src="https://avatars.githubusercontent.com/u/7037785?u=6ac77234884c153e7fd38e3732be16d9760509ea&v=4" width="50">[c0rv4x](https://github.com/c0rv4x) commented at [2018-07-30 10:36](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/5#issuecomment-408821023):
4667
4668 You are right about `__pycache__`, that is my fault.
4669
4670 As for sticking to a single file, i clearly see your point and agree with you. However, OOP style is obviously easier to extend and easier to read. As long as the author (a13xp0p0v) is expecting the tool to grow, i consider that we should stick to an easier form of code in terms of adding code rather that terms of easy-to-run. 
4671
4672 Also, thanks for the note on setup.py file, i will surely fix that problem!
4673
4674 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2018-07-30 10:42](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/5#issuecomment-408822137):
4675
4676 Hello @iad42 and @anthraxx ,
4677
4678 Yes, Anatoly, thanks for your time! Your PR made me review the script and gave some new ideas.
4679 I see now what we can improve:
4680  1. currently parsing config file, filling 'OptCheck.state' values in 'checklist' and performing actual checks all mixed in check_config_file(). It would be nice to split them. What approaches do you see?
4681  2. there are two global vars now: 'checklist' and 'debug_mode'. I see that some of design drawbacks are connected with that fact. It would be cool to get rid of them during the refactoring.
4682  3. the script is quite small now, I like that all the functionality stays in a single file.
4683  4. @iad42 , I like how you cut the long lines in printing the output. I want to merge it. Can you put the final ')' on the second line, like that:
4684 ```
4685 print('  CONFIG_{:<32}|{:^13}|{:^10}|{:^20}||{:^28}'.format(
4686             opt.name, opt.expected, opt.decision, opt.reason, opt.result))
4687 ```
4688
4689 Thanks!
4690
4691 #### <img src="https://avatars.githubusercontent.com/u/7037785?u=6ac77234884c153e7fd38e3732be16d9760509ea&v=4" width="50">[c0rv4x](https://github.com/c0rv4x) commented at [2018-07-30 14:39](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/5#issuecomment-408886952):
4692
4693 @a13xp0p0v 
4694
4695 I created a separate pull request https://github.com/a13xp0p0v/kconfig-hardened-check/pull/6 for the 4th bullet point on your list. Also i added a tiny fix for working with dict
4696
4697
4698 -------------------------------------------------------------------------------
4699
4700 # [\#4 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/4) `closed`: Add more config files
4701
4702 #### <img src="https://avatars.githubusercontent.com/u/4661917?u=bb7aeb3c77839cea055b49b80168666b36315f3d&v=4" width="50">[theLOICofFRANCE](https://github.com/theLOICofFRANCE) opened issue at [2018-07-20 20:31](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/4):
4703
4704 Hello @a13xp0p0v,
4705
4706 Just like I promised.
4707
4708 Best regards.
4709
4710 #### <img src="https://avatars.githubusercontent.com/u/32568352?v=4" width="50">[Bernhard40](https://github.com/Bernhard40) commented at [2018-07-23 19:03](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/4#issuecomment-407166514):
4711
4712 Don't we overdo with the number of configs here? This project allows everyone for checking any config they want themselves so what is the point of storing them here? One or two as example is enough. Most of them will be outdated sooner or later anyway.
4713
4714 #### <img src="https://avatars.githubusercontent.com/u/203012?u=939d6d3b5ff0b9e46e911d8792a40c20408574e2&v=4" width="50">[anthraxx](https://github.com/anthraxx) commented at [2018-07-23 19:18](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/4#issuecomment-407170808):
4715
4716 Yeah I agree, also they are outdated quite fast and who maintains the configs?
4717 To compare and test stuff, it would make sense to have a small amount of general purpose configs like ubuntu, debian and have some hardened examples like kspp, archlinux-hardened and others. I don't think it is or should be the scope of the project to collect them all
4718
4719 #### <img src="https://avatars.githubusercontent.com/u/4661917?u=bb7aeb3c77839cea055b49b80168666b36315f3d&v=4" width="50">[theLOICofFRANCE](https://github.com/theLOICofFRANCE) commented at [2018-07-24 12:11](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/4#issuecomment-407384626):
4720
4721 Hello,
4722
4723 Allow me first of all to take stock of the results:
4724
4725 **pentoo-hardened-2018.0rc7.config** = **30 errors** (config of iso image)
4726 **Archlinux-hardened.config** = 33 errors (config available via **gitweb**)
4727 Qubes-latest.config = 38 errors (config of linux package)
4728 **Alpinelinux-edge.config** = 44 errors (config available via **gitweb**)
4729 Fedora-Rawhide.config = 48 errors (config of linux package)
4730 **Archlinux-Testing.config** = 49 errors (config available via **gitweb**)
4731 debian-sid-amd64.config = 49 errors (config of linux package)
4732 Kali-linux.config = 49 errors (config of linux package)
4733 Owl-3.1config = 50 errors (config of linux package)
4734 Parrot-security-4.1.config = 52 errors (config of linux package)
4735 ubuntu-bionic-generic.config = 52 errors (config of linux package)
4736 **oracle-uek5.config** = 54 errors (config available via **gitweb**)
4737 Mageia-cauldron.config = 57 errors (config of linux package)
4738 **SLE15.config** = 58 errors (config available via **gitweb**)
4739 **Opensuse-git.config** = 62 errors (config available via **gitweb**)
4740 Trisquel-Flidas.config = 63 errors (config of linux package)
4741
4742 All config available via **gitweb** are easy to maintain with a bash script.
4743 Then for some I didn't use the stable branch but the development branch to have an up-to-date config.
4744
4745 So I lets @a13xp0p0v choose what he prefers.
4746
4747 But I wish in any case to maintain pentoo-hardened in view of its result :smiley:
4748
4749 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2018-07-24 23:06](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/4#issuecomment-407580227):
4750
4751 Hello @HacKurx @anthraxx @Bernhard40 ,
4752
4753 Yes, we don't have a goal to collect all the configs and update them.
4754 At the same time I appreciate @HacKurx efforts.
4755
4756 So what do you think about this solution:
4757 1. drop the configs of minor distributions (Owl-3.1config, Kali-linux.config, Parrot-security-4.1.config, Mageia-cauldron.config, Trisquel-Flidas.config);
4758 2. add the concrete release/version to the config file names ("sid" and "rawhide" are bad version names since they just mean "unstable", right?);
4759 3. add a links.txt with the available links to the configs.
4760
4761 Does it sound reasonable to you?
4762
4763 #### <img src="https://avatars.githubusercontent.com/u/32568352?v=4" width="50">[Bernhard40](https://github.com/Bernhard40) commented at [2018-07-25 11:41](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/4#issuecomment-407725269):
4764
4765 Yeah, keeping well know distros and non-rolling release kernels make sense.
4766
4767 #### <img src="https://avatars.githubusercontent.com/u/4661917?u=bb7aeb3c77839cea055b49b80168666b36315f3d&v=4" width="50">[theLOICofFRANCE](https://github.com/theLOICofFRANCE) commented at [2018-07-25 19:28](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/4#issuecomment-407868315):
4768
4769 Hello @a13xp0p0v ,
4770
4771 > Does it sound reasonable to you?
4772
4773 Yeah, okay, I'll take care of it.
4774
4775 @Bernhard40 
4776
4777 > Yeah, keeping well know distros and non-rolling release kernels make sense.
4778
4779 I know, but for old kernels we need use more OR class. Example: CONFIG_DEBUG_SET_MODULE_RONX, CONFIG_DEBUG_KERNEL, CONFIG_DEBUG_RODATA.
4780
4781 In addition certain points must be corrected, as for example the recommendation "CONFIG_LKDTM" is impossible to respect without breaking the recommendation of Grsecurity on DEBUG_FS.
4782
4783 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2018-07-27 21:29](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/4#issuecomment-408543338):
4784
4785 Hello @HacKurx , thanks for your work.
4786
4787 1. I've commented out the LKDTM rule. You are right about it.
4788
4789 2. I'll check what we can do about CONFIG_DEBUG_SET_MODULE_RONX, CONFIG_DEBUG_KERNEL, CONFIG_DEBUG_RODATA. 
4790
4791 3. I've merged some of your commits, so now 'config' directory has: 
4792  -  Alpinelinux-edge.config (I want to keep it)
4793  -  Archlinux-hardened.config (ditto)
4794  -  debian-stretch.config
4795  -  oracle-uek5.config
4796  -  SLE15.config
4797  -  ubuntu-bionic-generic.config
4798
4799 May I ask you to do a bit more work to make it excellent?
4800  - could you check the links for Alpine Linux in your links.txt? They both give similar result.
4801  - could you find links for debian-stretch and ubuntu-bionic configs?
4802  - could you add configs for some stable versions of Pentoo Hardened and openSUSE?
4803 If so, in the result we will have some consistence between links.txt and config files.
4804
4805 Thank you a lot!
4806
4807 #### <img src="https://avatars.githubusercontent.com/u/4661917?u=bb7aeb3c77839cea055b49b80168666b36315f3d&v=4" width="50">[theLOICofFRANCE](https://github.com/theLOICofFRANCE) commented at [2018-07-28 06:57](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/4#issuecomment-408587814):
4808
4809 Hello @a13xp0p0v ,
4810
4811 > could you check the links for Alpine Linux in your links.txt? They both give similar result.
4812
4813 Because the edge version currently uses the same kernel as the stable 3.8 version.
4814
4815 > could you find links for debian-stretch and ubuntu-bionic configs?
4816
4817 Not sure, but I'll look.
4818
4819 > could you add configs for some stable versions of Pentoo Hardened and openSUSE?
4820
4821 Yes of course the links are in the file.
4822
4823 I'll take care of it soon.
4824 Thank you too. Best regards.
4825
4826 #### <img src="https://avatars.githubusercontent.com/u/4661917?u=bb7aeb3c77839cea055b49b80168666b36315f3d&v=4" width="50">[theLOICofFRANCE](https://github.com/theLOICofFRANCE) commented at [2018-08-01 21:45](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/4#issuecomment-409734659):
4827
4828 Hello @a13xp0p0v ,
4829
4830 > I'll check what we can do about CONFIG_DEBUG_SET_MODULE_RONX, CONFIG_DEBUG_KERNEL, CONFIG_DEBUG_RODATA.
4831
4832 Thank you, I just saw your changes regarding that. If you want to be thorough then you should also do the same for :
4833 ```
4834 PAGE_TABLE_ISOLATION             = PAX_PER_CPU_PGD, MEMORY_UDEREF_MELTDOWN
4835 RANDOMIZE_BASE, RANDOMIZE_MEMORY = PAX_ASLR
4836 HARDENED_USERCOPY                = PAX_USERCOPY
4837 GCC_PLUGIN_RANDSTRUCT            = GRKERNSEC_RANDSTRUCT
4838 GCC_PLUGIN_STRUCTLEAK            = PAX_MEMORY_STRUCTLEAK
4839 GCC_PLUGIN_STRUCTLEAK_BYREF_ALL  = PAX_MEMORY_STRUCTLEAK ?
4840 GCC_PLUGIN_LATENT_ENTROPY        = PAX_LATENT_ENTROPY
4841 REFCOUNT_FULL                    = PAX_REFCOUNT
4842 GCC_PLUGIN_STACKLEAK             = PAX_MEMORY_STACKLEAK
4843 SECURITY_YAMA                    = GRKERNSEC
4844 ```
4845
4846 It's be a good friendly gesture.
4847
4848 I'm still looking for some points and I'm quite busy but I always take care of them.
4849
4850 Regards.
4851
4852 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2018-08-03 20:52](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/4#issuecomment-410373163):
4853
4854 Hi @HacKurx ,
4855
4856 > PAGE_TABLE_ISOLATION             = PAX_PER_CPU_PGD, MEMORY_UDEREF_MELTDOWN
4857
4858 Umm... Where can I learn more about these options?
4859
4860 > RANDOMIZE_BASE, RANDOMIZE_MEMORY = PAX_ASLR
4861
4862 No, I'm absolutely sure that KASLR != PAX_ASLR.
4863
4864 > HARDENED_USERCOPY                = PAX_USERCOPY
4865 > GCC_PLUGIN_RANDSTRUCT            = GRKERNSEC_RANDSTRUCT
4866 > GCC_PLUGIN_STRUCTLEAK            = PAX_MEMORY_STRUCTLEAK
4867 > GCC_PLUGIN_STRUCTLEAK_BYREF_ALL  = PAX_MEMORY_STRUCTLEAK ?
4868 > GCC_PLUGIN_LATENT_ENTROPY        = PAX_LATENT_ENTROPY
4869 > REFCOUNT_FULL                    = PAX_REFCOUNT
4870 > GCC_PLUGIN_STACKLEAK             = PAX_MEMORY_STACKLEAK
4871
4872 Have you seen my Linux Kernel Defence Map?
4873 https://github.com/a13xp0p0v/linux-kernel-defence-map
4874 Please have a look, I've displayed the origins of these features (and praised grsecurity) in that map.
4875
4876 > SECURITY_YAMA                    = GRKERNSEC
4877
4878 Excuse me, I don't see the connection between these options. Can you share more details?
4879
4880 Thank you!
4881
4882 #### <img src="https://avatars.githubusercontent.com/u/4661917?u=bb7aeb3c77839cea055b49b80168666b36315f3d&v=4" width="50">[theLOICofFRANCE](https://github.com/theLOICofFRANCE) commented at [2018-08-04 14:56](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/4#issuecomment-410455183):
4883
4884 Hi @a13xp0p0v ,
4885
4886 > Umm... Where can I learn more about these options?
4887
4888 ```
4889  config PAGE_TABLE_ISOLATION
4890         bool "Remove the kernel mapping in user mode"
4891         default y
4892 -       depends on X86_64 && SMP
4893 +       depends on X86_64 && SMP && !PAX_PER_CPU_PGD && BROKEN
4894         help
4895           This enforces a strict kernel and user space isolation, in order
4896           to close hardware side channels on kernel address information.
4897 ```
4898
4899 and 
4900
4901 ```
4902 +config PAX_MEMORY_UDEREF_MELTDOWN
4903 +       bool "Prevent i386 Meltdown attacks (READ HELP!)"
4904 +       default n
4905 +       depends on X86_32 && PAX_MEMORY_UDEREF
4906 +       help
4907 +         By saying Y here, UDEREF will be enhanced to fully close off
4908 +         Meltdown attacks against the kernel.  This will prevent the
4909 +         creation of expand-down segments and will limit all TLS segments
4910 +         to the end of the userland address space.
4911 ...
4912 ```
4913 If you want to know more, you just have to convince a large company (google? microsoft ^^) to finance their research in a public way :innocent:
4914
4915 > No, I'm absolutely sure that KASLR != PAX_ASLR.
4916
4917 Oops I confused PAX_RANDUSTACK(depends on PAX_ASLR) and PAX_RANDKSTACK.
4918
4919 > Excuse me, I don't see the connection between these options. Can you share more details?
4920
4921 ```
4922  config SECURITY_YAMA
4923         bool "Yama support"
4924 -       depends on SECURITY
4925 +       depends on SECURITY && !GRKERNSEC
4926         default n
4927 ```
4928
4929 Because not compatible.
4930
4931 > Have you seen my Linux Kernel Defence Map?
4932
4933 Great ! I'll look into it.
4934
4935 For the rest I couldn't find a link for the complete debian and ubuntu configurations. The reason is that the files are generated automatically:
4936 https://salsa.debian.org/kernel-team/linux/tree/master/debian/config
4937 https://salsa.debian.org/kernel-team/linux/raw/master/debian/config/amd64/config
4938
4939 What about CRYPTO_SPECK, what do you think?
4940
4941 Thanks you to again.
4942
4943 #### <img src="https://avatars.githubusercontent.com/u/32568352?v=4" width="50">[Bernhard40](https://github.com/Bernhard40) commented at [2018-08-04 16:14](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/4#issuecomment-410460070):
4944
4945 > If you want to know more, you just have to convince a large company (google? microsoft ^^) to finance their research in a public way 😇
4946
4947 So, until that happens there is no point for adding support for options which almost no one can use.
4948
4949 #### <img src="https://avatars.githubusercontent.com/u/4661917?u=bb7aeb3c77839cea055b49b80168666b36315f3d&v=4" width="50">[theLOICofFRANCE](https://github.com/theLOICofFRANCE) commented at [2018-08-04 17:30](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/4#issuecomment-410465146):
4950
4951 >  So, until that happens there is no point for adding support for options which almost no one can use.
4952
4953 So you want to create a false error to the persons who uses it?
4954 KSPP's advances come from grsecurity don't forget it.
4955 Besides the old versions are still a source of inspiration, right?
4956
4957 #### <img src="https://avatars.githubusercontent.com/u/32568352?v=4" width="50">[Bernhard40](https://github.com/Bernhard40) commented at [2018-08-04 17:53](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/4#issuecomment-410466573):
4958
4959 If someone uses grsecurity private code then they should seek support from grsecurity which they pay for, not from volunteers working for free.
4960
4961 Old versions are dead, nothing we can do about it.
4962
4963 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2018-08-04 20:51](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/4#issuecomment-410476855):
4964
4965 Hello @HacKurx and @Bernhard40 ,
4966
4967 Please don't start another holy war about grsecurity.
4968 - Yes, Brad and PaX Team are genius.
4969 - Yes, a lot of KSPP work is inspired by (and sometimes copied from) grsecurity. The map shows that fact explicitly.
4970 - Yes, almost all the mainline kernel self protection features are not compatible with grsecurity (and even marked as BROKEN).
4971
4972 @HacKurx , it's great that you have access to the recent grsecurity patches, lucky you. 
4973 I don't have it, and I guess they will never give it to me.
4974 So I would like to focus on the mainline kconfig options. Moreover, grsecurity users really don't need this funny script at all.
4975
4976 Thanks for understanding.
4977
4978 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2018-08-08 12:36](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/4#issuecomment-411389774):
4979
4980 Hello @HacKurx ,
4981
4982 I've merged the rest of your PR with some fixes I previously mentioned.
4983 Thank you very much.
4984
4985 Closing it now.
4986
4987 #### <img src="https://avatars.githubusercontent.com/u/4661917?u=bb7aeb3c77839cea055b49b80168666b36315f3d&v=4" width="50">[theLOICofFRANCE](https://github.com/theLOICofFRANCE) commented at [2018-08-08 21:57](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/4#issuecomment-411565682):
4988
4989 Hello @a13xp0p0v ,
4990
4991 > it's great that you have access to the recent grsecurity patches
4992
4993 Well, not really. It's complicated... Let's just say that I have elements that you don't have and that out of respect I didn't publish them. Spender and Pipacs have always answered my questions which is not the case with Linus for example (at the terrorist attack in my country I asked him to rename the version name to "Pray for Paris") but he didn't even take the time to answer...
4994
4995 > So I would like to focus on the mainline kconfig options.
4996
4997 Ok no problem. Rest assured I am not here for divide. I do not forget that if we discuss together it is above all because we appreciate at security in linux ;)
4998
4999 > I've merged the rest of your PR with some fixes I previously mentioned.
5000
5001 Great, thank you. I haven't found much interesting since.
5002
5003 Best regards.
5004
5005
5006 -------------------------------------------------------------------------------
5007
5008 # [\#3 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/3) `closed`: Add Grsecurity recommendation on BINFMT_AOUT
5009
5010 #### <img src="https://avatars.githubusercontent.com/u/4661917?u=bb7aeb3c77839cea055b49b80168666b36315f3d&v=4" width="50">[theLOICofFRANCE](https://github.com/theLOICofFRANCE) opened issue at [2018-07-18 18:52](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/3):
5011
5012 Hi,
5013
5014 Recommendation starting from grsecurity-2.2.0-2.6.32.22-201009241805.patch.
5015 Sorry, Linux historical interest is not secure ;)
5016
5017 Sorry for the tabulations in my code :D
5018
5019 Regards,
5020
5021 #### <img src="https://avatars.githubusercontent.com/u/32568352?v=4" width="50">[Bernhard40](https://github.com/Bernhard40) commented at [2018-07-18 19:14](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/3#issuecomment-406043222):
5022
5023 I'm curious, does anyone seen kernel with that option enabled in last 10 years?
5024
5025 #### <img src="https://avatars.githubusercontent.com/u/4661917?u=bb7aeb3c77839cea055b49b80168666b36315f3d&v=4" width="50">[theLOICofFRANCE](https://github.com/theLOICofFRANCE) commented at [2018-07-18 19:49](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/3#issuecomment-406052730):
5026
5027 Today his is not the case but it is necessary to warn users better about the old code that is dangerous and that Linus will never want to delete.
5028
5029 Because otherwise I'm sure he's got geeks who'll activate him for fun...
5030
5031 #### <img src="https://avatars.githubusercontent.com/u/4661917?u=bb7aeb3c77839cea055b49b80168666b36315f3d&v=4" width="50">[theLOICofFRANCE](https://github.com/theLOICofFRANCE) commented at [2018-07-18 20:13](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/3#issuecomment-406059551):
5032
5033 @Bernhard40 to be precise (extraction from linux-4.18-rc5) shows that it's still using a little. The equipment on ARM being more recent.
5034
5035 m68k/configs/mvme147_defconfig:CONFIG_BINFMT_AOUT=m
5036 m68k/configs/apollo_defconfig:CONFIG_BINFMT_AOUT=m
5037 m68k/configs/multi_defconfig:CONFIG_BINFMT_AOUT=m
5038 m68k/configs/amiga_defconfig:CONFIG_BINFMT_AOUT=m
5039 m68k/configs/bvme6000_defconfig:CONFIG_BINFMT_AOUT=m
5040 m68k/configs/hp300_defconfig:CONFIG_BINFMT_AOUT=m
5041 m68k/configs/atari_defconfig:CONFIG_BINFMT_AOUT=m
5042 m68k/configs/q40_defconfig:CONFIG_BINFMT_AOUT=m
5043 m68k/configs/mac_defconfig:CONFIG_BINFMT_AOUT=m
5044 m68k/configs/sun3_defconfig:CONFIG_BINFMT_AOUT=m
5045 m68k/configs/sun3x_defconfig:CONFIG_BINFMT_AOUT=m
5046 m68k/configs/mvme16x_defconfig:CONFIG_BINFMT_AOUT=m
5047
5048 arm/configs/iop32x_defconfig:CONFIG_BINFMT_AOUT=y
5049 arm/configs/badge4_defconfig:CONFIG_BINFMT_AOUT=m
5050 arm/configs/corgi_defconfig:CONFIG_BINFMT_AOUT=m
5051 arm/configs/neponset_defconfig:CONFIG_BINFMT_AOUT=y
5052 arm/configs/imote2_defconfig:CONFIG_BINFMT_AOUT=m
5053 arm/configs/lart_defconfig:CONFIG_BINFMT_AOUT=y
5054 arm/configs/ebsa110_defconfig:CONFIG_BINFMT_AOUT=y
5055 arm/configs/hackkit_defconfig:CONFIG_BINFMT_AOUT=y
5056 arm/configs/ezx_defconfig:CONFIG_BINFMT_AOUT=m
5057 arm/configs/jornada720_defconfig:CONFIG_BINFMT_AOUT=y
5058 arm/configs/rpc_defconfig:CONFIG_BINFMT_AOUT=y
5059 arm/configs/nuc960_defconfig:CONFIG_BINFMT_AOUT=y
5060 arm/configs/nuc950_defconfig:CONFIG_BINFMT_AOUT=y
5061 arm/configs/spitz_defconfig:CONFIG_BINFMT_AOUT=m
5062 arm/configs/footbridge_defconfig:CONFIG_BINFMT_AOUT=y
5063 arm/configs/netwinder_defconfig:CONFIG_BINFMT_AOUT=y
5064 arm/configs/iop13xx_defconfig:CONFIG_BINFMT_AOUT=y
5065 arm/configs/iop33x_defconfig:CONFIG_BINFMT_AOUT=y
5066
5067 #### <img src="https://avatars.githubusercontent.com/u/4661917?u=bb7aeb3c77839cea055b49b80168666b36315f3d&v=4" width="50">[theLOICofFRANCE](https://github.com/theLOICofFRANCE) commented at [2018-07-19 19:02](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/3#issuecomment-406381446):
5068
5069 No thanks to you @a13xp0p0v 
5070
5071 I have corrected as requested, I hope it will suit you.
5072 I've done everything since the github editor which explains the many commit.
5073
5074 Too bad kconfig is so limited with conditions because it would be nice to have a menu to choose its security level (basic, custom, paranoid) when configuring the linux kernel.
5075
5076 So I took my inspiration from grsec to make something simpler:
5077 https://github.com/HacKurx/public-sharing/blob/master/disables_unsecured_options.patch
5078
5079 Thanks, best regards.
5080
5081 #### <img src="https://avatars.githubusercontent.com/u/203012?u=939d6d3b5ff0b9e46e911d8792a40c20408574e2&v=4" width="50">[anthraxx](https://github.com/anthraxx) commented at [2018-07-19 20:43](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/3#issuecomment-406408269):
5082
5083 @HacKurx btw, i have seen you added Arch Linux config: there is a hardened arch kernel as well with more protective options.
5084
5085 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2018-07-19 21:08](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/3#issuecomment-406414918):
5086
5087 Hello @HacKurx,
5088
5089 Cool thanks, I'll merge it soon!
5090
5091 I only will not take dropping "not found" from OK status, since it is important information:
5092 explicit "is not set" is different from the option absence in the config file, I want it to be displayed in the script output.
5093
5094 Thanks again!
5095 Till soon.
5096
5097 #### <img src="https://avatars.githubusercontent.com/u/4661917?u=bb7aeb3c77839cea055b49b80168666b36315f3d&v=4" width="50">[theLOICofFRANCE](https://github.com/theLOICofFRANCE) commented at [2018-07-20 11:56](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/3#issuecomment-406579032):
5098
5099 @anthraxx 
5100 > there is a hardened arch kernel as well with more protective options.
5101
5102 Yes indeed. It's fixed.
5103
5104 @a13xp0p0v 
5105
5106 I will have fun adding main distributions config but it would be necessary to create a folder not to pollute it.
5107 This will allow an easy comparison to be made.
5108
5109 What do you think of that?
5110
5111 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2018-07-20 12:26](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/3#issuecomment-406585795):
5112
5113 Yes, moving configs into a separate directory is a good idea.
5114
5115 #### <img src="https://avatars.githubusercontent.com/u/4661917?u=bb7aeb3c77839cea055b49b80168666b36315f3d&v=4" width="50">[theLOICofFRANCE](https://github.com/theLOICofFRANCE) commented at [2018-07-20 14:59](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/3#issuecomment-406627110):
5116
5117 It's done.
5118
5119 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2018-07-20 18:10](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/3#issuecomment-406683275):
5120
5121 Hello @HacKurx,
5122 Thanks for your work, it's merged (except "not found" dropping).
5123 Nice!
5124
5125 #### <img src="https://avatars.githubusercontent.com/u/4661917?u=bb7aeb3c77839cea055b49b80168666b36315f3d&v=4" width="50">[theLOICofFRANCE](https://github.com/theLOICofFRANCE) commented at [2018-07-20 18:54](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/3#issuecomment-406695869):
5126
5127 Thank you to you too.
5128 I will complete the config_files folder because the results are very interesting :)
5129
5130 See you soon. Best regards,
5131
5132
5133 -------------------------------------------------------------------------------
5134
5135 # [\#2 PR](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/2) `closed`: Feature/improvements
5136
5137 #### <img src="https://avatars.githubusercontent.com/u/203012?u=939d6d3b5ff0b9e46e911d8792a40c20408574e2&v=4" width="50">[anthraxx](https://github.com/anthraxx) opened issue at [2018-06-20 22:14](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/2):
5138
5139 Improve the source to make it easier to iterate over options by making the checks and all kernel config options a dictionary. Additionally implement logical operator to support or conditional checks.
5140
5141 Refactor option parsing to use pythons argparse
5142
5143 #### <img src="https://avatars.githubusercontent.com/u/203012?u=939d6d3b5ff0b9e46e911d8792a40c20408574e2&v=4" width="50">[anthraxx](https://github.com/anthraxx) commented at [2018-06-20 22:16](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/2#issuecomment-398915150):
5144
5145 At the end lots of lines changed, please ask anything you want to suggest any changes you would like to see. Even through the changes look massive, I believe they will pay out and make some stuff easier to maintain and access for potential future features.
5146
5147 I'm happy to take any feedback :cat:
5148
5149 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2018-06-21 20:50](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/2#issuecomment-399239396):
5150
5151 Thank you very much for your time spent on that!
5152 I like the ideas behind your changes and I want to merge them in the end.
5153
5154 Currently I have 2 concerns about the changes:
5155 1. the commits are really big, I would like to split them. From the top of my head, we can split infrastructure changes from new checks, etc.
5156 2. we should consider the case: MODULES or (MODULE_SIG and MODULE_SIG_ALL and MODULE_SIG_SHA512).
5157
5158 How much time would you like to spend on this? I don't have a right to ask you for more.
5159 At least I see your ideas and I can split (and learn) the commits myself.
5160
5161 Thank you, again.
5162
5163 #### <img src="https://avatars.githubusercontent.com/u/203012?u=939d6d3b5ff0b9e46e911d8792a40c20408574e2&v=4" width="50">[anthraxx](https://github.com/anthraxx) commented at [2018-06-21 23:13](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/2#issuecomment-399271969):
5164
5165 All of this sounds reasonable to me! I already spent some time on this and I'm sure I may contribute in the future as well so I would be super happy to change the commits as long as it satisfies you!
5166 I will split out the DEVMEM and STACKPROTECTOR changes and see if I can split at even more. Should be easy with rebase edit.
5167
5168 Latter case you described should easily be possible with an AND class that is like the OR class, everything else should work out of the box.
5169
5170 Cheers
5171 Levente
5172
5173 #### <img src="https://avatars.githubusercontent.com/u/32568352?v=4" width="50">[Bernhard40](https://github.com/Bernhard40) commented at [2018-06-22 20:50](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/2#issuecomment-399578012):
5174
5175 Just FYI, in Linux 4.18 `CC_STACKPROTECTOR_STRONG` [was renamed](https://github.com/torvalds/linux/blob/v4.18-rc1/arch/Kconfig#L585) to `STACKPROTECTOR_STRONG` and `CC_STACKPROTECTOR_AUTO` is gone.
5176
5177 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2018-06-25 16:27](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/2#issuecomment-400013145):
5178
5179 Thanks for the info, @Bernhard40. I'll update the STACKPROTECTOR config option when 4.18 is released.
5180
5181 #### <img src="https://avatars.githubusercontent.com/u/203012?u=939d6d3b5ff0b9e46e911d8792a40c20408574e2&v=4" width="50">[anthraxx](https://github.com/anthraxx) commented at [2018-06-25 22:47](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/2#issuecomment-400119687):
5182
5183 @a13xp0p0v I have splitted up the commits as much as made sense, can you please take a look? Really don't fear nitpicking, I'm used to do open-source :yum: 
5184
5185 PS: this also handles STACKPROTECTOR_STRONG by using the OR operator.
5186
5187 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2018-06-26 21:26](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/2#issuecomment-400467818):
5188
5189 Thanks a lot for your work, @anthraxx !
5190 I'll review this version in a couple of days.
5191 Till soon.
5192
5193 #### <img src="https://avatars.githubusercontent.com/u/203012?u=939d6d3b5ff0b9e46e911d8792a40c20408574e2&v=4" width="50">[anthraxx](https://github.com/anthraxx) commented at [2018-07-09 18:23](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/2#issuecomment-403574284):
5194
5195 @a13xp0p0v round 2, fight! :cat:
5196
5197 #### <img src="https://avatars.githubusercontent.com/u/203012?u=939d6d3b5ff0b9e46e911d8792a40c20408574e2&v=4" width="50">[anthraxx](https://github.com/anthraxx) commented at [2018-07-14 09:00](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/2#issuecomment-405010041):
5198
5199 Well I personally don't think it's a good idea to parse and check one line separately and don't really see why It can't be a dict. Curious how you want to check AND and OR logic on other opts if the config it not fully parsed yet. Personally, parsing it yet again for such logic sounds like non optimal algorithm/approach to me.
5200
5201 #### <img src="https://avatars.githubusercontent.com/u/203012?u=939d6d3b5ff0b9e46e911d8792a40c20408574e2&v=4" width="50">[anthraxx](https://github.com/anthraxx) commented at [2018-07-14 09:02](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/2#issuecomment-405010151):
5202
5203 Why not just check for existence before assigning parsed_options[config] and call it a day?
5204
5205 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2018-07-14 20:05](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/2#issuecomment-405046688):
5206
5207 Ah, yes, I see.
5208 You are right. AND & OR logic can't be implemented if we check the config file line by line.
5209 Moreover, separating parsing the file and checks should be a good design solution.
5210
5211 So the first commit in the series is fine.
5212 I would only ask to add the assertion to get_option_state() and call this function outside the Opt class method (just use the Opt.name from outside).
5213 I would also ask to reorder the series:
5214   1. all arch changes and renaming;
5215   2. AND & OR;
5216   3. new rules.
5217
5218 If you have no time/motivation for that work, I will do it myself.
5219
5220 Thanks again, @anthraxx. I'm glad to have your attention to this project.
5221
5222 #### <img src="https://avatars.githubusercontent.com/u/203012?u=939d6d3b5ff0b9e46e911d8792a40c20408574e2&v=4" width="50">[anthraxx](https://github.com/anthraxx) commented at [2018-07-14 20:57](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/2#issuecomment-405049389):
5223
5224 Yay! No worries, I like to discuss solutions and opinions as collaborative work and exchange is much more effective!
5225 I would be happy to make the changes as you requested, will push an update and rebased version very soon.
5226 Cheers 🍻
5227
5228 #### <img src="https://avatars.githubusercontent.com/u/4661917?u=bb7aeb3c77839cea055b49b80168666b36315f3d&v=4" width="50">[theLOICofFRANCE](https://github.com/theLOICofFRANCE) commented at [2018-07-19 19:14](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/2#issuecomment-406384461):
5229
5230 I don't know if you're doing it, but CONFIG_ARCH_MMAP_RND_BITS should be replaced by: 
5231 ```
5232 CONFIG_ARCH_MMAP_RND_BITS_MIN=28
5233 CONFIG_ARCH_MMAP_RND_BITS_MAX=32
5234 ```
5235
5236 found in Linux kernels: 4.5–4.17, 4.18-rc+HEAD
5237
5238 #### <img src="https://avatars.githubusercontent.com/u/203012?u=939d6d3b5ff0b9e46e911d8792a40c20408574e2&v=4" width="50">[anthraxx](https://github.com/anthraxx) commented at [2018-07-19 20:44](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/2#issuecomment-406408491):
5239
5240 @HacKurx no, i really want to get this PR through finally. After that me, you or whoever can make that CONFIG_ARCH_MMAP_RND_BITS change.
5241
5242 #### <img src="https://avatars.githubusercontent.com/u/203012?u=939d6d3b5ff0b9e46e911d8792a40c20408574e2&v=4" width="50">[anthraxx](https://github.com/anthraxx) commented at [2018-07-19 20:48](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/2#issuecomment-406409433):
5243
5244 @a13xp0p0v I have made the adjustments you wanted to see:
5245 - get_option_state is moved out of the class and assigned before checking
5246 - reordered all commits (wow, this was quite some work >.>)
5247
5248 I really hope we can get this in soon, I'm still there to make any changes if you request some but quite a lot of time already went in to make you happy :cat: :cat:
5249
5250 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2018-07-19 20:56](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/2#issuecomment-406411723):
5251
5252 Hello @anthraxx 
5253
5254 Cool, thanks for your work, I'm going to do the review soon.
5255 Yes, we've already spent plenty of time on that, because it's not so easy: this PR changes almost everything :)
5256
5257 Anyway, I like your ideas, they will be merged in the end.
5258
5259 #### <img src="https://avatars.githubusercontent.com/u/203012?u=939d6d3b5ff0b9e46e911d8792a40c20408574e2&v=4" width="50">[anthraxx](https://github.com/anthraxx) commented at [2018-07-19 20:58](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/2#issuecomment-406412140):
5260
5261 @a13xp0p0v Yay thanks, don't get me wrong I really like to work with you on this and i really enjoy it very much. Also I'm 100% on your side to get commits that make it into the tree proper, I just wanted to get that the rework conflicted a lot off my chest :smile:
5262
5263 #### <img src="https://avatars.githubusercontent.com/u/203012?u=939d6d3b5ff0b9e46e911d8792a40c20408574e2&v=4" width="50">[anthraxx](https://github.com/anthraxx) commented at [2018-07-19 21:15](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/2#issuecomment-406416764):
5264
5265 @a13xp0p0v just in case you already pulled my branch, please re-pull as there was a typo in the STACKPROTECTOR option, sorry. tested and reviewd every single commit independent from each other again
5266
5267 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2018-07-20 18:09](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/2#issuecomment-406683207):
5268
5269 Hello @anthraxx,
5270
5271 I've cherry-picked all your architecture improvements and added some minor fixes (please have a look).
5272 You've done a great job, I appreciate it!
5273
5274 Now we are ready to merge your OR and AND support.
5275 I have some questions, could you answer please?
5276
5277 #### <img src="https://avatars.githubusercontent.com/u/203012?u=939d6d3b5ff0b9e46e911d8792a40c20408574e2&v=4" width="50">[anthraxx](https://github.com/anthraxx) commented at [2018-07-21 08:12](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/2#issuecomment-406779757):
5278
5279 These are used to print the table and use the very first option of a logical class to represent the group by showing the first entries name and expected value
5280
5281 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2018-07-24 22:00](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/2#issuecomment-407566128):
5282
5283 Hello @anthraxx ,
5284 Thanks for your explanation.
5285 It took me some time to realize that self.opts[0] is the option which that OR-check is about.
5286 I.e. OR class use case is: OR(<X_is_hardened>, <X_is_disabled>)
5287
5288 I've merged your OR class with my minor fixes.
5289
5290 I don't think that we need AND right now. Rationale: our config checks are already implicitly connected with AND; if any of them fails, the error count increments anyway. Do you agree?
5291
5292 I also have a question about your STACKPROTECTOR commit.
5293 As I see in the kernel git history, the "CC_" prefix is dropped from both STACKPROTECTOR and STACKPROTECTOR_STRONG. So how about having:
5294 ```
5295 -    checklist.append(OptCheck('CC_STACKPROTECTOR',       'y', 'ubuntu18', 'self_protection'))
5296 -    checklist.append(OptCheck('CC_STACKPROTECTOR_STRONG','y', 'ubuntu18', 'self_protection'))
5297 +    checklist.append(OR(OptCheck('CC_STACKPROTECTOR',    'y', 'ubuntu18', 'self_protection'), \
5298 +                        OptCheck('STACKPROTECTOR',       'y', 'ubuntu18', 'self_protection')))
5299 +    checklist.append(OR(OptCheck('CC_STACKPROTECTOR_STRONG','y', 'ubuntu18', 'self_protection'), \
5300 +                        OptCheck('STACKPROTECTOR_STRONG','y', 'ubuntu18', 'self_protection')))
5301 ```
5302
5303 #### <img src="https://avatars.githubusercontent.com/u/203012?u=939d6d3b5ff0b9e46e911d8792a40c20408574e2&v=4" width="50">[anthraxx](https://github.com/anthraxx) commented at [2018-07-24 22:41](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/2#issuecomment-407575301):
5304
5305 @a13xp0p0v Hmm true, it is for >= 4.18 but for all kernels before 4.18 this would generate an error where non should be. Having CC_STACKPROTECTOR_STRONG without CC_STACKPROTECTOR is a totally correct setting pre 4.18 which would yield to an error.
5306 Its shitty, but the more generally compatible way would be to combine the different "correct sets" with the logical class to just have a single checklist.append for STACKPROTECTOR
5307
5308 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2018-07-24 23:19](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/2#issuecomment-407582510):
5309
5310 And how about this?
5311 ```
5312 -    checklist.append(OptCheck('CC_STACKPROTECTOR',       'y', 'ubuntu18', 'self_protection'))
5313 -    checklist.append(OptCheck('CC_STACKPROTECTOR_STRONG','y', 'ubuntu18', 'self_protection'))
5314 +    checklist.append(OR(OptCheck('CC_STACKPROTECTOR_STRONG','y', 'ubuntu18', 'self_protection'), \
5315 +                        OptCheck('STACKPROTECTOR_STRONG','y', 'ubuntu18', 'self_protection')))
5316 ```
5317
5318 It fits your logic "be strong or fail".
5319 At the same time it fits the case of old configs, where there is no CC_STACKPROTECTOR, right?
5320
5321 #### <img src="https://avatars.githubusercontent.com/u/203012?u=939d6d3b5ff0b9e46e911d8792a40c20408574e2&v=4" width="50">[anthraxx](https://github.com/anthraxx) commented at [2018-07-25 07:05](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/2#issuecomment-407655722):
5322
5323 yeah, i think that should work :smiley_cat:
5324
5325 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2018-07-25 11:45](https://github.com/a13xp0p0v/kconfig-hardened-check/pull/2#issuecomment-407726202):
5326
5327 Done with STACKPROTECTOR and MODULES.
5328 @anthraxx we have finished with this pull request.
5329 Thanks for your excellent work :thumbsup:
5330
5331
5332 -------------------------------------------------------------------------------
5333
5334 # [\#1 Issue](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/1) `closed`: Couple ideas
5335
5336 #### <img src="https://avatars.githubusercontent.com/u/32568352?v=4" width="50">[Bernhard40](https://github.com/Bernhard40) opened issue at [2018-06-20 13:19](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/1):
5337
5338 Shouldn't [NAMESPACES](https://github.com/a13xp0p0v/kconfig-hardened-check/blob/master/kconfig-hardened-check.py#L94) be replaced by `USER_NS`? AFAIK only user namespaces have security concerns, others are fine. Disabling them all will negatively affect many applications which use various namespaces for sandboxing.
5339
5340 Since linux 4.16 there is `CC_STACKPROTECTOR_AUTO` kconfig which effectively replaces [CC_STACKPROTECTOR_STRONG](https://github.com/a13xp0p0v/kconfig-hardened-check/blob/master/kconfig-hardened-check.py#L54) and make it false negative in script.
5341
5342 Script doesn't check for [DEVMEM](https://github.com/a13xp0p0v/kconfig-hardened-check/blob/master/kspp-recommendations.config#L18) which when set to `n` make [STRICT_DEVMEM](https://github.com/a13xp0p0v/kconfig-hardened-check/blob/master/kconfig-hardened-check.py#L38) and [IO_STRICT_DEVMEM](https://github.com/a13xp0p0v/kconfig-hardened-check/blob/master/kconfig-hardened-check.py#L65) false negative.
5343
5344
5345
5346 #### <img src="https://avatars.githubusercontent.com/u/203012?u=939d6d3b5ff0b9e46e911d8792a40c20408574e2&v=4" width="50">[anthraxx](https://github.com/anthraxx) commented at [2018-06-20 13:23](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/1#issuecomment-398746587):
5347
5348 I already nearly finished a PR for the DEVMEM and CC_STACKPROTECTOR_* case by adding context aware logic to the option checks.
5349 Pull request incoming later today, it extends the options with logical operators like OR()
5350
5351 #### <img src="https://avatars.githubusercontent.com/u/203012?u=939d6d3b5ff0b9e46e911d8792a40c20408574e2&v=4" width="50">[anthraxx](https://github.com/anthraxx) commented at [2018-06-20 19:14](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/1#issuecomment-398864576):
5352
5353 @a13xp0p0v please no force push, that creates weird merge diffs when working on something :smile_cat:
5354
5355 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2018-06-20 20:43](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/1#issuecomment-398890140):
5356
5357 @Bernhard40 , thanks a lot for the ideas. I agree. Just fixed the namespaces mistake.
5358 @anthraxx , thanks, cool! Waiting for your PR.
5359 And, yes, no more force push from me.
5360
5361 #### <img src="https://avatars.githubusercontent.com/u/1419667?u=de82e29061c3ef5f1c19f95528f8a82b08051fd2&v=4" width="50">[a13xp0p0v](https://github.com/a13xp0p0v) commented at [2018-07-04 15:38](https://github.com/a13xp0p0v/kconfig-hardened-check/issues/1#issuecomment-402512111):
5362
5363 Closing, since @anthraxx PR will resolve it.
5364
5365
5366 -------------------------------------------------------------------------------
5367